From 5be3c9ab7708c24561e8ecbcf6420298d23b1bab Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 12 Dec 2025 16:27:35 +0100 Subject: [PATCH 1/4] Generate Checkout --- .../com/adyen/model/checkout/AccountInfo.java | 250 +++++- .../com/adyen/model/checkout/AcctInfo.java | 213 ++++- .../com/adyen/model/checkout/AchDetails.java | 187 +++- .../checkout/AdditionalData3DSecure.java | 115 ++- .../model/checkout/AdditionalDataAirline.java | 393 +++++++- .../checkout/AdditionalDataCarRental.java | 337 ++++++- .../model/checkout/AdditionalDataCommon.java | 277 +++++- .../model/checkout/AdditionalDataLevel23.java | 304 ++++++- .../model/checkout/AdditionalDataLodging.java | 261 +++++- .../checkout/AdditionalDataOpenInvoice.java | 319 ++++++- .../model/checkout/AdditionalDataOpi.java | 63 +- .../model/checkout/AdditionalDataRatepay.java | 143 ++- .../model/checkout/AdditionalDataRetry.java | 88 +- .../model/checkout/AdditionalDataRisk.java | 353 +++++++- .../AdditionalDataRiskStandalone.java | 211 ++++- .../checkout/AdditionalDataSubMerchant.java | 233 ++++- .../AdditionalDataTemporaryServices.java | 188 +++- .../model/checkout/AdditionalDataWallets.java | 116 ++- .../com/adyen/model/checkout/Address.java | 119 ++- .../adyen/model/checkout/AffirmDetails.java | 81 +- .../adyen/model/checkout/AfterpayDetails.java | 135 ++- .../java/com/adyen/model/checkout/Agency.java | 71 +- .../com/adyen/model/checkout/Airline.java | 185 +++- .../model/checkout/AmazonPayDetails.java | 108 ++- .../java/com/adyen/model/checkout/Amount.java | 101 ++- .../com/adyen/model/checkout/Amounts.java | 71 +- .../com/adyen/model/checkout/AncvDetails.java | 114 ++- .../model/checkout/AndroidPayDetails.java | 81 +- .../adyen/model/checkout/ApplePayDetails.java | 129 ++- .../model/checkout/ApplePayDonations.java | 129 ++- .../checkout/ApplePaySessionRequest.java | 87 +- .../checkout/ApplePaySessionResponse.java | 62 +- .../adyen/model/checkout/ApplicationInfo.java | 114 ++- .../model/checkout/AuthenticationData.java | 87 +- .../checkout/BacsDirectDebitDetails.java | 149 +++- .../model/checkout/BalanceCheckRequest.java | 505 ++++++++++- .../model/checkout/BalanceCheckResponse.java | 123 ++- .../adyen/model/checkout/BillDeskDetails.java | 97 +- .../adyen/model/checkout/BillingAddress.java | 119 ++- .../com/adyen/model/checkout/BlikDetails.java | 114 ++- .../com/adyen/model/checkout/BrowserInfo.java | 143 ++- .../model/checkout/CancelOrderRequest.java | 71 +- .../model/checkout/CancelOrderResponse.java | 71 +- .../model/checkout/CardBrandDetails.java | 71 +- .../com/adyen/model/checkout/CardDetails.java | 341 ++++++- .../model/checkout/CardDetailsRequest.java | 108 ++- .../model/checkout/CardDetailsResponse.java | 98 +- .../adyen/model/checkout/CardDonations.java | 341 ++++++- .../adyen/model/checkout/CashAppDetails.java | 165 +++- .../model/checkout/CellulantDetails.java | 97 +- .../model/checkout/CheckoutAwaitAction.java | 97 +- .../model/checkout/CheckoutBankAccount.java | 153 +++- .../checkout/CheckoutBankTransferAction.java | 204 ++++- ...CheckoutDelegatedAuthenticationAction.java | 124 ++- .../checkout/CheckoutForwardRequest.java | 463 ++++++++++ .../CheckoutForwardRequestOptions.java | 353 ++++++++ .../checkout/CheckoutForwardResponse.java | 292 ++++++ .../CheckoutForwardResponseFromUrl.java | 289 ++++++ .../CheckoutNativeRedirectAction.java | 121 ++- .../checkout/CheckoutNetworkTokenOption.java | 230 +++++ .../model/checkout/CheckoutOrderResponse.java | 119 ++- .../CheckoutOutgoingForwardRequest.java | 513 +++++++++++ .../model/checkout/CheckoutPaymentMethod.java | 97 +- .../model/checkout/CheckoutQrCodeAction.java | 119 ++- .../checkout/CheckoutRedirectAction.java | 109 ++- .../model/checkout/CheckoutSDKAction.java | 108 ++- .../CheckoutSessionInstallmentOption.java | 82 +- .../CheckoutSessionThreeDS2RequestData.java | 103 ++- .../checkout/CheckoutThreeDS2Action.java | 131 ++- .../model/checkout/CheckoutVoucherAction.java | 268 +++++- .../com/adyen/model/checkout/CommonField.java | 71 +- .../com/adyen/model/checkout/Company.java | 119 ++- .../CreateCheckoutSessionRequest.java | 712 ++++++++++++++- .../CreateCheckoutSessionResponse.java | 740 +++++++++++++++- .../model/checkout/CreateOrderRequest.java | 97 +- .../model/checkout/CreateOrderResponse.java | 153 +++- .../checkout/DefaultErrorResponseEntity.java | 141 ++- .../adyen/model/checkout/DeliveryAddress.java | 140 ++- .../adyen/model/checkout/DeliveryMethod.java | 108 ++- .../com/adyen/model/checkout/Destination.java | 321 +++++++ .../DetailsRequestAuthenticationData.java | 63 +- .../model/checkout/DeviceRenderOptions.java | 71 +- .../com/adyen/model/checkout/DokuDetails.java | 119 ++- .../com/adyen/model/checkout/Donation.java | 108 ++- .../model/checkout/DonationCampaign.java | 165 +++- .../checkout/DonationCampaignsRequest.java | 81 +- .../checkout/DonationCampaignsResponse.java | 63 +- .../checkout/DonationPaymentRequest.java | 491 +++++++++- .../checkout/DonationPaymentResponse.java | 130 ++- .../model/checkout/DragonpayDetails.java | 108 ++- .../checkout/EBankingFinlandDetails.java | 98 +- .../checkout/EcontextVoucherDetails.java | 130 ++- .../com/adyen/model/checkout/EftDetails.java | 144 ++- .../model/checkout/EncryptedOrderData.java | 71 +- .../model/checkout/EnhancedSchemeData.java | 114 ++- .../model/checkout/ExternalPlatform.java | 80 +- .../model/checkout/ExternalTokenDetails.java | 642 ++++++++++++++ .../adyen/model/checkout/FastlaneDetails.java | 115 ++- .../com/adyen/model/checkout/ForexQuote.java | 173 +++- .../model/checkout/FraudCheckResult.java | 80 +- .../com/adyen/model/checkout/FraudResult.java | 71 +- .../com/adyen/model/checkout/FundOrigin.java | 107 ++- .../adyen/model/checkout/FundRecipient.java | 173 +++- .../GenericIssuerPaymentMethodDetails.java | 123 ++- .../model/checkout/GooglePayDetails.java | 150 +++- .../model/checkout/GooglePayDonations.java | 150 +++- .../adyen/model/checkout/IdealDetails.java | 119 ++- .../adyen/model/checkout/IdealDonations.java | 120 ++- .../com/adyen/model/checkout/InputDetail.java | 151 +++- .../model/checkout/InstallmentOption.java | 97 +- .../adyen/model/checkout/Installments.java | 80 +- .../adyen/model/checkout/InvalidField.java | 80 +- .../java/com/adyen/model/checkout/Item.java | 72 +- .../adyen/model/checkout/ItemDetailLine.java | 664 ++++++++++++++ .../adyen/model/checkout/KlarnaDetails.java | 144 ++- .../java/com/adyen/model/checkout/Leg.java | 143 ++- .../adyen/model/checkout/LevelTwoThree.java | 621 +++++++++++++ .../com/adyen/model/checkout/LineItem.java | 311 ++++++- .../ListStoredPaymentMethodsResponse.java | 90 +- .../com/adyen/model/checkout/Mandate.java | 143 ++- .../model/checkout/MasterpassDetails.java | 113 ++- .../adyen/model/checkout/MbwayDetails.java | 108 ++- .../adyen/model/checkout/MerchantDevice.java | 80 +- .../model/checkout/MerchantRiskIndicator.java | 196 +++- .../model/checkout/MobilePayDetails.java | 81 +- .../adyen/model/checkout/MolPayDetails.java | 97 +- .../java/com/adyen/model/checkout/Name.java | 71 +- .../model/checkout/OpenInvoiceDetails.java | 135 ++- .../com/adyen/model/checkout/Passenger.java | 108 ++- .../PayByBankAISDirectDebitDetails.java | 112 ++- .../model/checkout/PayByBankDetails.java | 97 +- .../adyen/model/checkout/PayPalDetails.java | 154 +++- .../adyen/model/checkout/PayPayDetails.java | 108 ++- .../adyen/model/checkout/PayToDetails.java | 115 ++- .../model/checkout/PayToPaymentMethod.java | 60 +- .../adyen/model/checkout/PayUUpiDetails.java | 129 ++- .../model/checkout/PayWithGoogleDetails.java | 140 ++- .../checkout/PayWithGoogleDonations.java | 142 ++- .../com/adyen/model/checkout/Payment.java | 97 +- .../checkout/PaymentAmountUpdateRequest.java | 136 ++- .../checkout/PaymentAmountUpdateResponse.java | 145 ++- .../model/checkout/PaymentCancelRequest.java | 98 +- .../model/checkout/PaymentCancelResponse.java | 109 ++- .../model/checkout/PaymentCaptureRequest.java | 145 ++- .../checkout/PaymentCaptureResponse.java | 155 +++- .../checkout/PaymentCompletionDetails.java | 260 +++++- .../adyen/model/checkout/PaymentDetails.java | 87 +- .../model/checkout/PaymentDetailsRequest.java | 100 ++- .../checkout/PaymentDetailsResponse.java | 228 ++++- .../model/checkout/PaymentLinkRequest.java | 488 +++++++++- .../model/checkout/PaymentLinkResponse.java | 524 ++++++++++- .../adyen/model/checkout/PaymentMethod.java | 167 +++- .../model/checkout/PaymentMethodGroup.java | 81 +- .../model/checkout/PaymentMethodIssuer.java | 80 +- .../model/checkout/PaymentMethodToStore.java | 177 +++- .../model/checkout/PaymentMethodUPIApps.java | 71 +- .../model/checkout/PaymentMethodsRequest.java | 288 +++++- .../checkout/PaymentMethodsResponse.java | 73 +- .../model/checkout/PaymentRefundRequest.java | 156 +++- .../model/checkout/PaymentRefundResponse.java | 166 +++- .../adyen/model/checkout/PaymentRequest.java | 836 +++++++++++++++++- .../adyen/model/checkout/PaymentResponse.java | 213 ++++- .../checkout/PaymentReversalRequest.java | 98 +- .../checkout/PaymentReversalResponse.java | 109 ++- .../model/checkout/PaymentValidations.java | 70 +- .../PaymentValidationsNameRequest.java | 196 ++++ .../PaymentValidationsNameResponse.java | 80 +- ...ymentValidationsNameResultRawResponse.java | 110 ++- .../PaymentValidationsNameResultResponse.java | 98 +- .../checkout/PaymentValidationsResponse.java | 62 +- .../checkout/PaypalUpdateOrderRequest.java | 119 ++- .../checkout/PaypalUpdateOrderResponse.java | 71 +- .../java/com/adyen/model/checkout/Phone.java | 72 +- .../com/adyen/model/checkout/PixDetails.java | 114 ++- .../adyen/model/checkout/PixRecurring.java | 153 +++- .../checkout/PlatformChargebackLogic.java | 87 +- .../com/adyen/model/checkout/PseDetails.java | 129 ++- .../model/checkout/RakutenPayDetails.java | 109 ++- .../adyen/model/checkout/RatepayDetails.java | 135 ++- .../com/adyen/model/checkout/Recurring.java | 107 ++- .../ResponseAdditionalData3DSecure.java | 113 ++- .../ResponseAdditionalDataBillingAddress.java | 131 ++- .../checkout/ResponseAdditionalDataCard.java | 147 ++- .../ResponseAdditionalDataCommon.java | 795 ++++++++++++++++- .../ResponseAdditionalDataDomesticError.java | 79 +- .../ResponseAdditionalDataInstallments.java | 237 ++++- .../ResponseAdditionalDataNetworkTokens.java | 91 +- .../checkout/ResponseAdditionalDataOpi.java | 62 +- .../checkout/ResponseAdditionalDataSepa.java | 108 ++- .../checkout/ResponseAdditionalDataSwish.java | 63 +- .../model/checkout/ResponsePaymentMethod.java | 71 +- .../com/adyen/model/checkout/RiskData.java | 97 +- .../adyen/model/checkout/RivertyDetails.java | 165 +++- .../adyen/model/checkout/SDKEphemPubKey.java | 89 +- .../model/checkout/SamsungPayDetails.java | 129 ++- .../checkout/SepaDirectDebitDetails.java | 148 +++- .../adyen/model/checkout/ServiceError.java | 119 ++- .../model/checkout/SessionResultResponse.java | 108 ++- .../checkout/ShopperIdPaymentMethod.java | 62 +- .../checkout/ShopperInteractionDevice.java | 80 +- .../com/adyen/model/checkout/ShopperName.java | 71 +- .../java/com/adyen/model/checkout/Split.java | 341 ++++--- .../com/adyen/model/checkout/SplitAmount.java | 71 +- .../StandalonePaymentCancelRequest.java | 111 ++- .../StandalonePaymentCancelResponse.java | 110 ++- .../model/checkout/StoredPaymentMethod.java | 231 ++++- .../checkout/StoredPaymentMethodDetails.java | 111 ++- .../checkout/StoredPaymentMethodRequest.java | 117 ++- .../checkout/StoredPaymentMethodResource.java | 243 ++++- .../adyen/model/checkout/SubInputDetail.java | 119 ++- .../com/adyen/model/checkout/SubMerchant.java | 99 ++- .../adyen/model/checkout/SubMerchantInfo.java | 162 +++- .../com/adyen/model/checkout/Surcharge.java | 62 +- .../com/adyen/model/checkout/TaxTotal.java | 62 +- .../model/checkout/ThreeDS2RequestData.java | 469 +++++++++- .../model/checkout/ThreeDS2RequestFields.java | 446 +++++++++- .../model/checkout/ThreeDS2ResponseData.java | 249 +++++- .../adyen/model/checkout/ThreeDS2Result.java | 198 ++++- .../model/checkout/ThreeDSRequestData.java | 98 +- .../ThreeDSRequestorAuthenticationInfo.java | 92 +- ...reeDSRequestorPriorAuthenticationInfo.java | 105 ++- .../model/checkout/ThreeDSecureData.java | 179 +++- .../java/com/adyen/model/checkout/Ticket.java | 81 +- .../adyen/model/checkout/TokenMandate.java | 213 ++++- .../adyen/model/checkout/TravelAgency.java | 71 +- .../adyen/model/checkout/TwintDetails.java | 119 ++- .../model/checkout/UPIPaymentMethod.java | 61 +- .../checkout/UpdatePaymentLinkRequest.java | 62 +- .../model/checkout/UpiCollectDetails.java | 140 ++- .../model/checkout/UpiIntentDetails.java | 139 ++- .../adyen/model/checkout/UpiQrDetails.java | 126 ++- .../adyen/model/checkout/UtilityRequest.java | 62 +- .../adyen/model/checkout/UtilityResponse.java | 62 +- .../checkout/ValidateShopperIdRequest.java | 109 ++- .../checkout/ValidateShopperIdResponse.java | 71 +- .../adyen/model/checkout/VippsDetails.java | 114 ++- .../model/checkout/VisaCheckoutDetails.java | 113 ++- .../model/checkout/WeChatPayDetails.java | 81 +- .../checkout/WeChatPayMiniProgramDetails.java | 127 ++- .../com/adyen/model/checkout/ZipDetails.java | 114 ++- .../adyen/service/checkout/RecurringApi.java | 33 + 241 files changed, 38216 insertions(+), 737 deletions(-) create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardResponseFromUrl.java create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutNetworkTokenOption.java create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutOutgoingForwardRequest.java create mode 100644 src/main/java/com/adyen/model/checkout/Destination.java create mode 100644 src/main/java/com/adyen/model/checkout/ExternalTokenDetails.java create mode 100644 src/main/java/com/adyen/model/checkout/ItemDetailLine.java create mode 100644 src/main/java/com/adyen/model/checkout/LevelTwoThree.java create mode 100644 src/main/java/com/adyen/model/checkout/PaymentValidationsNameRequest.java diff --git a/src/main/java/com/adyen/model/checkout/AccountInfo.java b/src/main/java/com/adyen/model/checkout/AccountInfo.java index 248c546f8..74765ace3 100644 --- a/src/main/java/com/adyen/model/checkout/AccountInfo.java +++ b/src/main/java/com/adyen/model/checkout/AccountInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -99,9 +101,15 @@ public static AccountAgeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_AGE_INDICATOR = "accountAgeIndicator"; private AccountAgeIndicatorEnum accountAgeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountAgeIndicator = false; + public static final String JSON_PROPERTY_ACCOUNT_CHANGE_DATE = "accountChangeDate"; private OffsetDateTime accountChangeDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountChangeDate = false; + /** * Indicator for the length of time since the shopper's account was last updated. Allowed * values: * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days @@ -153,9 +161,15 @@ public static AccountChangeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_CHANGE_INDICATOR = "accountChangeIndicator"; private AccountChangeIndicatorEnum accountChangeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountChangeIndicator = false; + public static final String JSON_PROPERTY_ACCOUNT_CREATION_DATE = "accountCreationDate"; private OffsetDateTime accountCreationDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountCreationDate = false; + /** * Indicates the type of account. For example, for a multi-account card product. Allowed values: * * notApplicable * credit * debit @@ -205,12 +219,21 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_ADD_CARD_ATTEMPTS_DAY = "addCardAttemptsDay"; private Integer addCardAttemptsDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddCardAttemptsDay = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS_USAGE_DATE = "deliveryAddressUsageDate"; private OffsetDateTime deliveryAddressUsageDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddressUsageDate = false; + /** * Indicator for the length of time since this delivery address was first used. Allowed values: * * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days @@ -264,19 +287,31 @@ public static DeliveryAddressUsageIndicatorEnum fromValue(String value) { "deliveryAddressUsageIndicator"; private DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddressUsageIndicator = false; + public static final String JSON_PROPERTY_HOME_PHONE = "homePhone"; @Deprecated // deprecated since Adyen Checkout API v68: Use `ThreeDS2RequestData.homePhone` // instead. private String homePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomePhone = false; + public static final String JSON_PROPERTY_MOBILE_PHONE = "mobilePhone"; @Deprecated // deprecated since Adyen Checkout API v68: Use `ThreeDS2RequestData.mobilePhone` // instead. private String mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + public static final String JSON_PROPERTY_PASSWORD_CHANGE_DATE = "passwordChangeDate"; private OffsetDateTime passwordChangeDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPasswordChangeDate = false; + /** * Indicator when the shopper has changed their password. Allowed values: * notApplicable * * thisTransaction * lessThan30Days * from30To60Days * moreThan60Days @@ -330,15 +365,27 @@ public static PasswordChangeIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_PASSWORD_CHANGE_INDICATOR = "passwordChangeIndicator"; private PasswordChangeIndicatorEnum passwordChangeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPasswordChangeIndicator = false; + public static final String JSON_PROPERTY_PAST_TRANSACTIONS_DAY = "pastTransactionsDay"; private Integer pastTransactionsDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPastTransactionsDay = false; + public static final String JSON_PROPERTY_PAST_TRANSACTIONS_YEAR = "pastTransactionsYear"; private Integer pastTransactionsYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPastTransactionsYear = false; + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_AGE = "paymentAccountAge"; private OffsetDateTime paymentAccountAge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountAge = false; + /** * Indicator for the length of time since this payment method was added to this shopper's * account. Allowed values: * notApplicable * thisTransaction * lessThan30Days * from30To60Days * @@ -393,17 +440,35 @@ public static PaymentAccountIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_INDICATOR = "paymentAccountIndicator"; private PaymentAccountIndicatorEnum paymentAccountIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountIndicator = false; + public static final String JSON_PROPERTY_PURCHASES_LAST6_MONTHS = "purchasesLast6Months"; private Integer purchasesLast6Months; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchasesLast6Months = false; + public static final String JSON_PROPERTY_SUSPICIOUS_ACTIVITY = "suspiciousActivity"; private Boolean suspiciousActivity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuspiciousActivity = false; + public static final String JSON_PROPERTY_WORK_PHONE = "workPhone"; @Deprecated // deprecated since Adyen Checkout API v68: Use `ThreeDS2RequestData.workPhone` // instead. private String workPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWorkPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AccountInfo() {} /** @@ -418,6 +483,7 @@ public AccountInfo() {} */ public AccountInfo accountAgeIndicator(AccountAgeIndicatorEnum accountAgeIndicator) { this.accountAgeIndicator = accountAgeIndicator; + isSetAccountAgeIndicator = true; // mark as set return this; } @@ -449,6 +515,7 @@ public AccountAgeIndicatorEnum getAccountAgeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountAgeIndicator(AccountAgeIndicatorEnum accountAgeIndicator) { this.accountAgeIndicator = accountAgeIndicator; + isSetAccountAgeIndicator = true; // mark as set } /** @@ -459,6 +526,7 @@ public void setAccountAgeIndicator(AccountAgeIndicatorEnum accountAgeIndicator) */ public AccountInfo accountChangeDate(OffsetDateTime accountChangeDate) { this.accountChangeDate = accountChangeDate; + isSetAccountChangeDate = true; // mark as set return this; } @@ -482,6 +550,7 @@ public OffsetDateTime getAccountChangeDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountChangeDate(OffsetDateTime accountChangeDate) { this.accountChangeDate = accountChangeDate; + isSetAccountChangeDate = true; // mark as set } /** @@ -495,6 +564,7 @@ public void setAccountChangeDate(OffsetDateTime accountChangeDate) { */ public AccountInfo accountChangeIndicator(AccountChangeIndicatorEnum accountChangeIndicator) { this.accountChangeIndicator = accountChangeIndicator; + isSetAccountChangeIndicator = true; // mark as set return this; } @@ -524,6 +594,7 @@ public AccountChangeIndicatorEnum getAccountChangeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountChangeIndicator(AccountChangeIndicatorEnum accountChangeIndicator) { this.accountChangeIndicator = accountChangeIndicator; + isSetAccountChangeIndicator = true; // mark as set } /** @@ -534,6 +605,7 @@ public void setAccountChangeIndicator(AccountChangeIndicatorEnum accountChangeIn */ public AccountInfo accountCreationDate(OffsetDateTime accountCreationDate) { this.accountCreationDate = accountCreationDate; + isSetAccountCreationDate = true; // mark as set return this; } @@ -557,6 +629,7 @@ public OffsetDateTime getAccountCreationDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountCreationDate(OffsetDateTime accountCreationDate) { this.accountCreationDate = accountCreationDate; + isSetAccountCreationDate = true; // mark as set } /** @@ -569,6 +642,7 @@ public void setAccountCreationDate(OffsetDateTime accountCreationDate) { */ public AccountInfo accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -596,6 +670,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -607,6 +682,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public AccountInfo addCardAttemptsDay(Integer addCardAttemptsDay) { this.addCardAttemptsDay = addCardAttemptsDay; + isSetAddCardAttemptsDay = true; // mark as set return this; } @@ -632,6 +708,7 @@ public Integer getAddCardAttemptsDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddCardAttemptsDay(Integer addCardAttemptsDay) { this.addCardAttemptsDay = addCardAttemptsDay; + isSetAddCardAttemptsDay = true; // mark as set } /** @@ -642,6 +719,7 @@ public void setAddCardAttemptsDay(Integer addCardAttemptsDay) { */ public AccountInfo deliveryAddressUsageDate(OffsetDateTime deliveryAddressUsageDate) { this.deliveryAddressUsageDate = deliveryAddressUsageDate; + isSetDeliveryAddressUsageDate = true; // mark as set return this; } @@ -665,6 +743,7 @@ public OffsetDateTime getDeliveryAddressUsageDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddressUsageDate(OffsetDateTime deliveryAddressUsageDate) { this.deliveryAddressUsageDate = deliveryAddressUsageDate; + isSetDeliveryAddressUsageDate = true; // mark as set } /** @@ -679,6 +758,7 @@ public void setDeliveryAddressUsageDate(OffsetDateTime deliveryAddressUsageDate) public AccountInfo deliveryAddressUsageIndicator( DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator) { this.deliveryAddressUsageIndicator = deliveryAddressUsageIndicator; + isSetDeliveryAddressUsageIndicator = true; // mark as set return this; } @@ -709,6 +789,7 @@ public DeliveryAddressUsageIndicatorEnum getDeliveryAddressUsageIndicator() { public void setDeliveryAddressUsageIndicator( DeliveryAddressUsageIndicatorEnum deliveryAddressUsageIndicator) { this.deliveryAddressUsageIndicator = deliveryAddressUsageIndicator; + isSetDeliveryAddressUsageIndicator = true; // mark as set } /** @@ -722,6 +803,7 @@ public void setDeliveryAddressUsageIndicator( // instead. public AccountInfo homePhone(String homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -752,6 +834,7 @@ public String getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(String homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -766,6 +849,7 @@ public void setHomePhone(String homePhone) { // instead. public AccountInfo mobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -797,6 +881,7 @@ public String getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(String mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -807,6 +892,7 @@ public void setMobilePhone(String mobilePhone) { */ public AccountInfo passwordChangeDate(OffsetDateTime passwordChangeDate) { this.passwordChangeDate = passwordChangeDate; + isSetPasswordChangeDate = true; // mark as set return this; } @@ -830,6 +916,7 @@ public OffsetDateTime getPasswordChangeDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPasswordChangeDate(OffsetDateTime passwordChangeDate) { this.passwordChangeDate = passwordChangeDate; + isSetPasswordChangeDate = true; // mark as set } /** @@ -843,6 +930,7 @@ public void setPasswordChangeDate(OffsetDateTime passwordChangeDate) { */ public AccountInfo passwordChangeIndicator(PasswordChangeIndicatorEnum passwordChangeIndicator) { this.passwordChangeIndicator = passwordChangeIndicator; + isSetPasswordChangeIndicator = true; // mark as set return this; } @@ -872,6 +960,7 @@ public PasswordChangeIndicatorEnum getPasswordChangeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPasswordChangeIndicator(PasswordChangeIndicatorEnum passwordChangeIndicator) { this.passwordChangeIndicator = passwordChangeIndicator; + isSetPasswordChangeIndicator = true; // mark as set } /** @@ -883,6 +972,7 @@ public void setPasswordChangeIndicator(PasswordChangeIndicatorEnum passwordChang */ public AccountInfo pastTransactionsDay(Integer pastTransactionsDay) { this.pastTransactionsDay = pastTransactionsDay; + isSetPastTransactionsDay = true; // mark as set return this; } @@ -908,6 +998,7 @@ public Integer getPastTransactionsDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPastTransactionsDay(Integer pastTransactionsDay) { this.pastTransactionsDay = pastTransactionsDay; + isSetPastTransactionsDay = true; // mark as set } /** @@ -919,6 +1010,7 @@ public void setPastTransactionsDay(Integer pastTransactionsDay) { */ public AccountInfo pastTransactionsYear(Integer pastTransactionsYear) { this.pastTransactionsYear = pastTransactionsYear; + isSetPastTransactionsYear = true; // mark as set return this; } @@ -944,6 +1036,7 @@ public Integer getPastTransactionsYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPastTransactionsYear(Integer pastTransactionsYear) { this.pastTransactionsYear = pastTransactionsYear; + isSetPastTransactionsYear = true; // mark as set } /** @@ -954,6 +1047,7 @@ public void setPastTransactionsYear(Integer pastTransactionsYear) { */ public AccountInfo paymentAccountAge(OffsetDateTime paymentAccountAge) { this.paymentAccountAge = paymentAccountAge; + isSetPaymentAccountAge = true; // mark as set return this; } @@ -977,6 +1071,7 @@ public OffsetDateTime getPaymentAccountAge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccountAge(OffsetDateTime paymentAccountAge) { this.paymentAccountAge = paymentAccountAge; + isSetPaymentAccountAge = true; // mark as set } /** @@ -991,6 +1086,7 @@ public void setPaymentAccountAge(OffsetDateTime paymentAccountAge) { */ public AccountInfo paymentAccountIndicator(PaymentAccountIndicatorEnum paymentAccountIndicator) { this.paymentAccountIndicator = paymentAccountIndicator; + isSetPaymentAccountIndicator = true; // mark as set return this; } @@ -1022,6 +1118,7 @@ public PaymentAccountIndicatorEnum getPaymentAccountIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccountIndicator(PaymentAccountIndicatorEnum paymentAccountIndicator) { this.paymentAccountIndicator = paymentAccountIndicator; + isSetPaymentAccountIndicator = true; // mark as set } /** @@ -1032,6 +1129,7 @@ public void setPaymentAccountIndicator(PaymentAccountIndicatorEnum paymentAccoun */ public AccountInfo purchasesLast6Months(Integer purchasesLast6Months) { this.purchasesLast6Months = purchasesLast6Months; + isSetPurchasesLast6Months = true; // mark as set return this; } @@ -1055,6 +1153,7 @@ public Integer getPurchasesLast6Months() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchasesLast6Months(Integer purchasesLast6Months) { this.purchasesLast6Months = purchasesLast6Months; + isSetPurchasesLast6Months = true; // mark as set } /** @@ -1065,6 +1164,7 @@ public void setPurchasesLast6Months(Integer purchasesLast6Months) { */ public AccountInfo suspiciousActivity(Boolean suspiciousActivity) { this.suspiciousActivity = suspiciousActivity; + isSetSuspiciousActivity = true; // mark as set return this; } @@ -1088,6 +1188,7 @@ public Boolean getSuspiciousActivity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspiciousActivity(Boolean suspiciousActivity) { this.suspiciousActivity = suspiciousActivity; + isSetSuspiciousActivity = true; // mark as set } /** @@ -1101,6 +1202,7 @@ public void setSuspiciousActivity(Boolean suspiciousActivity) { // instead. public AccountInfo workPhone(String workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -1131,6 +1233,27 @@ public String getWorkPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWorkPhone(String workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AccountInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AccountInfo object is equal to o. */ @@ -1144,49 +1267,91 @@ public boolean equals(Object o) { } AccountInfo accountInfo = (AccountInfo) o; return Objects.equals(this.accountAgeIndicator, accountInfo.accountAgeIndicator) + && Objects.equals(this.isSetAccountAgeIndicator, accountInfo.isSetAccountAgeIndicator) && Objects.equals(this.accountChangeDate, accountInfo.accountChangeDate) + && Objects.equals(this.isSetAccountChangeDate, accountInfo.isSetAccountChangeDate) && Objects.equals(this.accountChangeIndicator, accountInfo.accountChangeIndicator) + && Objects.equals(this.isSetAccountChangeIndicator, accountInfo.isSetAccountChangeIndicator) && Objects.equals(this.accountCreationDate, accountInfo.accountCreationDate) + && Objects.equals(this.isSetAccountCreationDate, accountInfo.isSetAccountCreationDate) && Objects.equals(this.accountType, accountInfo.accountType) + && Objects.equals(this.isSetAccountType, accountInfo.isSetAccountType) && Objects.equals(this.addCardAttemptsDay, accountInfo.addCardAttemptsDay) + && Objects.equals(this.isSetAddCardAttemptsDay, accountInfo.isSetAddCardAttemptsDay) && Objects.equals(this.deliveryAddressUsageDate, accountInfo.deliveryAddressUsageDate) + && Objects.equals( + this.isSetDeliveryAddressUsageDate, accountInfo.isSetDeliveryAddressUsageDate) && Objects.equals( this.deliveryAddressUsageIndicator, accountInfo.deliveryAddressUsageIndicator) + && Objects.equals( + this.isSetDeliveryAddressUsageIndicator, accountInfo.isSetDeliveryAddressUsageIndicator) && Objects.equals(this.homePhone, accountInfo.homePhone) + && Objects.equals(this.isSetHomePhone, accountInfo.isSetHomePhone) && Objects.equals(this.mobilePhone, accountInfo.mobilePhone) + && Objects.equals(this.isSetMobilePhone, accountInfo.isSetMobilePhone) && Objects.equals(this.passwordChangeDate, accountInfo.passwordChangeDate) + && Objects.equals(this.isSetPasswordChangeDate, accountInfo.isSetPasswordChangeDate) && Objects.equals(this.passwordChangeIndicator, accountInfo.passwordChangeIndicator) + && Objects.equals( + this.isSetPasswordChangeIndicator, accountInfo.isSetPasswordChangeIndicator) && Objects.equals(this.pastTransactionsDay, accountInfo.pastTransactionsDay) + && Objects.equals(this.isSetPastTransactionsDay, accountInfo.isSetPastTransactionsDay) && Objects.equals(this.pastTransactionsYear, accountInfo.pastTransactionsYear) + && Objects.equals(this.isSetPastTransactionsYear, accountInfo.isSetPastTransactionsYear) && Objects.equals(this.paymentAccountAge, accountInfo.paymentAccountAge) + && Objects.equals(this.isSetPaymentAccountAge, accountInfo.isSetPaymentAccountAge) && Objects.equals(this.paymentAccountIndicator, accountInfo.paymentAccountIndicator) + && Objects.equals( + this.isSetPaymentAccountIndicator, accountInfo.isSetPaymentAccountIndicator) && Objects.equals(this.purchasesLast6Months, accountInfo.purchasesLast6Months) + && Objects.equals(this.isSetPurchasesLast6Months, accountInfo.isSetPurchasesLast6Months) && Objects.equals(this.suspiciousActivity, accountInfo.suspiciousActivity) - && Objects.equals(this.workPhone, accountInfo.workPhone); + && Objects.equals(this.isSetSuspiciousActivity, accountInfo.isSetSuspiciousActivity) + && Objects.equals(this.workPhone, accountInfo.workPhone) + && Objects.equals(this.isSetWorkPhone, accountInfo.isSetWorkPhone); } @Override public int hashCode() { return Objects.hash( accountAgeIndicator, + isSetAccountAgeIndicator, accountChangeDate, + isSetAccountChangeDate, accountChangeIndicator, + isSetAccountChangeIndicator, accountCreationDate, + isSetAccountCreationDate, accountType, + isSetAccountType, addCardAttemptsDay, + isSetAddCardAttemptsDay, deliveryAddressUsageDate, + isSetDeliveryAddressUsageDate, deliveryAddressUsageIndicator, + isSetDeliveryAddressUsageIndicator, homePhone, + isSetHomePhone, mobilePhone, + isSetMobilePhone, passwordChangeDate, + isSetPasswordChangeDate, passwordChangeIndicator, + isSetPasswordChangeIndicator, pastTransactionsDay, + isSetPastTransactionsDay, pastTransactionsYear, + isSetPastTransactionsYear, paymentAccountAge, + isSetPaymentAccountAge, paymentAccountIndicator, + isSetPaymentAccountIndicator, purchasesLast6Months, + isSetPurchasesLast6Months, suspiciousActivity, - workPhone); + isSetSuspiciousActivity, + workPhone, + isSetWorkPhone); } @Override @@ -1246,6 +1411,87 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountAgeIndicator) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_AGE_INDICATOR, this.accountAgeIndicator); + } + if (isSetAccountChangeDate) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_CHANGE_DATE, this.accountChangeDate); + } + if (isSetAccountChangeIndicator) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_CHANGE_INDICATOR, this.accountChangeIndicator); + } + if (isSetAccountCreationDate) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_CREATION_DATE, this.accountCreationDate); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetAddCardAttemptsDay) { + addIfNull(nulls, JSON_PROPERTY_ADD_CARD_ATTEMPTS_DAY, this.addCardAttemptsDay); + } + if (isSetDeliveryAddressUsageDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS_USAGE_DATE, this.deliveryAddressUsageDate); + } + if (isSetDeliveryAddressUsageIndicator) { + addIfNull( + nulls, + JSON_PROPERTY_DELIVERY_ADDRESS_USAGE_INDICATOR, + this.deliveryAddressUsageIndicator); + } + if (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetPasswordChangeDate) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD_CHANGE_DATE, this.passwordChangeDate); + } + if (isSetPasswordChangeIndicator) { + addIfNull(nulls, JSON_PROPERTY_PASSWORD_CHANGE_INDICATOR, this.passwordChangeIndicator); + } + if (isSetPastTransactionsDay) { + addIfNull(nulls, JSON_PROPERTY_PAST_TRANSACTIONS_DAY, this.pastTransactionsDay); + } + if (isSetPastTransactionsYear) { + addIfNull(nulls, JSON_PROPERTY_PAST_TRANSACTIONS_YEAR, this.pastTransactionsYear); + } + if (isSetPaymentAccountAge) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_AGE, this.paymentAccountAge); + } + if (isSetPaymentAccountIndicator) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_INDICATOR, this.paymentAccountIndicator); + } + if (isSetPurchasesLast6Months) { + addIfNull(nulls, JSON_PROPERTY_PURCHASES_LAST6_MONTHS, this.purchasesLast6Months); + } + if (isSetSuspiciousActivity) { + addIfNull(nulls, JSON_PROPERTY_SUSPICIOUS_ACTIVITY, this.suspiciousActivity); + } + if (isSetWorkPhone) { + addIfNull(nulls, JSON_PROPERTY_WORK_PHONE, this.workPhone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AccountInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AcctInfo.java b/src/main/java/com/adyen/model/checkout/AcctInfo.java index 89c0eda53..6d6c15ed3 100644 --- a/src/main/java/com/adyen/model/checkout/AcctInfo.java +++ b/src/main/java/com/adyen/model/checkout/AcctInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -95,9 +97,15 @@ public static ChAccAgeIndEnum fromValue(String value) { public static final String JSON_PROPERTY_CH_ACC_AGE_IND = "chAccAgeInd"; private ChAccAgeIndEnum chAccAgeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccAgeInd = false; + public static final String JSON_PROPERTY_CH_ACC_CHANGE = "chAccChange"; private String chAccChange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccChange = false; + /** * Length of time since the cardholder’s account information with the 3DS Requestor was last * changed, including Billing or Shipping address, new payment account, or new user(s) added. @@ -151,9 +159,15 @@ public static ChAccChangeIndEnum fromValue(String value) { public static final String JSON_PROPERTY_CH_ACC_CHANGE_IND = "chAccChangeInd"; private ChAccChangeIndEnum chAccChangeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccChangeInd = false; + public static final String JSON_PROPERTY_CH_ACC_PW_CHANGE = "chAccPwChange"; private String chAccPwChange; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccPwChange = false; + /** * Indicates the length of time since the cardholder’s account with the 3DS Requestor had a * password change or account reset. Allowed values: * **01** — No change * **02** — Changed @@ -209,15 +223,27 @@ public static ChAccPwChangeIndEnum fromValue(String value) { public static final String JSON_PROPERTY_CH_ACC_PW_CHANGE_IND = "chAccPwChangeInd"; private ChAccPwChangeIndEnum chAccPwChangeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccPwChangeInd = false; + public static final String JSON_PROPERTY_CH_ACC_STRING = "chAccString"; private String chAccString; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChAccString = false; + public static final String JSON_PROPERTY_NB_PURCHASE_ACCOUNT = "nbPurchaseAccount"; private String nbPurchaseAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNbPurchaseAccount = false; + public static final String JSON_PROPERTY_PAYMENT_ACC_AGE = "paymentAccAge"; private String paymentAccAge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccAge = false; + /** * Indicates the length of time that the payment account was enrolled in the cardholder’s account * with the 3DS Requestor. Allowed values: * **01** — No account (guest checkout) * **02** — @@ -273,12 +299,21 @@ public static PaymentAccIndEnum fromValue(String value) { public static final String JSON_PROPERTY_PAYMENT_ACC_IND = "paymentAccInd"; private PaymentAccIndEnum paymentAccInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccInd = false; + public static final String JSON_PROPERTY_PROVISION_ATTEMPTS_DAY = "provisionAttemptsDay"; private String provisionAttemptsDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProvisionAttemptsDay = false; + public static final String JSON_PROPERTY_SHIP_ADDRESS_USAGE = "shipAddressUsage"; private String shipAddressUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipAddressUsage = false; + /** * Indicates when the shipping address used for this transaction was first used with the 3DS * Requestor. Allowed values: * **01** — This transaction * **02** — Less than 30 days * **03** — @@ -331,6 +366,9 @@ public static ShipAddressUsageIndEnum fromValue(String value) { public static final String JSON_PROPERTY_SHIP_ADDRESS_USAGE_IND = "shipAddressUsageInd"; private ShipAddressUsageIndEnum shipAddressUsageInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipAddressUsageInd = false; + /** * Indicates if the Cardholder Name on the account is identical to the shipping Name used for this * transaction. Allowed values: * **01** — Account Name identical to shipping Name * **02** — @@ -379,6 +417,9 @@ public static ShipNameIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_SHIP_NAME_INDICATOR = "shipNameIndicator"; private ShipNameIndicatorEnum shipNameIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipNameIndicator = false; + /** * Indicates whether the 3DS Requestor has experienced suspicious activity (including previous * fraud) on the cardholder account. Allowed values: * **01** — No suspicious activity has been @@ -427,12 +468,27 @@ public static SuspiciousAccActivityEnum fromValue(String value) { public static final String JSON_PROPERTY_SUSPICIOUS_ACC_ACTIVITY = "suspiciousAccActivity"; private SuspiciousAccActivityEnum suspiciousAccActivity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSuspiciousAccActivity = false; + public static final String JSON_PROPERTY_TXN_ACTIVITY_DAY = "txnActivityDay"; private String txnActivityDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxnActivityDay = false; + public static final String JSON_PROPERTY_TXN_ACTIVITY_YEAR = "txnActivityYear"; private String txnActivityYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxnActivityYear = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AcctInfo() {} /** @@ -447,6 +503,7 @@ public AcctInfo() {} */ public AcctInfo chAccAgeInd(ChAccAgeIndEnum chAccAgeInd) { this.chAccAgeInd = chAccAgeInd; + isSetChAccAgeInd = true; // mark as set return this; } @@ -478,6 +535,7 @@ public ChAccAgeIndEnum getChAccAgeInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccAgeInd(ChAccAgeIndEnum chAccAgeInd) { this.chAccAgeInd = chAccAgeInd; + isSetChAccAgeInd = true; // mark as set } /** @@ -491,6 +549,7 @@ public void setChAccAgeInd(ChAccAgeIndEnum chAccAgeInd) { */ public AcctInfo chAccChange(String chAccChange) { this.chAccChange = chAccChange; + isSetChAccChange = true; // mark as set return this; } @@ -520,6 +579,7 @@ public String getChAccChange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccChange(String chAccChange) { this.chAccChange = chAccChange; + isSetChAccChange = true; // mark as set } /** @@ -536,6 +596,7 @@ public void setChAccChange(String chAccChange) { */ public AcctInfo chAccChangeInd(ChAccChangeIndEnum chAccChangeInd) { this.chAccChangeInd = chAccChangeInd; + isSetChAccChangeInd = true; // mark as set return this; } @@ -571,6 +632,7 @@ public ChAccChangeIndEnum getChAccChangeInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccChangeInd(ChAccChangeIndEnum chAccChangeInd) { this.chAccChangeInd = chAccChangeInd; + isSetChAccChangeInd = true; // mark as set } /** @@ -583,6 +645,7 @@ public void setChAccChangeInd(ChAccChangeIndEnum chAccChangeInd) { */ public AcctInfo chAccPwChange(String chAccPwChange) { this.chAccPwChange = chAccPwChange; + isSetChAccPwChange = true; // mark as set return this; } @@ -610,6 +673,7 @@ public String getChAccPwChange() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccPwChange(String chAccPwChange) { this.chAccPwChange = chAccPwChange; + isSetChAccPwChange = true; // mark as set } /** @@ -626,6 +690,7 @@ public void setChAccPwChange(String chAccPwChange) { */ public AcctInfo chAccPwChangeInd(ChAccPwChangeIndEnum chAccPwChangeInd) { this.chAccPwChangeInd = chAccPwChangeInd; + isSetChAccPwChangeInd = true; // mark as set return this; } @@ -661,6 +726,7 @@ public ChAccPwChangeIndEnum getChAccPwChangeInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccPwChangeInd(ChAccPwChangeIndEnum chAccPwChangeInd) { this.chAccPwChangeInd = chAccPwChangeInd; + isSetChAccPwChangeInd = true; // mark as set } /** @@ -672,6 +738,7 @@ public void setChAccPwChangeInd(ChAccPwChangeIndEnum chAccPwChangeInd) { */ public AcctInfo chAccString(String chAccString) { this.chAccString = chAccString; + isSetChAccString = true; // mark as set return this; } @@ -697,6 +764,7 @@ public String getChAccString() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChAccString(String chAccString) { this.chAccString = chAccString; + isSetChAccString = true; // mark as set } /** @@ -709,6 +777,7 @@ public void setChAccString(String chAccString) { */ public AcctInfo nbPurchaseAccount(String nbPurchaseAccount) { this.nbPurchaseAccount = nbPurchaseAccount; + isSetNbPurchaseAccount = true; // mark as set return this; } @@ -736,6 +805,7 @@ public String getNbPurchaseAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNbPurchaseAccount(String nbPurchaseAccount) { this.nbPurchaseAccount = nbPurchaseAccount; + isSetNbPurchaseAccount = true; // mark as set } /** @@ -748,6 +818,7 @@ public void setNbPurchaseAccount(String nbPurchaseAccount) { */ public AcctInfo paymentAccAge(String paymentAccAge) { this.paymentAccAge = paymentAccAge; + isSetPaymentAccAge = true; // mark as set return this; } @@ -775,6 +846,7 @@ public String getPaymentAccAge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccAge(String paymentAccAge) { this.paymentAccAge = paymentAccAge; + isSetPaymentAccAge = true; // mark as set } /** @@ -791,6 +863,7 @@ public void setPaymentAccAge(String paymentAccAge) { */ public AcctInfo paymentAccInd(PaymentAccIndEnum paymentAccInd) { this.paymentAccInd = paymentAccInd; + isSetPaymentAccInd = true; // mark as set return this; } @@ -826,6 +899,7 @@ public PaymentAccIndEnum getPaymentAccInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccInd(PaymentAccIndEnum paymentAccInd) { this.paymentAccInd = paymentAccInd; + isSetPaymentAccInd = true; // mark as set } /** @@ -837,6 +911,7 @@ public void setPaymentAccInd(PaymentAccIndEnum paymentAccInd) { */ public AcctInfo provisionAttemptsDay(String provisionAttemptsDay) { this.provisionAttemptsDay = provisionAttemptsDay; + isSetProvisionAttemptsDay = true; // mark as set return this; } @@ -862,6 +937,7 @@ public String getProvisionAttemptsDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProvisionAttemptsDay(String provisionAttemptsDay) { this.provisionAttemptsDay = provisionAttemptsDay; + isSetProvisionAttemptsDay = true; // mark as set } /** @@ -874,6 +950,7 @@ public void setProvisionAttemptsDay(String provisionAttemptsDay) { */ public AcctInfo shipAddressUsage(String shipAddressUsage) { this.shipAddressUsage = shipAddressUsage; + isSetShipAddressUsage = true; // mark as set return this; } @@ -901,6 +978,7 @@ public String getShipAddressUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipAddressUsage(String shipAddressUsage) { this.shipAddressUsage = shipAddressUsage; + isSetShipAddressUsage = true; // mark as set } /** @@ -915,6 +993,7 @@ public void setShipAddressUsage(String shipAddressUsage) { */ public AcctInfo shipAddressUsageInd(ShipAddressUsageIndEnum shipAddressUsageInd) { this.shipAddressUsageInd = shipAddressUsageInd; + isSetShipAddressUsageInd = true; // mark as set return this; } @@ -946,6 +1025,7 @@ public ShipAddressUsageIndEnum getShipAddressUsageInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipAddressUsageInd(ShipAddressUsageIndEnum shipAddressUsageInd) { this.shipAddressUsageInd = shipAddressUsageInd; + isSetShipAddressUsageInd = true; // mark as set } /** @@ -960,6 +1040,7 @@ public void setShipAddressUsageInd(ShipAddressUsageIndEnum shipAddressUsageInd) */ public AcctInfo shipNameIndicator(ShipNameIndicatorEnum shipNameIndicator) { this.shipNameIndicator = shipNameIndicator; + isSetShipNameIndicator = true; // mark as set return this; } @@ -991,6 +1072,7 @@ public ShipNameIndicatorEnum getShipNameIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipNameIndicator(ShipNameIndicatorEnum shipNameIndicator) { this.shipNameIndicator = shipNameIndicator; + isSetShipNameIndicator = true; // mark as set } /** @@ -1005,6 +1087,7 @@ public void setShipNameIndicator(ShipNameIndicatorEnum shipNameIndicator) { */ public AcctInfo suspiciousAccActivity(SuspiciousAccActivityEnum suspiciousAccActivity) { this.suspiciousAccActivity = suspiciousAccActivity; + isSetSuspiciousAccActivity = true; // mark as set return this; } @@ -1036,6 +1119,7 @@ public SuspiciousAccActivityEnum getSuspiciousAccActivity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspiciousAccActivity(SuspiciousAccActivityEnum suspiciousAccActivity) { this.suspiciousAccActivity = suspiciousAccActivity; + isSetSuspiciousAccActivity = true; // mark as set } /** @@ -1049,6 +1133,7 @@ public void setSuspiciousAccActivity(SuspiciousAccActivityEnum suspiciousAccActi */ public AcctInfo txnActivityDay(String txnActivityDay) { this.txnActivityDay = txnActivityDay; + isSetTxnActivityDay = true; // mark as set return this; } @@ -1078,6 +1163,7 @@ public String getTxnActivityDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxnActivityDay(String txnActivityDay) { this.txnActivityDay = txnActivityDay; + isSetTxnActivityDay = true; // mark as set } /** @@ -1091,6 +1177,7 @@ public void setTxnActivityDay(String txnActivityDay) { */ public AcctInfo txnActivityYear(String txnActivityYear) { this.txnActivityYear = txnActivityYear; + isSetTxnActivityYear = true; // mark as set return this; } @@ -1120,6 +1207,27 @@ public String getTxnActivityYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxnActivityYear(String txnActivityYear) { this.txnActivityYear = txnActivityYear; + isSetTxnActivityYear = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AcctInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AcctInfo object is equal to o. */ @@ -1133,42 +1241,74 @@ public boolean equals(Object o) { } AcctInfo acctInfo = (AcctInfo) o; return Objects.equals(this.chAccAgeInd, acctInfo.chAccAgeInd) + && Objects.equals(this.isSetChAccAgeInd, acctInfo.isSetChAccAgeInd) && Objects.equals(this.chAccChange, acctInfo.chAccChange) + && Objects.equals(this.isSetChAccChange, acctInfo.isSetChAccChange) && Objects.equals(this.chAccChangeInd, acctInfo.chAccChangeInd) + && Objects.equals(this.isSetChAccChangeInd, acctInfo.isSetChAccChangeInd) && Objects.equals(this.chAccPwChange, acctInfo.chAccPwChange) + && Objects.equals(this.isSetChAccPwChange, acctInfo.isSetChAccPwChange) && Objects.equals(this.chAccPwChangeInd, acctInfo.chAccPwChangeInd) + && Objects.equals(this.isSetChAccPwChangeInd, acctInfo.isSetChAccPwChangeInd) && Objects.equals(this.chAccString, acctInfo.chAccString) + && Objects.equals(this.isSetChAccString, acctInfo.isSetChAccString) && Objects.equals(this.nbPurchaseAccount, acctInfo.nbPurchaseAccount) + && Objects.equals(this.isSetNbPurchaseAccount, acctInfo.isSetNbPurchaseAccount) && Objects.equals(this.paymentAccAge, acctInfo.paymentAccAge) + && Objects.equals(this.isSetPaymentAccAge, acctInfo.isSetPaymentAccAge) && Objects.equals(this.paymentAccInd, acctInfo.paymentAccInd) + && Objects.equals(this.isSetPaymentAccInd, acctInfo.isSetPaymentAccInd) && Objects.equals(this.provisionAttemptsDay, acctInfo.provisionAttemptsDay) + && Objects.equals(this.isSetProvisionAttemptsDay, acctInfo.isSetProvisionAttemptsDay) && Objects.equals(this.shipAddressUsage, acctInfo.shipAddressUsage) + && Objects.equals(this.isSetShipAddressUsage, acctInfo.isSetShipAddressUsage) && Objects.equals(this.shipAddressUsageInd, acctInfo.shipAddressUsageInd) + && Objects.equals(this.isSetShipAddressUsageInd, acctInfo.isSetShipAddressUsageInd) && Objects.equals(this.shipNameIndicator, acctInfo.shipNameIndicator) + && Objects.equals(this.isSetShipNameIndicator, acctInfo.isSetShipNameIndicator) && Objects.equals(this.suspiciousAccActivity, acctInfo.suspiciousAccActivity) + && Objects.equals(this.isSetSuspiciousAccActivity, acctInfo.isSetSuspiciousAccActivity) && Objects.equals(this.txnActivityDay, acctInfo.txnActivityDay) - && Objects.equals(this.txnActivityYear, acctInfo.txnActivityYear); + && Objects.equals(this.isSetTxnActivityDay, acctInfo.isSetTxnActivityDay) + && Objects.equals(this.txnActivityYear, acctInfo.txnActivityYear) + && Objects.equals(this.isSetTxnActivityYear, acctInfo.isSetTxnActivityYear); } @Override public int hashCode() { return Objects.hash( chAccAgeInd, + isSetChAccAgeInd, chAccChange, + isSetChAccChange, chAccChangeInd, + isSetChAccChangeInd, chAccPwChange, + isSetChAccPwChange, chAccPwChangeInd, + isSetChAccPwChangeInd, chAccString, + isSetChAccString, nbPurchaseAccount, + isSetNbPurchaseAccount, paymentAccAge, + isSetPaymentAccAge, paymentAccInd, + isSetPaymentAccInd, provisionAttemptsDay, + isSetProvisionAttemptsDay, shipAddressUsage, + isSetShipAddressUsage, shipAddressUsageInd, + isSetShipAddressUsageInd, shipNameIndicator, + isSetShipNameIndicator, suspiciousAccActivity, + isSetSuspiciousAccActivity, txnActivityDay, - txnActivityYear); + isSetTxnActivityDay, + txnActivityYear, + isSetTxnActivityYear); } @Override @@ -1211,6 +1351,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetChAccAgeInd) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_AGE_IND, this.chAccAgeInd); + } + if (isSetChAccChange) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_CHANGE, this.chAccChange); + } + if (isSetChAccChangeInd) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_CHANGE_IND, this.chAccChangeInd); + } + if (isSetChAccPwChange) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_PW_CHANGE, this.chAccPwChange); + } + if (isSetChAccPwChangeInd) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_PW_CHANGE_IND, this.chAccPwChangeInd); + } + if (isSetChAccString) { + addIfNull(nulls, JSON_PROPERTY_CH_ACC_STRING, this.chAccString); + } + if (isSetNbPurchaseAccount) { + addIfNull(nulls, JSON_PROPERTY_NB_PURCHASE_ACCOUNT, this.nbPurchaseAccount); + } + if (isSetPaymentAccAge) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACC_AGE, this.paymentAccAge); + } + if (isSetPaymentAccInd) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACC_IND, this.paymentAccInd); + } + if (isSetProvisionAttemptsDay) { + addIfNull(nulls, JSON_PROPERTY_PROVISION_ATTEMPTS_DAY, this.provisionAttemptsDay); + } + if (isSetShipAddressUsage) { + addIfNull(nulls, JSON_PROPERTY_SHIP_ADDRESS_USAGE, this.shipAddressUsage); + } + if (isSetShipAddressUsageInd) { + addIfNull(nulls, JSON_PROPERTY_SHIP_ADDRESS_USAGE_IND, this.shipAddressUsageInd); + } + if (isSetShipNameIndicator) { + addIfNull(nulls, JSON_PROPERTY_SHIP_NAME_INDICATOR, this.shipNameIndicator); + } + if (isSetSuspiciousAccActivity) { + addIfNull(nulls, JSON_PROPERTY_SUSPICIOUS_ACC_ACTIVITY, this.suspiciousAccActivity); + } + if (isSetTxnActivityDay) { + addIfNull(nulls, JSON_PROPERTY_TXN_ACTIVITY_DAY, this.txnActivityDay); + } + if (isSetTxnActivityYear) { + addIfNull(nulls, JSON_PROPERTY_TXN_ACTIVITY_YEAR, this.txnActivityYear); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AcctInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AchDetails.java b/src/main/java/com/adyen/model/checkout/AchDetails.java index 887e5ce4b..62bbe17a1 100644 --- a/src/main/java/com/adyen/model/checkout/AchDetails.java +++ b/src/main/java/com/adyen/model/checkout/AchDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -82,9 +84,15 @@ public static AccountHolderTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_HOLDER_TYPE = "accountHolderType"; private AccountHolderTypeEnum accountHolderType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountHolderType = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT_NUMBER = "bankAccountNumber"; private String bankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountNumber = false; + /** The bank account type (checking, savings...). */ public enum BankAccountTypeEnum { BALANCE(String.valueOf("balance")), @@ -139,35 +147,65 @@ public static BankAccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_BANK_ACCOUNT_TYPE = "bankAccountType"; private BankAccountTypeEnum bankAccountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountType = false; + public static final String JSON_PROPERTY_BANK_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ENCRYPTED_BANK_ACCOUNT_NUMBER = "encryptedBankAccountNumber"; private String encryptedBankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedBankAccountNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_BANK_LOCATION_ID = "encryptedBankLocationId"; private String encryptedBankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedBankLocationId = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + /** **ach** */ public enum TypeEnum { ACH(String.valueOf("ach")), @@ -212,6 +250,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AchDetails() {} /** @@ -222,6 +269,7 @@ public AchDetails() {} */ public AchDetails accountHolderType(AccountHolderTypeEnum accountHolderType) { this.accountHolderType = accountHolderType; + isSetAccountHolderType = true; // mark as set return this; } @@ -245,6 +293,7 @@ public AccountHolderTypeEnum getAccountHolderType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountHolderType(AccountHolderTypeEnum accountHolderType) { this.accountHolderType = accountHolderType; + isSetAccountHolderType = true; // mark as set } /** @@ -255,6 +304,7 @@ public void setAccountHolderType(AccountHolderTypeEnum accountHolderType) { */ public AchDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -278,6 +328,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -288,6 +339,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public AchDetails bankAccountType(BankAccountTypeEnum bankAccountType) { this.bankAccountType = bankAccountType; + isSetBankAccountType = true; // mark as set return this; } @@ -311,6 +363,7 @@ public BankAccountTypeEnum getBankAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountType(BankAccountTypeEnum bankAccountType) { this.bankAccountType = bankAccountType; + isSetBankAccountType = true; // mark as set } /** @@ -322,6 +375,7 @@ public void setBankAccountType(BankAccountTypeEnum bankAccountType) { */ public AchDetails bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -347,6 +401,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -357,6 +412,7 @@ public void setBankLocationId(String bankLocationId) { */ public AchDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -380,6 +436,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -391,6 +448,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AchDetails encryptedBankAccountNumber(String encryptedBankAccountNumber) { this.encryptedBankAccountNumber = encryptedBankAccountNumber; + isSetEncryptedBankAccountNumber = true; // mark as set return this; } @@ -416,6 +474,7 @@ public String getEncryptedBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedBankAccountNumber(String encryptedBankAccountNumber) { this.encryptedBankAccountNumber = encryptedBankAccountNumber; + isSetEncryptedBankAccountNumber = true; // mark as set } /** @@ -428,6 +487,7 @@ public void setEncryptedBankAccountNumber(String encryptedBankAccountNumber) { */ public AchDetails encryptedBankLocationId(String encryptedBankLocationId) { this.encryptedBankLocationId = encryptedBankLocationId; + isSetEncryptedBankLocationId = true; // mark as set return this; } @@ -455,6 +515,7 @@ public String getEncryptedBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedBankLocationId(String encryptedBankLocationId) { this.encryptedBankLocationId = encryptedBankLocationId; + isSetEncryptedBankLocationId = true; // mark as set } /** @@ -481,6 +542,7 @@ public void setEncryptedBankLocationId(String encryptedBankLocationId) { */ public AchDetails ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -536,6 +598,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -550,6 +613,7 @@ public void setOwnerName(String ownerName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public AchDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -581,6 +645,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -591,6 +656,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public AchDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -615,6 +681,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -627,6 +694,7 @@ public void setSdkData(String sdkData) { */ public AchDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -654,6 +722,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -666,6 +735,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public AchDetails transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -693,6 +763,7 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set } /** @@ -703,6 +774,7 @@ public void setTransferInstrumentId(String transferInstrumentId) { */ public AchDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -726,6 +798,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AchDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AchDetails object is equal to o. */ @@ -739,36 +832,65 @@ public boolean equals(Object o) { } AchDetails achDetails = (AchDetails) o; return Objects.equals(this.accountHolderType, achDetails.accountHolderType) + && Objects.equals(this.isSetAccountHolderType, achDetails.isSetAccountHolderType) && Objects.equals(this.bankAccountNumber, achDetails.bankAccountNumber) + && Objects.equals(this.isSetBankAccountNumber, achDetails.isSetBankAccountNumber) && Objects.equals(this.bankAccountType, achDetails.bankAccountType) + && Objects.equals(this.isSetBankAccountType, achDetails.isSetBankAccountType) && Objects.equals(this.bankLocationId, achDetails.bankLocationId) + && Objects.equals(this.isSetBankLocationId, achDetails.isSetBankLocationId) && Objects.equals(this.checkoutAttemptId, achDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, achDetails.isSetCheckoutAttemptId) && Objects.equals(this.encryptedBankAccountNumber, achDetails.encryptedBankAccountNumber) + && Objects.equals( + this.isSetEncryptedBankAccountNumber, achDetails.isSetEncryptedBankAccountNumber) && Objects.equals(this.encryptedBankLocationId, achDetails.encryptedBankLocationId) + && Objects.equals( + this.isSetEncryptedBankLocationId, achDetails.isSetEncryptedBankLocationId) && Objects.equals(this.ownerName, achDetails.ownerName) + && Objects.equals(this.isSetOwnerName, achDetails.isSetOwnerName) && Objects.equals(this.recurringDetailReference, achDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, achDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, achDetails.sdkData) + && Objects.equals(this.isSetSdkData, achDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, achDetails.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, achDetails.isSetStoredPaymentMethodId) && Objects.equals(this.transferInstrumentId, achDetails.transferInstrumentId) - && Objects.equals(this.type, achDetails.type); + && Objects.equals(this.isSetTransferInstrumentId, achDetails.isSetTransferInstrumentId) + && Objects.equals(this.type, achDetails.type) + && Objects.equals(this.isSetType, achDetails.isSetType); } @Override public int hashCode() { return Objects.hash( accountHolderType, + isSetAccountHolderType, bankAccountNumber, + isSetBankAccountNumber, bankAccountType, + isSetBankAccountType, bankLocationId, + isSetBankLocationId, checkoutAttemptId, + isSetCheckoutAttemptId, encryptedBankAccountNumber, + isSetEncryptedBankAccountNumber, encryptedBankLocationId, + isSetEncryptedBankLocationId, ownerName, + isSetOwnerName, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, transferInstrumentId, - type); + isSetTransferInstrumentId, + type, + isSetType); } @Override @@ -812,6 +934,67 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountHolderType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_HOLDER_TYPE, this.accountHolderType); + } + if (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankAccountType) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_TYPE, this.bankAccountType); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetEncryptedBankAccountNumber) { + addIfNull( + nulls, JSON_PROPERTY_ENCRYPTED_BANK_ACCOUNT_NUMBER, this.encryptedBankAccountNumber); + } + if (isSetEncryptedBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_BANK_LOCATION_ID, this.encryptedBankLocationId); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AchDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java index f70e4ecfc..bc5b8a6e0 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalData3DSecure.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,6 +38,9 @@ public class AdditionalData3DSecure { // `authenticationData.threeDSRequestData.nativeThreeDS` instead. private String allow3DS2; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllow3DS2 = false; + /** * Dimensions of the 3DS2 challenge window to be displayed to the cardholder. Possible values: * * **01** - size of 250x400 * **02** - size of 390x400 * **03** - size of 500x600 * **04** - size @@ -90,20 +95,41 @@ public static ChallengeWindowSizeEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_WINDOW_SIZE = "challengeWindowSize"; private ChallengeWindowSizeEnum challengeWindowSize; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeWindowSize = false; + public static final String JSON_PROPERTY_EXECUTE_THREE_D = "executeThreeD"; @Deprecated // deprecated since Adyen Checkout API v69: Use // [`authenticationData.attemptAuthentication`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments?target=_blank#request-authenticationData-attemptAuthentication) instead private String executeThreeD; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExecuteThreeD = false; + public static final String JSON_PROPERTY_MPI_IMPLEMENTATION_TYPE = "mpiImplementationType"; private String mpiImplementationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiImplementationType = false; + public static final String JSON_PROPERTY_SCA_EXEMPTION = "scaExemption"; private String scaExemption; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaExemption = false; + public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private String threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalData3DSecure() {} /** @@ -140,6 +166,7 @@ public AdditionalData3DSecure() {} // `authenticationData.threeDSRequestData.nativeThreeDS` instead. public AdditionalData3DSecure allow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; + isSetAllow3DS2 = true; // mark as set return this; } @@ -215,6 +242,7 @@ public String getAllow3DS2() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllow3DS2(String allow3DS2) { this.allow3DS2 = allow3DS2; + isSetAllow3DS2 = true; // mark as set } /** @@ -229,6 +257,7 @@ public void setAllow3DS2(String allow3DS2) { */ public AdditionalData3DSecure challengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set return this; } @@ -260,6 +289,7 @@ public ChallengeWindowSizeEnum getChallengeWindowSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set } /** @@ -284,6 +314,7 @@ public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) // [`authenticationData.attemptAuthentication`](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments?target=_blank#request-authenticationData-attemptAuthentication) instead public AdditionalData3DSecure executeThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; + isSetExecuteThreeD = true; // mark as set return this; } @@ -335,6 +366,7 @@ public String getExecuteThreeD() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExecuteThreeD(String executeThreeD) { this.executeThreeD = executeThreeD; + isSetExecuteThreeD = true; // mark as set } /** @@ -345,6 +377,7 @@ public void setExecuteThreeD(String executeThreeD) { */ public AdditionalData3DSecure mpiImplementationType(String mpiImplementationType) { this.mpiImplementationType = mpiImplementationType; + isSetMpiImplementationType = true; // mark as set return this; } @@ -368,6 +401,7 @@ public String getMpiImplementationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiImplementationType(String mpiImplementationType) { this.mpiImplementationType = mpiImplementationType; + isSetMpiImplementationType = true; // mark as set } /** @@ -384,6 +418,7 @@ public void setMpiImplementationType(String mpiImplementationType) { */ public AdditionalData3DSecure scaExemption(String scaExemption) { this.scaExemption = scaExemption; + isSetScaExemption = true; // mark as set return this; } @@ -419,6 +454,7 @@ public String getScaExemption() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaExemption(String scaExemption) { this.scaExemption = scaExemption; + isSetScaExemption = true; // mark as set } /** @@ -443,6 +479,7 @@ public void setScaExemption(String scaExemption) { */ public AdditionalData3DSecure threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -494,6 +531,27 @@ public String getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalData3DSecure includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalData3DSecure object is equal to o. */ @@ -507,22 +565,36 @@ public boolean equals(Object o) { } AdditionalData3DSecure additionalData3DSecure = (AdditionalData3DSecure) o; return Objects.equals(this.allow3DS2, additionalData3DSecure.allow3DS2) + && Objects.equals(this.isSetAllow3DS2, additionalData3DSecure.isSetAllow3DS2) && Objects.equals(this.challengeWindowSize, additionalData3DSecure.challengeWindowSize) + && Objects.equals( + this.isSetChallengeWindowSize, additionalData3DSecure.isSetChallengeWindowSize) && Objects.equals(this.executeThreeD, additionalData3DSecure.executeThreeD) + && Objects.equals(this.isSetExecuteThreeD, additionalData3DSecure.isSetExecuteThreeD) && Objects.equals(this.mpiImplementationType, additionalData3DSecure.mpiImplementationType) + && Objects.equals( + this.isSetMpiImplementationType, additionalData3DSecure.isSetMpiImplementationType) && Objects.equals(this.scaExemption, additionalData3DSecure.scaExemption) - && Objects.equals(this.threeDSVersion, additionalData3DSecure.threeDSVersion); + && Objects.equals(this.isSetScaExemption, additionalData3DSecure.isSetScaExemption) + && Objects.equals(this.threeDSVersion, additionalData3DSecure.threeDSVersion) + && Objects.equals(this.isSetThreeDSVersion, additionalData3DSecure.isSetThreeDSVersion); } @Override public int hashCode() { return Objects.hash( allow3DS2, + isSetAllow3DS2, challengeWindowSize, + isSetChallengeWindowSize, executeThreeD, + isSetExecuteThreeD, mpiImplementationType, + isSetMpiImplementationType, scaExemption, - threeDSVersion); + isSetScaExemption, + threeDSVersion, + isSetThreeDSVersion); } @Override @@ -553,6 +625,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllow3DS2) { + addIfNull(nulls, JSON_PROPERTY_ALLOW3_D_S2, this.allow3DS2); + } + if (isSetChallengeWindowSize) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_WINDOW_SIZE, this.challengeWindowSize); + } + if (isSetExecuteThreeD) { + addIfNull(nulls, JSON_PROPERTY_EXECUTE_THREE_D, this.executeThreeD); + } + if (isSetMpiImplementationType) { + addIfNull(nulls, JSON_PROPERTY_MPI_IMPLEMENTATION_TYPE, this.mpiImplementationType); + } + if (isSetScaExemption) { + addIfNull(nulls, JSON_PROPERTY_SCA_EXEMPTION, this.scaExemption); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalData3DSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java index 5e580f112..db676edc2 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataAirline.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -54,107 +56,200 @@ public class AdditionalDataAirline { "airline.agency_invoice_number"; private String airlineAgencyInvoiceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAgencyInvoiceNumber = false; + public static final String JSON_PROPERTY_AIRLINE_AGENCY_PLAN_NAME = "airline.agency_plan_name"; private String airlineAgencyPlanName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAgencyPlanName = false; + public static final String JSON_PROPERTY_AIRLINE_AIRLINE_CODE = "airline.airline_code"; private String airlineAirlineCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAirlineCode = false; + public static final String JSON_PROPERTY_AIRLINE_AIRLINE_DESIGNATOR_CODE = "airline.airline_designator_code"; private String airlineAirlineDesignatorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineAirlineDesignatorCode = false; + public static final String JSON_PROPERTY_AIRLINE_BOARDING_FEE = "airline.boarding_fee"; private String airlineBoardingFee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineBoardingFee = false; + public static final String JSON_PROPERTY_AIRLINE_COMPUTERIZED_RESERVATION_SYSTEM = "airline.computerized_reservation_system"; private String airlineComputerizedReservationSystem; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineComputerizedReservationSystem = false; + public static final String JSON_PROPERTY_AIRLINE_CUSTOMER_REFERENCE_NUMBER = "airline.customer_reference_number"; private String airlineCustomerReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineCustomerReferenceNumber = false; + public static final String JSON_PROPERTY_AIRLINE_DOCUMENT_TYPE = "airline.document_type"; private String airlineDocumentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineDocumentType = false; + public static final String JSON_PROPERTY_AIRLINE_FLIGHT_DATE = "airline.flight_date"; private String airlineFlightDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineFlightDate = false; + public static final String JSON_PROPERTY_AIRLINE_ISSUE_DATE = "airline.issue_date"; private String airlineIssueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineIssueDate = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_CARRIER_CODE = "airline.leg.carrier_code"; private String airlineLegCarrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegCarrierCode = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_CLASS_OF_TRAVEL = "airline.leg.class_of_travel"; private String airlineLegClassOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegClassOfTravel = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DATE_OF_TRAVEL = "airline.leg.date_of_travel"; private String airlineLegDateOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDateOfTravel = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DEPART_AIRPORT = "airline.leg.depart_airport"; private String airlineLegDepartAirport; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDepartAirport = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DEPART_TAX = "airline.leg.depart_tax"; private String airlineLegDepartTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDepartTax = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_DESTINATION_CODE = "airline.leg.destination_code"; private String airlineLegDestinationCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegDestinationCode = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_FARE_BASE_CODE = "airline.leg.fare_base_code"; private String airlineLegFareBaseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegFareBaseCode = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_FLIGHT_NUMBER = "airline.leg.flight_number"; private String airlineLegFlightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegFlightNumber = false; + public static final String JSON_PROPERTY_AIRLINE_LEG_STOP_OVER_CODE = "airline.leg.stop_over_code"; private String airlineLegStopOverCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineLegStopOverCode = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_DATE_OF_BIRTH = "airline.passenger.date_of_birth"; private String airlinePassengerDateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerDateOfBirth = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_FIRST_NAME = "airline.passenger.first_name"; private String airlinePassengerFirstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerFirstName = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_LAST_NAME = "airline.passenger.last_name"; private String airlinePassengerLastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerLastName = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_PHONE_NUMBER = "airline.passenger.phone_number"; private String airlinePassengerPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerPhoneNumber = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_TRAVELLER_TYPE = "airline.passenger.traveller_type"; private String airlinePassengerTravellerType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerTravellerType = false; + public static final String JSON_PROPERTY_AIRLINE_PASSENGER_NAME = "airline.passenger_name"; private String airlinePassengerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlinePassengerName = false; + public static final String JSON_PROPERTY_AIRLINE_TICKET_ISSUE_ADDRESS = "airline.ticket_issue_address"; private String airlineTicketIssueAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTicketIssueAddress = false; + public static final String JSON_PROPERTY_AIRLINE_TICKET_NUMBER = "airline.ticket_number"; private String airlineTicketNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTicketNumber = false; + public static final String JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_CODE = "airline.travel_agency_code"; private String airlineTravelAgencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTravelAgencyCode = false; + public static final String JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_NAME = "airline.travel_agency_name"; private String airlineTravelAgencyName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirlineTravelAgencyName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataAirline() {} /** @@ -167,6 +262,7 @@ public AdditionalDataAirline() {} */ public AdditionalDataAirline airlineAgencyInvoiceNumber(String airlineAgencyInvoiceNumber) { this.airlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber; + isSetAirlineAgencyInvoiceNumber = true; // mark as set return this; } @@ -194,6 +290,7 @@ public String getAirlineAgencyInvoiceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAgencyInvoiceNumber(String airlineAgencyInvoiceNumber) { this.airlineAgencyInvoiceNumber = airlineAgencyInvoiceNumber; + isSetAirlineAgencyInvoiceNumber = true; // mark as set } /** @@ -206,6 +303,7 @@ public void setAirlineAgencyInvoiceNumber(String airlineAgencyInvoiceNumber) { */ public AdditionalDataAirline airlineAgencyPlanName(String airlineAgencyPlanName) { this.airlineAgencyPlanName = airlineAgencyPlanName; + isSetAirlineAgencyPlanName = true; // mark as set return this; } @@ -233,6 +331,7 @@ public String getAirlineAgencyPlanName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAgencyPlanName(String airlineAgencyPlanName) { this.airlineAgencyPlanName = airlineAgencyPlanName; + isSetAirlineAgencyPlanName = true; // mark as set } /** @@ -249,6 +348,7 @@ public void setAirlineAgencyPlanName(String airlineAgencyPlanName) { */ public AdditionalDataAirline airlineAirlineCode(String airlineAirlineCode) { this.airlineAirlineCode = airlineAirlineCode; + isSetAirlineAirlineCode = true; // mark as set return this; } @@ -284,6 +384,7 @@ public String getAirlineAirlineCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAirlineCode(String airlineAirlineCode) { this.airlineAirlineCode = airlineAirlineCode; + isSetAirlineAirlineCode = true; // mark as set } /** @@ -299,6 +400,7 @@ public void setAirlineAirlineCode(String airlineAirlineCode) { */ public AdditionalDataAirline airlineAirlineDesignatorCode(String airlineAirlineDesignatorCode) { this.airlineAirlineDesignatorCode = airlineAirlineDesignatorCode; + isSetAirlineAirlineDesignatorCode = true; // mark as set return this; } @@ -332,6 +434,7 @@ public String getAirlineAirlineDesignatorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineAirlineDesignatorCode(String airlineAirlineDesignatorCode) { this.airlineAirlineDesignatorCode = airlineAirlineDesignatorCode; + isSetAirlineAirlineDesignatorCode = true; // mark as set } /** @@ -346,6 +449,7 @@ public void setAirlineAirlineDesignatorCode(String airlineAirlineDesignatorCode) */ public AdditionalDataAirline airlineBoardingFee(String airlineBoardingFee) { this.airlineBoardingFee = airlineBoardingFee; + isSetAirlineBoardingFee = true; // mark as set return this; } @@ -377,6 +481,7 @@ public String getAirlineBoardingFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineBoardingFee(String airlineBoardingFee) { this.airlineBoardingFee = airlineBoardingFee; + isSetAirlineBoardingFee = true; // mark as set } /** @@ -393,6 +498,7 @@ public void setAirlineBoardingFee(String airlineBoardingFee) { public AdditionalDataAirline airlineComputerizedReservationSystem( String airlineComputerizedReservationSystem) { this.airlineComputerizedReservationSystem = airlineComputerizedReservationSystem; + isSetAirlineComputerizedReservationSystem = true; // mark as set return this; } @@ -426,6 +532,7 @@ public String getAirlineComputerizedReservationSystem() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineComputerizedReservationSystem(String airlineComputerizedReservationSystem) { this.airlineComputerizedReservationSystem = airlineComputerizedReservationSystem; + isSetAirlineComputerizedReservationSystem = true; // mark as set } /** @@ -441,6 +548,7 @@ public void setAirlineComputerizedReservationSystem(String airlineComputerizedRe public AdditionalDataAirline airlineCustomerReferenceNumber( String airlineCustomerReferenceNumber) { this.airlineCustomerReferenceNumber = airlineCustomerReferenceNumber; + isSetAirlineCustomerReferenceNumber = true; // mark as set return this; } @@ -472,6 +580,7 @@ public String getAirlineCustomerReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineCustomerReferenceNumber(String airlineCustomerReferenceNumber) { this.airlineCustomerReferenceNumber = airlineCustomerReferenceNumber; + isSetAirlineCustomerReferenceNumber = true; // mark as set } /** @@ -486,6 +595,7 @@ public void setAirlineCustomerReferenceNumber(String airlineCustomerReferenceNum */ public AdditionalDataAirline airlineDocumentType(String airlineDocumentType) { this.airlineDocumentType = airlineDocumentType; + isSetAirlineDocumentType = true; // mark as set return this; } @@ -517,6 +627,7 @@ public String getAirlineDocumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineDocumentType(String airlineDocumentType) { this.airlineDocumentType = airlineDocumentType; + isSetAirlineDocumentType = true; // mark as set } /** @@ -531,6 +642,7 @@ public void setAirlineDocumentType(String airlineDocumentType) { */ public AdditionalDataAirline airlineFlightDate(String airlineFlightDate) { this.airlineFlightDate = airlineFlightDate; + isSetAirlineFlightDate = true; // mark as set return this; } @@ -562,6 +674,7 @@ public String getAirlineFlightDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineFlightDate(String airlineFlightDate) { this.airlineFlightDate = airlineFlightDate; + isSetAirlineFlightDate = true; // mark as set } /** @@ -574,6 +687,7 @@ public void setAirlineFlightDate(String airlineFlightDate) { */ public AdditionalDataAirline airlineIssueDate(String airlineIssueDate) { this.airlineIssueDate = airlineIssueDate; + isSetAirlineIssueDate = true; // mark as set return this; } @@ -601,6 +715,7 @@ public String getAirlineIssueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineIssueDate(String airlineIssueDate) { this.airlineIssueDate = airlineIssueDate; + isSetAirlineIssueDate = true; // mark as set } /** @@ -617,6 +732,7 @@ public void setAirlineIssueDate(String airlineIssueDate) { */ public AdditionalDataAirline airlineLegCarrierCode(String airlineLegCarrierCode) { this.airlineLegCarrierCode = airlineLegCarrierCode; + isSetAirlineLegCarrierCode = true; // mark as set return this; } @@ -652,6 +768,7 @@ public String getAirlineLegCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegCarrierCode(String airlineLegCarrierCode) { this.airlineLegCarrierCode = airlineLegCarrierCode; + isSetAirlineLegCarrierCode = true; // mark as set } /** @@ -667,6 +784,7 @@ public void setAirlineLegCarrierCode(String airlineLegCarrierCode) { */ public AdditionalDataAirline airlineLegClassOfTravel(String airlineLegClassOfTravel) { this.airlineLegClassOfTravel = airlineLegClassOfTravel; + isSetAirlineLegClassOfTravel = true; // mark as set return this; } @@ -700,6 +818,7 @@ public String getAirlineLegClassOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegClassOfTravel(String airlineLegClassOfTravel) { this.airlineLegClassOfTravel = airlineLegClassOfTravel; + isSetAirlineLegClassOfTravel = true; // mark as set } /** @@ -714,6 +833,7 @@ public void setAirlineLegClassOfTravel(String airlineLegClassOfTravel) { */ public AdditionalDataAirline airlineLegDateOfTravel(String airlineLegDateOfTravel) { this.airlineLegDateOfTravel = airlineLegDateOfTravel; + isSetAirlineLegDateOfTravel = true; // mark as set return this; } @@ -745,6 +865,7 @@ public String getAirlineLegDateOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDateOfTravel(String airlineLegDateOfTravel) { this.airlineLegDateOfTravel = airlineLegDateOfTravel; + isSetAirlineLegDateOfTravel = true; // mark as set } /** @@ -761,6 +882,7 @@ public void setAirlineLegDateOfTravel(String airlineLegDateOfTravel) { */ public AdditionalDataAirline airlineLegDepartAirport(String airlineLegDepartAirport) { this.airlineLegDepartAirport = airlineLegDepartAirport; + isSetAirlineLegDepartAirport = true; // mark as set return this; } @@ -796,6 +918,7 @@ public String getAirlineLegDepartAirport() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDepartAirport(String airlineLegDepartAirport) { this.airlineLegDepartAirport = airlineLegDepartAirport; + isSetAirlineLegDepartAirport = true; // mark as set } /** @@ -811,6 +934,7 @@ public void setAirlineLegDepartAirport(String airlineLegDepartAirport) { */ public AdditionalDataAirline airlineLegDepartTax(String airlineLegDepartTax) { this.airlineLegDepartTax = airlineLegDepartTax; + isSetAirlineLegDepartTax = true; // mark as set return this; } @@ -844,6 +968,7 @@ public String getAirlineLegDepartTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDepartTax(String airlineLegDepartTax) { this.airlineLegDepartTax = airlineLegDepartTax; + isSetAirlineLegDepartTax = true; // mark as set } /** @@ -860,6 +985,7 @@ public void setAirlineLegDepartTax(String airlineLegDepartTax) { */ public AdditionalDataAirline airlineLegDestinationCode(String airlineLegDestinationCode) { this.airlineLegDestinationCode = airlineLegDestinationCode; + isSetAirlineLegDestinationCode = true; // mark as set return this; } @@ -895,6 +1021,7 @@ public String getAirlineLegDestinationCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegDestinationCode(String airlineLegDestinationCode) { this.airlineLegDestinationCode = airlineLegDestinationCode; + isSetAirlineLegDestinationCode = true; // mark as set } /** @@ -909,6 +1036,7 @@ public void setAirlineLegDestinationCode(String airlineLegDestinationCode) { */ public AdditionalDataAirline airlineLegFareBaseCode(String airlineLegFareBaseCode) { this.airlineLegFareBaseCode = airlineLegFareBaseCode; + isSetAirlineLegFareBaseCode = true; // mark as set return this; } @@ -940,6 +1068,7 @@ public String getAirlineLegFareBaseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegFareBaseCode(String airlineLegFareBaseCode) { this.airlineLegFareBaseCode = airlineLegFareBaseCode; + isSetAirlineLegFareBaseCode = true; // mark as set } /** @@ -952,6 +1081,7 @@ public void setAirlineLegFareBaseCode(String airlineLegFareBaseCode) { */ public AdditionalDataAirline airlineLegFlightNumber(String airlineLegFlightNumber) { this.airlineLegFlightNumber = airlineLegFlightNumber; + isSetAirlineLegFlightNumber = true; // mark as set return this; } @@ -979,6 +1109,7 @@ public String getAirlineLegFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegFlightNumber(String airlineLegFlightNumber) { this.airlineLegFlightNumber = airlineLegFlightNumber; + isSetAirlineLegFlightNumber = true; // mark as set } /** @@ -994,6 +1125,7 @@ public void setAirlineLegFlightNumber(String airlineLegFlightNumber) { */ public AdditionalDataAirline airlineLegStopOverCode(String airlineLegStopOverCode) { this.airlineLegStopOverCode = airlineLegStopOverCode; + isSetAirlineLegStopOverCode = true; // mark as set return this; } @@ -1027,6 +1159,7 @@ public String getAirlineLegStopOverCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineLegStopOverCode(String airlineLegStopOverCode) { this.airlineLegStopOverCode = airlineLegStopOverCode; + isSetAirlineLegStopOverCode = true; // mark as set } /** @@ -1039,6 +1172,7 @@ public void setAirlineLegStopOverCode(String airlineLegStopOverCode) { */ public AdditionalDataAirline airlinePassengerDateOfBirth(String airlinePassengerDateOfBirth) { this.airlinePassengerDateOfBirth = airlinePassengerDateOfBirth; + isSetAirlinePassengerDateOfBirth = true; // mark as set return this; } @@ -1066,6 +1200,7 @@ public String getAirlinePassengerDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerDateOfBirth(String airlinePassengerDateOfBirth) { this.airlinePassengerDateOfBirth = airlinePassengerDateOfBirth; + isSetAirlinePassengerDateOfBirth = true; // mark as set } /** @@ -1078,6 +1213,7 @@ public void setAirlinePassengerDateOfBirth(String airlinePassengerDateOfBirth) { */ public AdditionalDataAirline airlinePassengerFirstName(String airlinePassengerFirstName) { this.airlinePassengerFirstName = airlinePassengerFirstName; + isSetAirlinePassengerFirstName = true; // mark as set return this; } @@ -1105,6 +1241,7 @@ public String getAirlinePassengerFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerFirstName(String airlinePassengerFirstName) { this.airlinePassengerFirstName = airlinePassengerFirstName; + isSetAirlinePassengerFirstName = true; // mark as set } /** @@ -1117,6 +1254,7 @@ public void setAirlinePassengerFirstName(String airlinePassengerFirstName) { */ public AdditionalDataAirline airlinePassengerLastName(String airlinePassengerLastName) { this.airlinePassengerLastName = airlinePassengerLastName; + isSetAirlinePassengerLastName = true; // mark as set return this; } @@ -1144,6 +1282,7 @@ public String getAirlinePassengerLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerLastName(String airlinePassengerLastName) { this.airlinePassengerLastName = airlinePassengerLastName; + isSetAirlinePassengerLastName = true; // mark as set } /** @@ -1158,6 +1297,7 @@ public void setAirlinePassengerLastName(String airlinePassengerLastName) { */ public AdditionalDataAirline airlinePassengerPhoneNumber(String airlinePassengerPhoneNumber) { this.airlinePassengerPhoneNumber = airlinePassengerPhoneNumber; + isSetAirlinePassengerPhoneNumber = true; // mark as set return this; } @@ -1189,6 +1329,7 @@ public String getAirlinePassengerPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerPhoneNumber(String airlinePassengerPhoneNumber) { this.airlinePassengerPhoneNumber = airlinePassengerPhoneNumber; + isSetAirlinePassengerPhoneNumber = true; // mark as set } /** @@ -1201,6 +1342,7 @@ public void setAirlinePassengerPhoneNumber(String airlinePassengerPhoneNumber) { */ public AdditionalDataAirline airlinePassengerTravellerType(String airlinePassengerTravellerType) { this.airlinePassengerTravellerType = airlinePassengerTravellerType; + isSetAirlinePassengerTravellerType = true; // mark as set return this; } @@ -1228,6 +1370,7 @@ public String getAirlinePassengerTravellerType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerTravellerType(String airlinePassengerTravellerType) { this.airlinePassengerTravellerType = airlinePassengerTravellerType; + isSetAirlinePassengerTravellerType = true; // mark as set } /** @@ -1244,6 +1387,7 @@ public void setAirlinePassengerTravellerType(String airlinePassengerTravellerTyp */ public AdditionalDataAirline airlinePassengerName(String airlinePassengerName) { this.airlinePassengerName = airlinePassengerName; + isSetAirlinePassengerName = true; // mark as set return this; } @@ -1279,6 +1423,7 @@ public String getAirlinePassengerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlinePassengerName(String airlinePassengerName) { this.airlinePassengerName = airlinePassengerName; + isSetAirlinePassengerName = true; // mark as set } /** @@ -1291,6 +1436,7 @@ public void setAirlinePassengerName(String airlinePassengerName) { */ public AdditionalDataAirline airlineTicketIssueAddress(String airlineTicketIssueAddress) { this.airlineTicketIssueAddress = airlineTicketIssueAddress; + isSetAirlineTicketIssueAddress = true; // mark as set return this; } @@ -1318,6 +1464,7 @@ public String getAirlineTicketIssueAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTicketIssueAddress(String airlineTicketIssueAddress) { this.airlineTicketIssueAddress = airlineTicketIssueAddress; + isSetAirlineTicketIssueAddress = true; // mark as set } /** @@ -1330,6 +1477,7 @@ public void setAirlineTicketIssueAddress(String airlineTicketIssueAddress) { */ public AdditionalDataAirline airlineTicketNumber(String airlineTicketNumber) { this.airlineTicketNumber = airlineTicketNumber; + isSetAirlineTicketNumber = true; // mark as set return this; } @@ -1357,6 +1505,7 @@ public String getAirlineTicketNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTicketNumber(String airlineTicketNumber) { this.airlineTicketNumber = airlineTicketNumber; + isSetAirlineTicketNumber = true; // mark as set } /** @@ -1371,6 +1520,7 @@ public void setAirlineTicketNumber(String airlineTicketNumber) { */ public AdditionalDataAirline airlineTravelAgencyCode(String airlineTravelAgencyCode) { this.airlineTravelAgencyCode = airlineTravelAgencyCode; + isSetAirlineTravelAgencyCode = true; // mark as set return this; } @@ -1402,6 +1552,7 @@ public String getAirlineTravelAgencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTravelAgencyCode(String airlineTravelAgencyCode) { this.airlineTravelAgencyCode = airlineTravelAgencyCode; + isSetAirlineTravelAgencyCode = true; // mark as set } /** @@ -1414,6 +1565,7 @@ public void setAirlineTravelAgencyCode(String airlineTravelAgencyCode) { */ public AdditionalDataAirline airlineTravelAgencyName(String airlineTravelAgencyName) { this.airlineTravelAgencyName = airlineTravelAgencyName; + isSetAirlineTravelAgencyName = true; // mark as set return this; } @@ -1441,6 +1593,27 @@ public String getAirlineTravelAgencyName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirlineTravelAgencyName(String airlineTravelAgencyName) { this.airlineTravelAgencyName = airlineTravelAgencyName; + isSetAirlineTravelAgencyName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataAirline includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataAirline object is equal to o. */ @@ -1455,84 +1628,179 @@ public boolean equals(Object o) { AdditionalDataAirline additionalDataAirline = (AdditionalDataAirline) o; return Objects.equals( this.airlineAgencyInvoiceNumber, additionalDataAirline.airlineAgencyInvoiceNumber) + && Objects.equals( + this.isSetAirlineAgencyInvoiceNumber, + additionalDataAirline.isSetAirlineAgencyInvoiceNumber) && Objects.equals(this.airlineAgencyPlanName, additionalDataAirline.airlineAgencyPlanName) + && Objects.equals( + this.isSetAirlineAgencyPlanName, additionalDataAirline.isSetAirlineAgencyPlanName) && Objects.equals(this.airlineAirlineCode, additionalDataAirline.airlineAirlineCode) + && Objects.equals( + this.isSetAirlineAirlineCode, additionalDataAirline.isSetAirlineAirlineCode) && Objects.equals( this.airlineAirlineDesignatorCode, additionalDataAirline.airlineAirlineDesignatorCode) + && Objects.equals( + this.isSetAirlineAirlineDesignatorCode, + additionalDataAirline.isSetAirlineAirlineDesignatorCode) && Objects.equals(this.airlineBoardingFee, additionalDataAirline.airlineBoardingFee) + && Objects.equals( + this.isSetAirlineBoardingFee, additionalDataAirline.isSetAirlineBoardingFee) && Objects.equals( this.airlineComputerizedReservationSystem, additionalDataAirline.airlineComputerizedReservationSystem) + && Objects.equals( + this.isSetAirlineComputerizedReservationSystem, + additionalDataAirline.isSetAirlineComputerizedReservationSystem) && Objects.equals( this.airlineCustomerReferenceNumber, additionalDataAirline.airlineCustomerReferenceNumber) + && Objects.equals( + this.isSetAirlineCustomerReferenceNumber, + additionalDataAirline.isSetAirlineCustomerReferenceNumber) && Objects.equals(this.airlineDocumentType, additionalDataAirline.airlineDocumentType) + && Objects.equals( + this.isSetAirlineDocumentType, additionalDataAirline.isSetAirlineDocumentType) && Objects.equals(this.airlineFlightDate, additionalDataAirline.airlineFlightDate) + && Objects.equals(this.isSetAirlineFlightDate, additionalDataAirline.isSetAirlineFlightDate) && Objects.equals(this.airlineIssueDate, additionalDataAirline.airlineIssueDate) + && Objects.equals(this.isSetAirlineIssueDate, additionalDataAirline.isSetAirlineIssueDate) && Objects.equals(this.airlineLegCarrierCode, additionalDataAirline.airlineLegCarrierCode) + && Objects.equals( + this.isSetAirlineLegCarrierCode, additionalDataAirline.isSetAirlineLegCarrierCode) && Objects.equals( this.airlineLegClassOfTravel, additionalDataAirline.airlineLegClassOfTravel) + && Objects.equals( + this.isSetAirlineLegClassOfTravel, additionalDataAirline.isSetAirlineLegClassOfTravel) && Objects.equals(this.airlineLegDateOfTravel, additionalDataAirline.airlineLegDateOfTravel) + && Objects.equals( + this.isSetAirlineLegDateOfTravel, additionalDataAirline.isSetAirlineLegDateOfTravel) && Objects.equals( this.airlineLegDepartAirport, additionalDataAirline.airlineLegDepartAirport) + && Objects.equals( + this.isSetAirlineLegDepartAirport, additionalDataAirline.isSetAirlineLegDepartAirport) && Objects.equals(this.airlineLegDepartTax, additionalDataAirline.airlineLegDepartTax) + && Objects.equals( + this.isSetAirlineLegDepartTax, additionalDataAirline.isSetAirlineLegDepartTax) && Objects.equals( this.airlineLegDestinationCode, additionalDataAirline.airlineLegDestinationCode) + && Objects.equals( + this.isSetAirlineLegDestinationCode, + additionalDataAirline.isSetAirlineLegDestinationCode) && Objects.equals(this.airlineLegFareBaseCode, additionalDataAirline.airlineLegFareBaseCode) + && Objects.equals( + this.isSetAirlineLegFareBaseCode, additionalDataAirline.isSetAirlineLegFareBaseCode) && Objects.equals(this.airlineLegFlightNumber, additionalDataAirline.airlineLegFlightNumber) + && Objects.equals( + this.isSetAirlineLegFlightNumber, additionalDataAirline.isSetAirlineLegFlightNumber) && Objects.equals(this.airlineLegStopOverCode, additionalDataAirline.airlineLegStopOverCode) + && Objects.equals( + this.isSetAirlineLegStopOverCode, additionalDataAirline.isSetAirlineLegStopOverCode) && Objects.equals( this.airlinePassengerDateOfBirth, additionalDataAirline.airlinePassengerDateOfBirth) + && Objects.equals( + this.isSetAirlinePassengerDateOfBirth, + additionalDataAirline.isSetAirlinePassengerDateOfBirth) && Objects.equals( this.airlinePassengerFirstName, additionalDataAirline.airlinePassengerFirstName) + && Objects.equals( + this.isSetAirlinePassengerFirstName, + additionalDataAirline.isSetAirlinePassengerFirstName) && Objects.equals( this.airlinePassengerLastName, additionalDataAirline.airlinePassengerLastName) + && Objects.equals( + this.isSetAirlinePassengerLastName, additionalDataAirline.isSetAirlinePassengerLastName) && Objects.equals( this.airlinePassengerPhoneNumber, additionalDataAirline.airlinePassengerPhoneNumber) + && Objects.equals( + this.isSetAirlinePassengerPhoneNumber, + additionalDataAirline.isSetAirlinePassengerPhoneNumber) && Objects.equals( this.airlinePassengerTravellerType, additionalDataAirline.airlinePassengerTravellerType) + && Objects.equals( + this.isSetAirlinePassengerTravellerType, + additionalDataAirline.isSetAirlinePassengerTravellerType) && Objects.equals(this.airlinePassengerName, additionalDataAirline.airlinePassengerName) + && Objects.equals( + this.isSetAirlinePassengerName, additionalDataAirline.isSetAirlinePassengerName) && Objects.equals( this.airlineTicketIssueAddress, additionalDataAirline.airlineTicketIssueAddress) + && Objects.equals( + this.isSetAirlineTicketIssueAddress, + additionalDataAirline.isSetAirlineTicketIssueAddress) && Objects.equals(this.airlineTicketNumber, additionalDataAirline.airlineTicketNumber) + && Objects.equals( + this.isSetAirlineTicketNumber, additionalDataAirline.isSetAirlineTicketNumber) && Objects.equals( this.airlineTravelAgencyCode, additionalDataAirline.airlineTravelAgencyCode) && Objects.equals( - this.airlineTravelAgencyName, additionalDataAirline.airlineTravelAgencyName); + this.isSetAirlineTravelAgencyCode, additionalDataAirline.isSetAirlineTravelAgencyCode) + && Objects.equals( + this.airlineTravelAgencyName, additionalDataAirline.airlineTravelAgencyName) + && Objects.equals( + this.isSetAirlineTravelAgencyName, additionalDataAirline.isSetAirlineTravelAgencyName); } @Override public int hashCode() { return Objects.hash( airlineAgencyInvoiceNumber, + isSetAirlineAgencyInvoiceNumber, airlineAgencyPlanName, + isSetAirlineAgencyPlanName, airlineAirlineCode, + isSetAirlineAirlineCode, airlineAirlineDesignatorCode, + isSetAirlineAirlineDesignatorCode, airlineBoardingFee, + isSetAirlineBoardingFee, airlineComputerizedReservationSystem, + isSetAirlineComputerizedReservationSystem, airlineCustomerReferenceNumber, + isSetAirlineCustomerReferenceNumber, airlineDocumentType, + isSetAirlineDocumentType, airlineFlightDate, + isSetAirlineFlightDate, airlineIssueDate, + isSetAirlineIssueDate, airlineLegCarrierCode, + isSetAirlineLegCarrierCode, airlineLegClassOfTravel, + isSetAirlineLegClassOfTravel, airlineLegDateOfTravel, + isSetAirlineLegDateOfTravel, airlineLegDepartAirport, + isSetAirlineLegDepartAirport, airlineLegDepartTax, + isSetAirlineLegDepartTax, airlineLegDestinationCode, + isSetAirlineLegDestinationCode, airlineLegFareBaseCode, + isSetAirlineLegFareBaseCode, airlineLegFlightNumber, + isSetAirlineLegFlightNumber, airlineLegStopOverCode, + isSetAirlineLegStopOverCode, airlinePassengerDateOfBirth, + isSetAirlinePassengerDateOfBirth, airlinePassengerFirstName, + isSetAirlinePassengerFirstName, airlinePassengerLastName, + isSetAirlinePassengerLastName, airlinePassengerPhoneNumber, + isSetAirlinePassengerPhoneNumber, airlinePassengerTravellerType, + isSetAirlinePassengerTravellerType, airlinePassengerName, + isSetAirlinePassengerName, airlineTicketIssueAddress, + isSetAirlineTicketIssueAddress, airlineTicketNumber, + isSetAirlineTicketNumber, airlineTravelAgencyCode, - airlineTravelAgencyName); + isSetAirlineTravelAgencyCode, + airlineTravelAgencyName, + isSetAirlineTravelAgencyName); } @Override @@ -1632,6 +1900,127 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAirlineAgencyInvoiceNumber) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_AGENCY_INVOICE_NUMBER, this.airlineAgencyInvoiceNumber); + } + if (isSetAirlineAgencyPlanName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_AGENCY_PLAN_NAME, this.airlineAgencyPlanName); + } + if (isSetAirlineAirlineCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_AIRLINE_CODE, this.airlineAirlineCode); + } + if (isSetAirlineAirlineDesignatorCode) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_AIRLINE_DESIGNATOR_CODE, this.airlineAirlineDesignatorCode); + } + if (isSetAirlineBoardingFee) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_BOARDING_FEE, this.airlineBoardingFee); + } + if (isSetAirlineComputerizedReservationSystem) { + addIfNull( + nulls, + JSON_PROPERTY_AIRLINE_COMPUTERIZED_RESERVATION_SYSTEM, + this.airlineComputerizedReservationSystem); + } + if (isSetAirlineCustomerReferenceNumber) { + addIfNull( + nulls, + JSON_PROPERTY_AIRLINE_CUSTOMER_REFERENCE_NUMBER, + this.airlineCustomerReferenceNumber); + } + if (isSetAirlineDocumentType) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_DOCUMENT_TYPE, this.airlineDocumentType); + } + if (isSetAirlineFlightDate) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_FLIGHT_DATE, this.airlineFlightDate); + } + if (isSetAirlineIssueDate) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_ISSUE_DATE, this.airlineIssueDate); + } + if (isSetAirlineLegCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_CARRIER_CODE, this.airlineLegCarrierCode); + } + if (isSetAirlineLegClassOfTravel) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_CLASS_OF_TRAVEL, this.airlineLegClassOfTravel); + } + if (isSetAirlineLegDateOfTravel) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DATE_OF_TRAVEL, this.airlineLegDateOfTravel); + } + if (isSetAirlineLegDepartAirport) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DEPART_AIRPORT, this.airlineLegDepartAirport); + } + if (isSetAirlineLegDepartTax) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DEPART_TAX, this.airlineLegDepartTax); + } + if (isSetAirlineLegDestinationCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_DESTINATION_CODE, this.airlineLegDestinationCode); + } + if (isSetAirlineLegFareBaseCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_FARE_BASE_CODE, this.airlineLegFareBaseCode); + } + if (isSetAirlineLegFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_FLIGHT_NUMBER, this.airlineLegFlightNumber); + } + if (isSetAirlineLegStopOverCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_LEG_STOP_OVER_CODE, this.airlineLegStopOverCode); + } + if (isSetAirlinePassengerDateOfBirth) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_PASSENGER_DATE_OF_BIRTH, this.airlinePassengerDateOfBirth); + } + if (isSetAirlinePassengerFirstName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_PASSENGER_FIRST_NAME, this.airlinePassengerFirstName); + } + if (isSetAirlinePassengerLastName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_PASSENGER_LAST_NAME, this.airlinePassengerLastName); + } + if (isSetAirlinePassengerPhoneNumber) { + addIfNull( + nulls, JSON_PROPERTY_AIRLINE_PASSENGER_PHONE_NUMBER, this.airlinePassengerPhoneNumber); + } + if (isSetAirlinePassengerTravellerType) { + addIfNull( + nulls, + JSON_PROPERTY_AIRLINE_PASSENGER_TRAVELLER_TYPE, + this.airlinePassengerTravellerType); + } + if (isSetAirlinePassengerName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_PASSENGER_NAME, this.airlinePassengerName); + } + if (isSetAirlineTicketIssueAddress) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TICKET_ISSUE_ADDRESS, this.airlineTicketIssueAddress); + } + if (isSetAirlineTicketNumber) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TICKET_NUMBER, this.airlineTicketNumber); + } + if (isSetAirlineTravelAgencyCode) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_CODE, this.airlineTravelAgencyCode); + } + if (isSetAirlineTravelAgencyName) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE_TRAVEL_AGENCY_NAME, this.airlineTravelAgencyName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataAirline given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java index 4369495af..bbddbde21 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCarRental.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -47,84 +49,159 @@ public class AdditionalDataCarRental { public static final String JSON_PROPERTY_CAR_RENTAL_CHECK_OUT_DATE = "carRental.checkOutDate"; private String carRentalCheckOutDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalCheckOutDate = false; + public static final String JSON_PROPERTY_CAR_RENTAL_CUSTOMER_SERVICE_TOLL_FREE_NUMBER = "carRental.customerServiceTollFreeNumber"; private String carRentalCustomerServiceTollFreeNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalCustomerServiceTollFreeNumber = false; + public static final String JSON_PROPERTY_CAR_RENTAL_DAYS_RENTED = "carRental.daysRented"; private String carRentalDaysRented; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalDaysRented = false; + public static final String JSON_PROPERTY_CAR_RENTAL_FUEL_CHARGES = "carRental.fuelCharges"; private String carRentalFuelCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalFuelCharges = false; + public static final String JSON_PROPERTY_CAR_RENTAL_INSURANCE_CHARGES = "carRental.insuranceCharges"; private String carRentalInsuranceCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalInsuranceCharges = false; + public static final String JSON_PROPERTY_CAR_RENTAL_LOCATION_CITY = "carRental.locationCity"; private String carRentalLocationCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalLocationCity = false; + public static final String JSON_PROPERTY_CAR_RENTAL_LOCATION_COUNTRY = "carRental.locationCountry"; private String carRentalLocationCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalLocationCountry = false; + public static final String JSON_PROPERTY_CAR_RENTAL_LOCATION_STATE_PROVINCE = "carRental.locationStateProvince"; private String carRentalLocationStateProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalLocationStateProvince = false; + public static final String JSON_PROPERTY_CAR_RENTAL_NO_SHOW_INDICATOR = "carRental.noShowIndicator"; private String carRentalNoShowIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalNoShowIndicator = false; + public static final String JSON_PROPERTY_CAR_RENTAL_ONE_WAY_DROP_OFF_CHARGES = "carRental.oneWayDropOffCharges"; private String carRentalOneWayDropOffCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalOneWayDropOffCharges = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RATE = "carRental.rate"; private String carRentalRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRate = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RATE_INDICATOR = "carRental.rateIndicator"; private String carRentalRateIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRateIndicator = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RENTAL_AGREEMENT_NUMBER = "carRental.rentalAgreementNumber"; private String carRentalRentalAgreementNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRentalAgreementNumber = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RENTAL_CLASS_ID = "carRental.rentalClassId"; private String carRentalRentalClassId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRentalClassId = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RENTER_NAME = "carRental.renterName"; private String carRentalRenterName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalRenterName = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_CITY = "carRental.returnCity"; private String carRentalReturnCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnCity = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_COUNTRY = "carRental.returnCountry"; private String carRentalReturnCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnCountry = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_DATE = "carRental.returnDate"; private String carRentalReturnDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnDate = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_LOCATION_ID = "carRental.returnLocationId"; private String carRentalReturnLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnLocationId = false; + public static final String JSON_PROPERTY_CAR_RENTAL_RETURN_STATE_PROVINCE = "carRental.returnStateProvince"; private String carRentalReturnStateProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalReturnStateProvince = false; + public static final String JSON_PROPERTY_CAR_RENTAL_TAX_EXEMPT_INDICATOR = "carRental.taxExemptIndicator"; private String carRentalTaxExemptIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarRentalTaxExemptIndicator = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION = "travelEntertainmentAuthData.duration"; private String travelEntertainmentAuthDataDuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataDuration = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET = "travelEntertainmentAuthData.market"; private String travelEntertainmentAuthDataMarket; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataMarket = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataCarRental() {} /** @@ -135,6 +212,7 @@ public AdditionalDataCarRental() {} */ public AdditionalDataCarRental carRentalCheckOutDate(String carRentalCheckOutDate) { this.carRentalCheckOutDate = carRentalCheckOutDate; + isSetCarRentalCheckOutDate = true; // mark as set return this; } @@ -158,6 +236,7 @@ public String getCarRentalCheckOutDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalCheckOutDate(String carRentalCheckOutDate) { this.carRentalCheckOutDate = carRentalCheckOutDate; + isSetCarRentalCheckOutDate = true; // mark as set } /** @@ -174,6 +253,7 @@ public void setCarRentalCheckOutDate(String carRentalCheckOutDate) { public AdditionalDataCarRental carRentalCustomerServiceTollFreeNumber( String carRentalCustomerServiceTollFreeNumber) { this.carRentalCustomerServiceTollFreeNumber = carRentalCustomerServiceTollFreeNumber; + isSetCarRentalCustomerServiceTollFreeNumber = true; // mark as set return this; } @@ -208,6 +288,7 @@ public String getCarRentalCustomerServiceTollFreeNumber() { public void setCarRentalCustomerServiceTollFreeNumber( String carRentalCustomerServiceTollFreeNumber) { this.carRentalCustomerServiceTollFreeNumber = carRentalCustomerServiceTollFreeNumber; + isSetCarRentalCustomerServiceTollFreeNumber = true; // mark as set } /** @@ -220,6 +301,7 @@ public void setCarRentalCustomerServiceTollFreeNumber( */ public AdditionalDataCarRental carRentalDaysRented(String carRentalDaysRented) { this.carRentalDaysRented = carRentalDaysRented; + isSetCarRentalDaysRented = true; // mark as set return this; } @@ -247,6 +329,7 @@ public String getCarRentalDaysRented() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalDaysRented(String carRentalDaysRented) { this.carRentalDaysRented = carRentalDaysRented; + isSetCarRentalDaysRented = true; // mark as set } /** @@ -261,6 +344,7 @@ public void setCarRentalDaysRented(String carRentalDaysRented) { */ public AdditionalDataCarRental carRentalFuelCharges(String carRentalFuelCharges) { this.carRentalFuelCharges = carRentalFuelCharges; + isSetCarRentalFuelCharges = true; // mark as set return this; } @@ -292,6 +376,7 @@ public String getCarRentalFuelCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalFuelCharges(String carRentalFuelCharges) { this.carRentalFuelCharges = carRentalFuelCharges; + isSetCarRentalFuelCharges = true; // mark as set } /** @@ -306,6 +391,7 @@ public void setCarRentalFuelCharges(String carRentalFuelCharges) { */ public AdditionalDataCarRental carRentalInsuranceCharges(String carRentalInsuranceCharges) { this.carRentalInsuranceCharges = carRentalInsuranceCharges; + isSetCarRentalInsuranceCharges = true; // mark as set return this; } @@ -337,6 +423,7 @@ public String getCarRentalInsuranceCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalInsuranceCharges(String carRentalInsuranceCharges) { this.carRentalInsuranceCharges = carRentalInsuranceCharges; + isSetCarRentalInsuranceCharges = true; // mark as set } /** @@ -349,6 +436,7 @@ public void setCarRentalInsuranceCharges(String carRentalInsuranceCharges) { */ public AdditionalDataCarRental carRentalLocationCity(String carRentalLocationCity) { this.carRentalLocationCity = carRentalLocationCity; + isSetCarRentalLocationCity = true; // mark as set return this; } @@ -376,6 +464,7 @@ public String getCarRentalLocationCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalLocationCity(String carRentalLocationCity) { this.carRentalLocationCity = carRentalLocationCity; + isSetCarRentalLocationCity = true; // mark as set } /** @@ -390,6 +479,7 @@ public void setCarRentalLocationCity(String carRentalLocationCity) { */ public AdditionalDataCarRental carRentalLocationCountry(String carRentalLocationCountry) { this.carRentalLocationCountry = carRentalLocationCountry; + isSetCarRentalLocationCountry = true; // mark as set return this; } @@ -421,6 +511,7 @@ public String getCarRentalLocationCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalLocationCountry(String carRentalLocationCountry) { this.carRentalLocationCountry = carRentalLocationCountry; + isSetCarRentalLocationCountry = true; // mark as set } /** @@ -435,6 +526,7 @@ public void setCarRentalLocationCountry(String carRentalLocationCountry) { public AdditionalDataCarRental carRentalLocationStateProvince( String carRentalLocationStateProvince) { this.carRentalLocationStateProvince = carRentalLocationStateProvince; + isSetCarRentalLocationStateProvince = true; // mark as set return this; } @@ -464,6 +556,7 @@ public String getCarRentalLocationStateProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalLocationStateProvince(String carRentalLocationStateProvince) { this.carRentalLocationStateProvince = carRentalLocationStateProvince; + isSetCarRentalLocationStateProvince = true; // mark as set } /** @@ -476,6 +569,7 @@ public void setCarRentalLocationStateProvince(String carRentalLocationStateProvi */ public AdditionalDataCarRental carRentalNoShowIndicator(String carRentalNoShowIndicator) { this.carRentalNoShowIndicator = carRentalNoShowIndicator; + isSetCarRentalNoShowIndicator = true; // mark as set return this; } @@ -503,6 +597,7 @@ public String getCarRentalNoShowIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalNoShowIndicator(String carRentalNoShowIndicator) { this.carRentalNoShowIndicator = carRentalNoShowIndicator; + isSetCarRentalNoShowIndicator = true; // mark as set } /** @@ -517,6 +612,7 @@ public void setCarRentalNoShowIndicator(String carRentalNoShowIndicator) { public AdditionalDataCarRental carRentalOneWayDropOffCharges( String carRentalOneWayDropOffCharges) { this.carRentalOneWayDropOffCharges = carRentalOneWayDropOffCharges; + isSetCarRentalOneWayDropOffCharges = true; // mark as set return this; } @@ -546,6 +642,7 @@ public String getCarRentalOneWayDropOffCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalOneWayDropOffCharges(String carRentalOneWayDropOffCharges) { this.carRentalOneWayDropOffCharges = carRentalOneWayDropOffCharges; + isSetCarRentalOneWayDropOffCharges = true; // mark as set } /** @@ -560,6 +657,7 @@ public void setCarRentalOneWayDropOffCharges(String carRentalOneWayDropOffCharge */ public AdditionalDataCarRental carRentalRate(String carRentalRate) { this.carRentalRate = carRentalRate; + isSetCarRentalRate = true; // mark as set return this; } @@ -591,6 +689,7 @@ public String getCarRentalRate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRate(String carRentalRate) { this.carRentalRate = carRentalRate; + isSetCarRentalRate = true; // mark as set } /** @@ -602,6 +701,7 @@ public void setCarRentalRate(String carRentalRate) { */ public AdditionalDataCarRental carRentalRateIndicator(String carRentalRateIndicator) { this.carRentalRateIndicator = carRentalRateIndicator; + isSetCarRentalRateIndicator = true; // mark as set return this; } @@ -627,6 +727,7 @@ public String getCarRentalRateIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRateIndicator(String carRentalRateIndicator) { this.carRentalRateIndicator = carRentalRateIndicator; + isSetCarRentalRateIndicator = true; // mark as set } /** @@ -641,6 +742,7 @@ public void setCarRentalRateIndicator(String carRentalRateIndicator) { public AdditionalDataCarRental carRentalRentalAgreementNumber( String carRentalRentalAgreementNumber) { this.carRentalRentalAgreementNumber = carRentalRentalAgreementNumber; + isSetCarRentalRentalAgreementNumber = true; // mark as set return this; } @@ -670,6 +772,7 @@ public String getCarRentalRentalAgreementNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRentalAgreementNumber(String carRentalRentalAgreementNumber) { this.carRentalRentalAgreementNumber = carRentalRentalAgreementNumber; + isSetCarRentalRentalAgreementNumber = true; // mark as set } /** @@ -682,6 +785,7 @@ public void setCarRentalRentalAgreementNumber(String carRentalRentalAgreementNum */ public AdditionalDataCarRental carRentalRentalClassId(String carRentalRentalClassId) { this.carRentalRentalClassId = carRentalRentalClassId; + isSetCarRentalRentalClassId = true; // mark as set return this; } @@ -709,6 +813,7 @@ public String getCarRentalRentalClassId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRentalClassId(String carRentalRentalClassId) { this.carRentalRentalClassId = carRentalRentalClassId; + isSetCarRentalRentalClassId = true; // mark as set } /** @@ -723,6 +828,7 @@ public void setCarRentalRentalClassId(String carRentalRentalClassId) { */ public AdditionalDataCarRental carRentalRenterName(String carRentalRenterName) { this.carRentalRenterName = carRentalRenterName; + isSetCarRentalRenterName = true; // mark as set return this; } @@ -754,6 +860,7 @@ public String getCarRentalRenterName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalRenterName(String carRentalRenterName) { this.carRentalRenterName = carRentalRenterName; + isSetCarRentalRenterName = true; // mark as set } /** @@ -766,6 +873,7 @@ public void setCarRentalRenterName(String carRentalRenterName) { */ public AdditionalDataCarRental carRentalReturnCity(String carRentalReturnCity) { this.carRentalReturnCity = carRentalReturnCity; + isSetCarRentalReturnCity = true; // mark as set return this; } @@ -793,6 +901,7 @@ public String getCarRentalReturnCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnCity(String carRentalReturnCity) { this.carRentalReturnCity = carRentalReturnCity; + isSetCarRentalReturnCity = true; // mark as set } /** @@ -807,6 +916,7 @@ public void setCarRentalReturnCity(String carRentalReturnCity) { */ public AdditionalDataCarRental carRentalReturnCountry(String carRentalReturnCountry) { this.carRentalReturnCountry = carRentalReturnCountry; + isSetCarRentalReturnCountry = true; // mark as set return this; } @@ -838,6 +948,7 @@ public String getCarRentalReturnCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnCountry(String carRentalReturnCountry) { this.carRentalReturnCountry = carRentalReturnCountry; + isSetCarRentalReturnCountry = true; // mark as set } /** @@ -849,6 +960,7 @@ public void setCarRentalReturnCountry(String carRentalReturnCountry) { */ public AdditionalDataCarRental carRentalReturnDate(String carRentalReturnDate) { this.carRentalReturnDate = carRentalReturnDate; + isSetCarRentalReturnDate = true; // mark as set return this; } @@ -874,6 +986,7 @@ public String getCarRentalReturnDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnDate(String carRentalReturnDate) { this.carRentalReturnDate = carRentalReturnDate; + isSetCarRentalReturnDate = true; // mark as set } /** @@ -887,6 +1000,7 @@ public void setCarRentalReturnDate(String carRentalReturnDate) { */ public AdditionalDataCarRental carRentalReturnLocationId(String carRentalReturnLocationId) { this.carRentalReturnLocationId = carRentalReturnLocationId; + isSetCarRentalReturnLocationId = true; // mark as set return this; } @@ -916,6 +1030,7 @@ public String getCarRentalReturnLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnLocationId(String carRentalReturnLocationId) { this.carRentalReturnLocationId = carRentalReturnLocationId; + isSetCarRentalReturnLocationId = true; // mark as set } /** @@ -929,6 +1044,7 @@ public void setCarRentalReturnLocationId(String carRentalReturnLocationId) { */ public AdditionalDataCarRental carRentalReturnStateProvince(String carRentalReturnStateProvince) { this.carRentalReturnStateProvince = carRentalReturnStateProvince; + isSetCarRentalReturnStateProvince = true; // mark as set return this; } @@ -958,6 +1074,7 @@ public String getCarRentalReturnStateProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalReturnStateProvince(String carRentalReturnStateProvince) { this.carRentalReturnStateProvince = carRentalReturnStateProvince; + isSetCarRentalReturnStateProvince = true; // mark as set } /** @@ -971,6 +1088,7 @@ public void setCarRentalReturnStateProvince(String carRentalReturnStateProvince) */ public AdditionalDataCarRental carRentalTaxExemptIndicator(String carRentalTaxExemptIndicator) { this.carRentalTaxExemptIndicator = carRentalTaxExemptIndicator; + isSetCarRentalTaxExemptIndicator = true; // mark as set return this; } @@ -1000,6 +1118,7 @@ public String getCarRentalTaxExemptIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarRentalTaxExemptIndicator(String carRentalTaxExemptIndicator) { this.carRentalTaxExemptIndicator = carRentalTaxExemptIndicator; + isSetCarRentalTaxExemptIndicator = true; // mark as set } /** @@ -1013,6 +1132,7 @@ public void setCarRentalTaxExemptIndicator(String carRentalTaxExemptIndicator) { public AdditionalDataCarRental travelEntertainmentAuthDataDuration( String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set return this; } @@ -1040,6 +1160,7 @@ public String getTravelEntertainmentAuthDataDuration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set } /** @@ -1055,6 +1176,7 @@ public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAut public AdditionalDataCarRental travelEntertainmentAuthDataMarket( String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set return this; } @@ -1086,6 +1208,27 @@ public String getTravelEntertainmentAuthDataMarket() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataMarket(String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataCarRental includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataCarRental object is equal to o. */ @@ -1099,77 +1242,157 @@ public boolean equals(Object o) { } AdditionalDataCarRental additionalDataCarRental = (AdditionalDataCarRental) o; return Objects.equals(this.carRentalCheckOutDate, additionalDataCarRental.carRentalCheckOutDate) + && Objects.equals( + this.isSetCarRentalCheckOutDate, additionalDataCarRental.isSetCarRentalCheckOutDate) && Objects.equals( this.carRentalCustomerServiceTollFreeNumber, additionalDataCarRental.carRentalCustomerServiceTollFreeNumber) + && Objects.equals( + this.isSetCarRentalCustomerServiceTollFreeNumber, + additionalDataCarRental.isSetCarRentalCustomerServiceTollFreeNumber) && Objects.equals(this.carRentalDaysRented, additionalDataCarRental.carRentalDaysRented) + && Objects.equals( + this.isSetCarRentalDaysRented, additionalDataCarRental.isSetCarRentalDaysRented) && Objects.equals(this.carRentalFuelCharges, additionalDataCarRental.carRentalFuelCharges) + && Objects.equals( + this.isSetCarRentalFuelCharges, additionalDataCarRental.isSetCarRentalFuelCharges) && Objects.equals( this.carRentalInsuranceCharges, additionalDataCarRental.carRentalInsuranceCharges) + && Objects.equals( + this.isSetCarRentalInsuranceCharges, + additionalDataCarRental.isSetCarRentalInsuranceCharges) && Objects.equals(this.carRentalLocationCity, additionalDataCarRental.carRentalLocationCity) + && Objects.equals( + this.isSetCarRentalLocationCity, additionalDataCarRental.isSetCarRentalLocationCity) && Objects.equals( this.carRentalLocationCountry, additionalDataCarRental.carRentalLocationCountry) + && Objects.equals( + this.isSetCarRentalLocationCountry, + additionalDataCarRental.isSetCarRentalLocationCountry) && Objects.equals( this.carRentalLocationStateProvince, additionalDataCarRental.carRentalLocationStateProvince) + && Objects.equals( + this.isSetCarRentalLocationStateProvince, + additionalDataCarRental.isSetCarRentalLocationStateProvince) && Objects.equals( this.carRentalNoShowIndicator, additionalDataCarRental.carRentalNoShowIndicator) + && Objects.equals( + this.isSetCarRentalNoShowIndicator, + additionalDataCarRental.isSetCarRentalNoShowIndicator) && Objects.equals( this.carRentalOneWayDropOffCharges, additionalDataCarRental.carRentalOneWayDropOffCharges) + && Objects.equals( + this.isSetCarRentalOneWayDropOffCharges, + additionalDataCarRental.isSetCarRentalOneWayDropOffCharges) && Objects.equals(this.carRentalRate, additionalDataCarRental.carRentalRate) + && Objects.equals(this.isSetCarRentalRate, additionalDataCarRental.isSetCarRentalRate) && Objects.equals( this.carRentalRateIndicator, additionalDataCarRental.carRentalRateIndicator) + && Objects.equals( + this.isSetCarRentalRateIndicator, additionalDataCarRental.isSetCarRentalRateIndicator) && Objects.equals( this.carRentalRentalAgreementNumber, additionalDataCarRental.carRentalRentalAgreementNumber) + && Objects.equals( + this.isSetCarRentalRentalAgreementNumber, + additionalDataCarRental.isSetCarRentalRentalAgreementNumber) && Objects.equals( this.carRentalRentalClassId, additionalDataCarRental.carRentalRentalClassId) + && Objects.equals( + this.isSetCarRentalRentalClassId, additionalDataCarRental.isSetCarRentalRentalClassId) && Objects.equals(this.carRentalRenterName, additionalDataCarRental.carRentalRenterName) + && Objects.equals( + this.isSetCarRentalRenterName, additionalDataCarRental.isSetCarRentalRenterName) && Objects.equals(this.carRentalReturnCity, additionalDataCarRental.carRentalReturnCity) + && Objects.equals( + this.isSetCarRentalReturnCity, additionalDataCarRental.isSetCarRentalReturnCity) && Objects.equals( this.carRentalReturnCountry, additionalDataCarRental.carRentalReturnCountry) + && Objects.equals( + this.isSetCarRentalReturnCountry, additionalDataCarRental.isSetCarRentalReturnCountry) && Objects.equals(this.carRentalReturnDate, additionalDataCarRental.carRentalReturnDate) + && Objects.equals( + this.isSetCarRentalReturnDate, additionalDataCarRental.isSetCarRentalReturnDate) && Objects.equals( this.carRentalReturnLocationId, additionalDataCarRental.carRentalReturnLocationId) + && Objects.equals( + this.isSetCarRentalReturnLocationId, + additionalDataCarRental.isSetCarRentalReturnLocationId) && Objects.equals( this.carRentalReturnStateProvince, additionalDataCarRental.carRentalReturnStateProvince) + && Objects.equals( + this.isSetCarRentalReturnStateProvince, + additionalDataCarRental.isSetCarRentalReturnStateProvince) && Objects.equals( this.carRentalTaxExemptIndicator, additionalDataCarRental.carRentalTaxExemptIndicator) + && Objects.equals( + this.isSetCarRentalTaxExemptIndicator, + additionalDataCarRental.isSetCarRentalTaxExemptIndicator) && Objects.equals( this.travelEntertainmentAuthDataDuration, additionalDataCarRental.travelEntertainmentAuthDataDuration) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataDuration, + additionalDataCarRental.isSetTravelEntertainmentAuthDataDuration) && Objects.equals( this.travelEntertainmentAuthDataMarket, - additionalDataCarRental.travelEntertainmentAuthDataMarket); + additionalDataCarRental.travelEntertainmentAuthDataMarket) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataMarket, + additionalDataCarRental.isSetTravelEntertainmentAuthDataMarket); } @Override public int hashCode() { return Objects.hash( carRentalCheckOutDate, + isSetCarRentalCheckOutDate, carRentalCustomerServiceTollFreeNumber, + isSetCarRentalCustomerServiceTollFreeNumber, carRentalDaysRented, + isSetCarRentalDaysRented, carRentalFuelCharges, + isSetCarRentalFuelCharges, carRentalInsuranceCharges, + isSetCarRentalInsuranceCharges, carRentalLocationCity, + isSetCarRentalLocationCity, carRentalLocationCountry, + isSetCarRentalLocationCountry, carRentalLocationStateProvince, + isSetCarRentalLocationStateProvince, carRentalNoShowIndicator, + isSetCarRentalNoShowIndicator, carRentalOneWayDropOffCharges, + isSetCarRentalOneWayDropOffCharges, carRentalRate, + isSetCarRentalRate, carRentalRateIndicator, + isSetCarRentalRateIndicator, carRentalRentalAgreementNumber, + isSetCarRentalRentalAgreementNumber, carRentalRentalClassId, + isSetCarRentalRentalClassId, carRentalRenterName, + isSetCarRentalRenterName, carRentalReturnCity, + isSetCarRentalReturnCity, carRentalReturnCountry, + isSetCarRentalReturnCountry, carRentalReturnDate, + isSetCarRentalReturnDate, carRentalReturnLocationId, + isSetCarRentalReturnLocationId, carRentalReturnStateProvince, + isSetCarRentalReturnStateProvince, carRentalTaxExemptIndicator, + isSetCarRentalTaxExemptIndicator, travelEntertainmentAuthDataDuration, - travelEntertainmentAuthDataMarket); + isSetTravelEntertainmentAuthDataDuration, + travelEntertainmentAuthDataMarket, + isSetTravelEntertainmentAuthDataMarket); } @Override @@ -1257,6 +1480,116 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCarRentalCheckOutDate) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_CHECK_OUT_DATE, this.carRentalCheckOutDate); + } + if (isSetCarRentalCustomerServiceTollFreeNumber) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_CUSTOMER_SERVICE_TOLL_FREE_NUMBER, + this.carRentalCustomerServiceTollFreeNumber); + } + if (isSetCarRentalDaysRented) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_DAYS_RENTED, this.carRentalDaysRented); + } + if (isSetCarRentalFuelCharges) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_FUEL_CHARGES, this.carRentalFuelCharges); + } + if (isSetCarRentalInsuranceCharges) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_INSURANCE_CHARGES, this.carRentalInsuranceCharges); + } + if (isSetCarRentalLocationCity) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_LOCATION_CITY, this.carRentalLocationCity); + } + if (isSetCarRentalLocationCountry) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_LOCATION_COUNTRY, this.carRentalLocationCountry); + } + if (isSetCarRentalLocationStateProvince) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_LOCATION_STATE_PROVINCE, + this.carRentalLocationStateProvince); + } + if (isSetCarRentalNoShowIndicator) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_NO_SHOW_INDICATOR, this.carRentalNoShowIndicator); + } + if (isSetCarRentalOneWayDropOffCharges) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_ONE_WAY_DROP_OFF_CHARGES, + this.carRentalOneWayDropOffCharges); + } + if (isSetCarRentalRate) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RATE, this.carRentalRate); + } + if (isSetCarRentalRateIndicator) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RATE_INDICATOR, this.carRentalRateIndicator); + } + if (isSetCarRentalRentalAgreementNumber) { + addIfNull( + nulls, + JSON_PROPERTY_CAR_RENTAL_RENTAL_AGREEMENT_NUMBER, + this.carRentalRentalAgreementNumber); + } + if (isSetCarRentalRentalClassId) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RENTAL_CLASS_ID, this.carRentalRentalClassId); + } + if (isSetCarRentalRenterName) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RENTER_NAME, this.carRentalRenterName); + } + if (isSetCarRentalReturnCity) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_CITY, this.carRentalReturnCity); + } + if (isSetCarRentalReturnCountry) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_COUNTRY, this.carRentalReturnCountry); + } + if (isSetCarRentalReturnDate) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_DATE, this.carRentalReturnDate); + } + if (isSetCarRentalReturnLocationId) { + addIfNull(nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_LOCATION_ID, this.carRentalReturnLocationId); + } + if (isSetCarRentalReturnStateProvince) { + addIfNull( + nulls, JSON_PROPERTY_CAR_RENTAL_RETURN_STATE_PROVINCE, this.carRentalReturnStateProvince); + } + if (isSetCarRentalTaxExemptIndicator) { + addIfNull( + nulls, JSON_PROPERTY_CAR_RENTAL_TAX_EXEMPT_INDICATOR, this.carRentalTaxExemptIndicator); + } + if (isSetTravelEntertainmentAuthDataDuration) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION, + this.travelEntertainmentAuthDataDuration); + } + if (isSetTravelEntertainmentAuthDataMarket) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET, + this.travelEntertainmentAuthDataMarket); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataCarRental given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java b/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java index 5e60cc065..cf10c5793 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,22 +52,40 @@ public class AdditionalDataCommon { "RequestedTestAcquirerResponseCode"; private String requestedTestAcquirerResponseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedTestAcquirerResponseCode = false; + public static final String JSON_PROPERTY_REQUESTED_TEST_ERROR_RESPONSE_CODE = "RequestedTestErrorResponseCode"; private String requestedTestErrorResponseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestedTestErrorResponseCode = false; + public static final String JSON_PROPERTY_ALLOW_PARTIAL_AUTH = "allowPartialAuth"; private String allowPartialAuth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowPartialAuth = false; + public static final String JSON_PROPERTY_AUTHORISATION_TYPE = "authorisationType"; private String authorisationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationType = false; + public static final String JSON_PROPERTY_AUTO_RESCUE = "autoRescue"; private String autoRescue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAutoRescue = false; + public static final String JSON_PROPERTY_CUSTOM_ROUTING_FLAG = "customRoutingFlag"; private String customRoutingFlag; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomRoutingFlag = false; + /** * In case of [asynchronous authorisation * adjustment](https://docs.adyen.com/online-payments/adjust-authorisation#adjust-authorisation), @@ -117,48 +137,99 @@ public static IndustryUsageEnum fromValue(String value) { public static final String JSON_PROPERTY_INDUSTRY_USAGE = "industryUsage"; private IndustryUsageEnum industryUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryUsage = false; + public static final String JSON_PROPERTY_MANUAL_CAPTURE = "manualCapture"; private String manualCapture; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManualCapture = false; + public static final String JSON_PROPERTY_MAX_DAYS_TO_RESCUE = "maxDaysToRescue"; private String maxDaysToRescue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxDaysToRescue = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE = "networkTxReference"; private String networkTxReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OVERWRITE_BRAND = "overwriteBrand"; private String overwriteBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOverwriteBrand = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_CITY = "subMerchantCity"; private String subMerchantCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantCity = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_COUNTRY = "subMerchantCountry"; private String subMerchantCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantCountry = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_EMAIL = "subMerchantEmail"; private String subMerchantEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantEmail = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_I_D = "subMerchantID"; private String subMerchantID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantID = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_NAME = "subMerchantName"; private String subMerchantName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantName = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_PHONE_NUMBER = "subMerchantPhoneNumber"; private String subMerchantPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantPhoneNumber = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_POSTAL_CODE = "subMerchantPostalCode"; private String subMerchantPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantPostalCode = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_STATE = "subMerchantState"; private String subMerchantState; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantState = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_STREET = "subMerchantStreet"; private String subMerchantStreet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantStreet = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_TAX_ID = "subMerchantTaxId"; private String subMerchantTaxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataCommon() {} /** @@ -176,6 +247,7 @@ public AdditionalDataCommon() {} public AdditionalDataCommon requestedTestAcquirerResponseCode( String requestedTestAcquirerResponseCode) { this.requestedTestAcquirerResponseCode = requestedTestAcquirerResponseCode; + isSetRequestedTestAcquirerResponseCode = true; // mark as set return this; } @@ -211,6 +283,7 @@ public String getRequestedTestAcquirerResponseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedTestAcquirerResponseCode(String requestedTestAcquirerResponseCode) { this.requestedTestAcquirerResponseCode = requestedTestAcquirerResponseCode; + isSetRequestedTestAcquirerResponseCode = true; // mark as set } /** @@ -243,6 +316,7 @@ public void setRequestedTestAcquirerResponseCode(String requestedTestAcquirerRes public AdditionalDataCommon requestedTestErrorResponseCode( String requestedTestErrorResponseCode) { this.requestedTestErrorResponseCode = requestedTestErrorResponseCode; + isSetRequestedTestErrorResponseCode = true; // mark as set return this; } @@ -308,6 +382,7 @@ public String getRequestedTestErrorResponseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestedTestErrorResponseCode(String requestedTestErrorResponseCode) { this.requestedTestErrorResponseCode = requestedTestErrorResponseCode; + isSetRequestedTestErrorResponseCode = true; // mark as set } /** @@ -325,6 +400,7 @@ public void setRequestedTestErrorResponseCode(String requestedTestErrorResponseC */ public AdditionalDataCommon allowPartialAuth(String allowPartialAuth) { this.allowPartialAuth = allowPartialAuth; + isSetAllowPartialAuth = true; // mark as set return this; } @@ -362,6 +438,7 @@ public String getAllowPartialAuth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowPartialAuth(String allowPartialAuth) { this.allowPartialAuth = allowPartialAuth; + isSetAllowPartialAuth = true; // mark as set } /** @@ -381,6 +458,7 @@ public void setAllowPartialAuth(String allowPartialAuth) { */ public AdditionalDataCommon authorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set return this; } @@ -422,6 +500,7 @@ public String getAuthorisationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationType(String authorisationType) { this.authorisationType = authorisationType; + isSetAuthorisationType = true; // mark as set } /** @@ -435,6 +514,7 @@ public void setAuthorisationType(String authorisationType) { */ public AdditionalDataCommon autoRescue(String autoRescue) { this.autoRescue = autoRescue; + isSetAutoRescue = true; // mark as set return this; } @@ -464,6 +544,7 @@ public String getAutoRescue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAutoRescue(String autoRescue) { this.autoRescue = autoRescue; + isSetAutoRescue = true; // mark as set } /** @@ -483,6 +564,7 @@ public void setAutoRescue(String autoRescue) { */ public AdditionalDataCommon customRoutingFlag(String customRoutingFlag) { this.customRoutingFlag = customRoutingFlag; + isSetCustomRoutingFlag = true; // mark as set return this; } @@ -524,6 +606,7 @@ public String getCustomRoutingFlag() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomRoutingFlag(String customRoutingFlag) { this.customRoutingFlag = customRoutingFlag; + isSetCustomRoutingFlag = true; // mark as set } /** @@ -545,6 +628,7 @@ public void setCustomRoutingFlag(String customRoutingFlag) { */ public AdditionalDataCommon industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -590,6 +674,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -602,6 +687,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public AdditionalDataCommon manualCapture(String manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set return this; } @@ -629,6 +715,7 @@ public String getManualCapture() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManualCapture(String manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set } /** @@ -647,6 +734,7 @@ public void setManualCapture(String manualCapture) { */ public AdditionalDataCommon maxDaysToRescue(String maxDaysToRescue) { this.maxDaysToRescue = maxDaysToRescue; + isSetMaxDaysToRescue = true; // mark as set return this; } @@ -686,6 +774,7 @@ public String getMaxDaysToRescue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxDaysToRescue(String maxDaysToRescue) { this.maxDaysToRescue = maxDaysToRescue; + isSetMaxDaysToRescue = true; // mark as set } /** @@ -712,6 +801,7 @@ public void setMaxDaysToRescue(String maxDaysToRescue) { */ public AdditionalDataCommon networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -767,6 +857,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -783,6 +874,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public AdditionalDataCommon overwriteBrand(String overwriteBrand) { this.overwriteBrand = overwriteBrand; + isSetOverwriteBrand = true; // mark as set return this; } @@ -818,6 +910,7 @@ public String getOverwriteBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOverwriteBrand(String overwriteBrand) { this.overwriteBrand = overwriteBrand; + isSetOverwriteBrand = true; // mark as set } /** @@ -832,6 +925,7 @@ public void setOverwriteBrand(String overwriteBrand) { */ public AdditionalDataCommon subMerchantCity(String subMerchantCity) { this.subMerchantCity = subMerchantCity; + isSetSubMerchantCity = true; // mark as set return this; } @@ -863,6 +957,7 @@ public String getSubMerchantCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantCity(String subMerchantCity) { this.subMerchantCity = subMerchantCity; + isSetSubMerchantCity = true; // mark as set } /** @@ -877,6 +972,7 @@ public void setSubMerchantCity(String subMerchantCity) { */ public AdditionalDataCommon subMerchantCountry(String subMerchantCountry) { this.subMerchantCountry = subMerchantCountry; + isSetSubMerchantCountry = true; // mark as set return this; } @@ -908,6 +1004,7 @@ public String getSubMerchantCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantCountry(String subMerchantCountry) { this.subMerchantCountry = subMerchantCountry; + isSetSubMerchantCountry = true; // mark as set } /** @@ -922,6 +1019,7 @@ public void setSubMerchantCountry(String subMerchantCountry) { */ public AdditionalDataCommon subMerchantEmail(String subMerchantEmail) { this.subMerchantEmail = subMerchantEmail; + isSetSubMerchantEmail = true; // mark as set return this; } @@ -953,6 +1051,7 @@ public String getSubMerchantEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantEmail(String subMerchantEmail) { this.subMerchantEmail = subMerchantEmail; + isSetSubMerchantEmail = true; // mark as set } /** @@ -970,6 +1069,7 @@ public void setSubMerchantEmail(String subMerchantEmail) { */ public AdditionalDataCommon subMerchantID(String subMerchantID) { this.subMerchantID = subMerchantID; + isSetSubMerchantID = true; // mark as set return this; } @@ -1007,6 +1107,7 @@ public String getSubMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantID(String subMerchantID) { this.subMerchantID = subMerchantID; + isSetSubMerchantID = true; // mark as set } /** @@ -1021,6 +1122,7 @@ public void setSubMerchantID(String subMerchantID) { */ public AdditionalDataCommon subMerchantName(String subMerchantName) { this.subMerchantName = subMerchantName; + isSetSubMerchantName = true; // mark as set return this; } @@ -1052,6 +1154,7 @@ public String getSubMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantName(String subMerchantName) { this.subMerchantName = subMerchantName; + isSetSubMerchantName = true; // mark as set } /** @@ -1066,6 +1169,7 @@ public void setSubMerchantName(String subMerchantName) { */ public AdditionalDataCommon subMerchantPhoneNumber(String subMerchantPhoneNumber) { this.subMerchantPhoneNumber = subMerchantPhoneNumber; + isSetSubMerchantPhoneNumber = true; // mark as set return this; } @@ -1097,6 +1201,7 @@ public String getSubMerchantPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantPhoneNumber(String subMerchantPhoneNumber) { this.subMerchantPhoneNumber = subMerchantPhoneNumber; + isSetSubMerchantPhoneNumber = true; // mark as set } /** @@ -1111,6 +1216,7 @@ public void setSubMerchantPhoneNumber(String subMerchantPhoneNumber) { */ public AdditionalDataCommon subMerchantPostalCode(String subMerchantPostalCode) { this.subMerchantPostalCode = subMerchantPostalCode; + isSetSubMerchantPostalCode = true; // mark as set return this; } @@ -1142,6 +1248,7 @@ public String getSubMerchantPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantPostalCode(String subMerchantPostalCode) { this.subMerchantPostalCode = subMerchantPostalCode; + isSetSubMerchantPostalCode = true; // mark as set } /** @@ -1157,6 +1264,7 @@ public void setSubMerchantPostalCode(String subMerchantPostalCode) { */ public AdditionalDataCommon subMerchantState(String subMerchantState) { this.subMerchantState = subMerchantState; + isSetSubMerchantState = true; // mark as set return this; } @@ -1190,6 +1298,7 @@ public String getSubMerchantState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantState(String subMerchantState) { this.subMerchantState = subMerchantState; + isSetSubMerchantState = true; // mark as set } /** @@ -1204,6 +1313,7 @@ public void setSubMerchantState(String subMerchantState) { */ public AdditionalDataCommon subMerchantStreet(String subMerchantStreet) { this.subMerchantStreet = subMerchantStreet; + isSetSubMerchantStreet = true; // mark as set return this; } @@ -1235,6 +1345,7 @@ public String getSubMerchantStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantStreet(String subMerchantStreet) { this.subMerchantStreet = subMerchantStreet; + isSetSubMerchantStreet = true; // mark as set } /** @@ -1249,6 +1360,7 @@ public void setSubMerchantStreet(String subMerchantStreet) { */ public AdditionalDataCommon subMerchantTaxId(String subMerchantTaxId) { this.subMerchantTaxId = subMerchantTaxId; + isSetSubMerchantTaxId = true; // mark as set return this; } @@ -1280,6 +1392,27 @@ public String getSubMerchantTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantTaxId(String subMerchantTaxId) { this.subMerchantTaxId = subMerchantTaxId; + isSetSubMerchantTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataCommon includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataCommon object is equal to o. */ @@ -1295,54 +1428,104 @@ public boolean equals(Object o) { return Objects.equals( this.requestedTestAcquirerResponseCode, additionalDataCommon.requestedTestAcquirerResponseCode) + && Objects.equals( + this.isSetRequestedTestAcquirerResponseCode, + additionalDataCommon.isSetRequestedTestAcquirerResponseCode) && Objects.equals( this.requestedTestErrorResponseCode, additionalDataCommon.requestedTestErrorResponseCode) + && Objects.equals( + this.isSetRequestedTestErrorResponseCode, + additionalDataCommon.isSetRequestedTestErrorResponseCode) && Objects.equals(this.allowPartialAuth, additionalDataCommon.allowPartialAuth) + && Objects.equals(this.isSetAllowPartialAuth, additionalDataCommon.isSetAllowPartialAuth) && Objects.equals(this.authorisationType, additionalDataCommon.authorisationType) + && Objects.equals(this.isSetAuthorisationType, additionalDataCommon.isSetAuthorisationType) && Objects.equals(this.autoRescue, additionalDataCommon.autoRescue) + && Objects.equals(this.isSetAutoRescue, additionalDataCommon.isSetAutoRescue) && Objects.equals(this.customRoutingFlag, additionalDataCommon.customRoutingFlag) + && Objects.equals(this.isSetCustomRoutingFlag, additionalDataCommon.isSetCustomRoutingFlag) && Objects.equals(this.industryUsage, additionalDataCommon.industryUsage) + && Objects.equals(this.isSetIndustryUsage, additionalDataCommon.isSetIndustryUsage) && Objects.equals(this.manualCapture, additionalDataCommon.manualCapture) + && Objects.equals(this.isSetManualCapture, additionalDataCommon.isSetManualCapture) && Objects.equals(this.maxDaysToRescue, additionalDataCommon.maxDaysToRescue) + && Objects.equals(this.isSetMaxDaysToRescue, additionalDataCommon.isSetMaxDaysToRescue) && Objects.equals(this.networkTxReference, additionalDataCommon.networkTxReference) + && Objects.equals( + this.isSetNetworkTxReference, additionalDataCommon.isSetNetworkTxReference) && Objects.equals(this.overwriteBrand, additionalDataCommon.overwriteBrand) + && Objects.equals(this.isSetOverwriteBrand, additionalDataCommon.isSetOverwriteBrand) && Objects.equals(this.subMerchantCity, additionalDataCommon.subMerchantCity) + && Objects.equals(this.isSetSubMerchantCity, additionalDataCommon.isSetSubMerchantCity) && Objects.equals(this.subMerchantCountry, additionalDataCommon.subMerchantCountry) + && Objects.equals( + this.isSetSubMerchantCountry, additionalDataCommon.isSetSubMerchantCountry) && Objects.equals(this.subMerchantEmail, additionalDataCommon.subMerchantEmail) + && Objects.equals(this.isSetSubMerchantEmail, additionalDataCommon.isSetSubMerchantEmail) && Objects.equals(this.subMerchantID, additionalDataCommon.subMerchantID) + && Objects.equals(this.isSetSubMerchantID, additionalDataCommon.isSetSubMerchantID) && Objects.equals(this.subMerchantName, additionalDataCommon.subMerchantName) + && Objects.equals(this.isSetSubMerchantName, additionalDataCommon.isSetSubMerchantName) && Objects.equals(this.subMerchantPhoneNumber, additionalDataCommon.subMerchantPhoneNumber) + && Objects.equals( + this.isSetSubMerchantPhoneNumber, additionalDataCommon.isSetSubMerchantPhoneNumber) && Objects.equals(this.subMerchantPostalCode, additionalDataCommon.subMerchantPostalCode) + && Objects.equals( + this.isSetSubMerchantPostalCode, additionalDataCommon.isSetSubMerchantPostalCode) && Objects.equals(this.subMerchantState, additionalDataCommon.subMerchantState) + && Objects.equals(this.isSetSubMerchantState, additionalDataCommon.isSetSubMerchantState) && Objects.equals(this.subMerchantStreet, additionalDataCommon.subMerchantStreet) - && Objects.equals(this.subMerchantTaxId, additionalDataCommon.subMerchantTaxId); + && Objects.equals(this.isSetSubMerchantStreet, additionalDataCommon.isSetSubMerchantStreet) + && Objects.equals(this.subMerchantTaxId, additionalDataCommon.subMerchantTaxId) + && Objects.equals(this.isSetSubMerchantTaxId, additionalDataCommon.isSetSubMerchantTaxId); } @Override public int hashCode() { return Objects.hash( requestedTestAcquirerResponseCode, + isSetRequestedTestAcquirerResponseCode, requestedTestErrorResponseCode, + isSetRequestedTestErrorResponseCode, allowPartialAuth, + isSetAllowPartialAuth, authorisationType, + isSetAuthorisationType, autoRescue, + isSetAutoRescue, customRoutingFlag, + isSetCustomRoutingFlag, industryUsage, + isSetIndustryUsage, manualCapture, + isSetManualCapture, maxDaysToRescue, + isSetMaxDaysToRescue, networkTxReference, + isSetNetworkTxReference, overwriteBrand, + isSetOverwriteBrand, subMerchantCity, + isSetSubMerchantCity, subMerchantCountry, + isSetSubMerchantCountry, subMerchantEmail, + isSetSubMerchantEmail, subMerchantID, + isSetSubMerchantID, subMerchantName, + isSetSubMerchantName, subMerchantPhoneNumber, + isSetSubMerchantPhoneNumber, subMerchantPostalCode, + isSetSubMerchantPostalCode, subMerchantState, + isSetSubMerchantState, subMerchantStreet, - subMerchantTaxId); + isSetSubMerchantStreet, + subMerchantTaxId, + isSetSubMerchantTaxId); } @Override @@ -1392,6 +1575,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetRequestedTestAcquirerResponseCode) { + addIfNull( + nulls, + JSON_PROPERTY_REQUESTED_TEST_ACQUIRER_RESPONSE_CODE, + this.requestedTestAcquirerResponseCode); + } + if (isSetRequestedTestErrorResponseCode) { + addIfNull( + nulls, + JSON_PROPERTY_REQUESTED_TEST_ERROR_RESPONSE_CODE, + this.requestedTestErrorResponseCode); + } + if (isSetAllowPartialAuth) { + addIfNull(nulls, JSON_PROPERTY_ALLOW_PARTIAL_AUTH, this.allowPartialAuth); + } + if (isSetAuthorisationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TYPE, this.authorisationType); + } + if (isSetAutoRescue) { + addIfNull(nulls, JSON_PROPERTY_AUTO_RESCUE, this.autoRescue); + } + if (isSetCustomRoutingFlag) { + addIfNull(nulls, JSON_PROPERTY_CUSTOM_ROUTING_FLAG, this.customRoutingFlag); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetManualCapture) { + addIfNull(nulls, JSON_PROPERTY_MANUAL_CAPTURE, this.manualCapture); + } + if (isSetMaxDaysToRescue) { + addIfNull(nulls, JSON_PROPERTY_MAX_DAYS_TO_RESCUE, this.maxDaysToRescue); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOverwriteBrand) { + addIfNull(nulls, JSON_PROPERTY_OVERWRITE_BRAND, this.overwriteBrand); + } + if (isSetSubMerchantCity) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_CITY, this.subMerchantCity); + } + if (isSetSubMerchantCountry) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_COUNTRY, this.subMerchantCountry); + } + if (isSetSubMerchantEmail) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_EMAIL, this.subMerchantEmail); + } + if (isSetSubMerchantID) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_I_D, this.subMerchantID); + } + if (isSetSubMerchantName) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_NAME, this.subMerchantName); + } + if (isSetSubMerchantPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_PHONE_NUMBER, this.subMerchantPhoneNumber); + } + if (isSetSubMerchantPostalCode) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_POSTAL_CODE, this.subMerchantPostalCode); + } + if (isSetSubMerchantState) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_STATE, this.subMerchantState); + } + if (isSetSubMerchantStreet) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_STREET, this.subMerchantStreet); + } + if (isSetSubMerchantTaxId) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_TAX_ID, this.subMerchantTaxId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataCommon given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java index 12c5a5ef1..2128c6f13 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLevel23.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,77 +44,134 @@ public class AdditionalDataLevel23 { "enhancedSchemeData.customerReference"; private String enhancedSchemeDataCustomerReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataCustomerReference = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_COUNTRY_CODE = "enhancedSchemeData.destinationCountryCode"; private String enhancedSchemeDataDestinationCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDestinationCountryCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_POSTAL_CODE = "enhancedSchemeData.destinationPostalCode"; private String enhancedSchemeDataDestinationPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDestinationPostalCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_STATE_PROVINCE_CODE = "enhancedSchemeData.destinationStateProvinceCode"; private String enhancedSchemeDataDestinationStateProvinceCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDestinationStateProvinceCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_DUTY_AMOUNT = "enhancedSchemeData.dutyAmount"; private String enhancedSchemeDataDutyAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataDutyAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_FREIGHT_AMOUNT = "enhancedSchemeData.freightAmount"; private String enhancedSchemeDataFreightAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataFreightAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_COMMODITY_CODE = "enhancedSchemeData.itemDetailLine[itemNr].commodityCode"; private String enhancedSchemeDataItemDetailLineItemNrCommodityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DESCRIPTION = "enhancedSchemeData.itemDetailLine[itemNr].description"; private String enhancedSchemeDataItemDetailLineItemNrDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrDescription = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DISCOUNT_AMOUNT = "enhancedSchemeData.itemDetailLine[itemNr].discountAmount"; private String enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_PRODUCT_CODE = "enhancedSchemeData.itemDetailLine[itemNr].productCode"; private String enhancedSchemeDataItemDetailLineItemNrProductCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrProductCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_QUANTITY = "enhancedSchemeData.itemDetailLine[itemNr].quantity"; private String enhancedSchemeDataItemDetailLineItemNrQuantity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrQuantity = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_TOTAL_AMOUNT = "enhancedSchemeData.itemDetailLine[itemNr].totalAmount"; private String enhancedSchemeDataItemDetailLineItemNrTotalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_OF_MEASURE = "enhancedSchemeData.itemDetailLine[itemNr].unitOfMeasure"; private String enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_PRICE = "enhancedSchemeData.itemDetailLine[itemNr].unitPrice"; private String enhancedSchemeDataItemDetailLineItemNrUnitPrice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_ORDER_DATE = "enhancedSchemeData.orderDate"; private String enhancedSchemeDataOrderDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataOrderDate = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_SHIP_FROM_POSTAL_CODE = "enhancedSchemeData.shipFromPostalCode"; private String enhancedSchemeDataShipFromPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataShipFromPostalCode = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT = "enhancedSchemeData.totalTaxAmount"; private String enhancedSchemeDataTotalTaxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTotalTaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataLevel23() {} /** @@ -127,6 +186,7 @@ public AdditionalDataLevel23() {} public AdditionalDataLevel23 enhancedSchemeDataCustomerReference( String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set return this; } @@ -156,6 +216,7 @@ public String getEnhancedSchemeDataCustomerReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set } /** @@ -171,6 +232,7 @@ public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCust public AdditionalDataLevel23 enhancedSchemeDataDestinationCountryCode( String enhancedSchemeDataDestinationCountryCode) { this.enhancedSchemeDataDestinationCountryCode = enhancedSchemeDataDestinationCountryCode; + isSetEnhancedSchemeDataDestinationCountryCode = true; // mark as set return this; } @@ -203,6 +265,7 @@ public String getEnhancedSchemeDataDestinationCountryCode() { public void setEnhancedSchemeDataDestinationCountryCode( String enhancedSchemeDataDestinationCountryCode) { this.enhancedSchemeDataDestinationCountryCode = enhancedSchemeDataDestinationCountryCode; + isSetEnhancedSchemeDataDestinationCountryCode = true; // mark as set } /** @@ -220,6 +283,7 @@ public void setEnhancedSchemeDataDestinationCountryCode( public AdditionalDataLevel23 enhancedSchemeDataDestinationPostalCode( String enhancedSchemeDataDestinationPostalCode) { this.enhancedSchemeDataDestinationPostalCode = enhancedSchemeDataDestinationPostalCode; + isSetEnhancedSchemeDataDestinationPostalCode = true; // mark as set return this; } @@ -256,6 +320,7 @@ public String getEnhancedSchemeDataDestinationPostalCode() { public void setEnhancedSchemeDataDestinationPostalCode( String enhancedSchemeDataDestinationPostalCode) { this.enhancedSchemeDataDestinationPostalCode = enhancedSchemeDataDestinationPostalCode; + isSetEnhancedSchemeDataDestinationPostalCode = true; // mark as set } /** @@ -271,6 +336,7 @@ public AdditionalDataLevel23 enhancedSchemeDataDestinationStateProvinceCode( String enhancedSchemeDataDestinationStateProvinceCode) { this.enhancedSchemeDataDestinationStateProvinceCode = enhancedSchemeDataDestinationStateProvinceCode; + isSetEnhancedSchemeDataDestinationStateProvinceCode = true; // mark as set return this; } @@ -302,6 +368,7 @@ public void setEnhancedSchemeDataDestinationStateProvinceCode( String enhancedSchemeDataDestinationStateProvinceCode) { this.enhancedSchemeDataDestinationStateProvinceCode = enhancedSchemeDataDestinationStateProvinceCode; + isSetEnhancedSchemeDataDestinationStateProvinceCode = true; // mark as set } /** @@ -316,6 +383,7 @@ public void setEnhancedSchemeDataDestinationStateProvinceCode( */ public AdditionalDataLevel23 enhancedSchemeDataDutyAmount(String enhancedSchemeDataDutyAmount) { this.enhancedSchemeDataDutyAmount = enhancedSchemeDataDutyAmount; + isSetEnhancedSchemeDataDutyAmount = true; // mark as set return this; } @@ -347,6 +415,7 @@ public String getEnhancedSchemeDataDutyAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataDutyAmount(String enhancedSchemeDataDutyAmount) { this.enhancedSchemeDataDutyAmount = enhancedSchemeDataDutyAmount; + isSetEnhancedSchemeDataDutyAmount = true; // mark as set } /** @@ -362,6 +431,7 @@ public void setEnhancedSchemeDataDutyAmount(String enhancedSchemeDataDutyAmount) public AdditionalDataLevel23 enhancedSchemeDataFreightAmount( String enhancedSchemeDataFreightAmount) { this.enhancedSchemeDataFreightAmount = enhancedSchemeDataFreightAmount; + isSetEnhancedSchemeDataFreightAmount = true; // mark as set return this; } @@ -393,6 +463,7 @@ public String getEnhancedSchemeDataFreightAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataFreightAmount(String enhancedSchemeDataFreightAmount) { this.enhancedSchemeDataFreightAmount = enhancedSchemeDataFreightAmount; + isSetEnhancedSchemeDataFreightAmount = true; // mark as set } /** @@ -417,6 +488,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrCommodityCode String enhancedSchemeDataItemDetailLineItemNrCommodityCode) { this.enhancedSchemeDataItemDetailLineItemNrCommodityCode = enhancedSchemeDataItemDetailLineItemNrCommodityCode; + isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode = true; // mark as set return this; } @@ -466,6 +538,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrCommodityCode( String enhancedSchemeDataItemDetailLineItemNrCommodityCode) { this.enhancedSchemeDataItemDetailLineItemNrCommodityCode = enhancedSchemeDataItemDetailLineItemNrCommodityCode; + isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode = true; // mark as set } /** @@ -489,6 +562,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrDescription( String enhancedSchemeDataItemDetailLineItemNrDescription) { this.enhancedSchemeDataItemDetailLineItemNrDescription = enhancedSchemeDataItemDetailLineItemNrDescription; + isSetEnhancedSchemeDataItemDetailLineItemNrDescription = true; // mark as set return this; } @@ -536,6 +610,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrDescription( String enhancedSchemeDataItemDetailLineItemNrDescription) { this.enhancedSchemeDataItemDetailLineItemNrDescription = enhancedSchemeDataItemDetailLineItemNrDescription; + isSetEnhancedSchemeDataItemDetailLineItemNrDescription = true; // mark as set } /** @@ -552,6 +627,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrDiscountAmoun String enhancedSchemeDataItemDetailLineItemNrDiscountAmount) { this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount = true; // mark as set return this; } @@ -585,6 +661,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrDiscountAmount( String enhancedSchemeDataItemDetailLineItemNrDiscountAmount) { this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount = enhancedSchemeDataItemDetailLineItemNrDiscountAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount = true; // mark as set } /** @@ -603,6 +680,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrProductCode( String enhancedSchemeDataItemDetailLineItemNrProductCode) { this.enhancedSchemeDataItemDetailLineItemNrProductCode = enhancedSchemeDataItemDetailLineItemNrProductCode; + isSetEnhancedSchemeDataItemDetailLineItemNrProductCode = true; // mark as set return this; } @@ -640,6 +718,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrProductCode( String enhancedSchemeDataItemDetailLineItemNrProductCode) { this.enhancedSchemeDataItemDetailLineItemNrProductCode = enhancedSchemeDataItemDetailLineItemNrProductCode; + isSetEnhancedSchemeDataItemDetailLineItemNrProductCode = true; // mark as set } /** @@ -655,6 +734,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrQuantity( String enhancedSchemeDataItemDetailLineItemNrQuantity) { this.enhancedSchemeDataItemDetailLineItemNrQuantity = enhancedSchemeDataItemDetailLineItemNrQuantity; + isSetEnhancedSchemeDataItemDetailLineItemNrQuantity = true; // mark as set return this; } @@ -686,6 +766,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrQuantity( String enhancedSchemeDataItemDetailLineItemNrQuantity) { this.enhancedSchemeDataItemDetailLineItemNrQuantity = enhancedSchemeDataItemDetailLineItemNrQuantity; + isSetEnhancedSchemeDataItemDetailLineItemNrQuantity = true; // mark as set } /** @@ -710,6 +791,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrTotalAmount( String enhancedSchemeDataItemDetailLineItemNrTotalAmount) { this.enhancedSchemeDataItemDetailLineItemNrTotalAmount = enhancedSchemeDataItemDetailLineItemNrTotalAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount = true; // mark as set return this; } @@ -759,6 +841,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrTotalAmount( String enhancedSchemeDataItemDetailLineItemNrTotalAmount) { this.enhancedSchemeDataItemDetailLineItemNrTotalAmount = enhancedSchemeDataItemDetailLineItemNrTotalAmount; + isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount = true; // mark as set } /** @@ -774,6 +857,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure String enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) { this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = true; // mark as set return this; } @@ -805,6 +889,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure( String enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) { this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure = true; // mark as set } /** @@ -821,6 +906,7 @@ public AdditionalDataLevel23 enhancedSchemeDataItemDetailLineItemNrUnitPrice( String enhancedSchemeDataItemDetailLineItemNrUnitPrice) { this.enhancedSchemeDataItemDetailLineItemNrUnitPrice = enhancedSchemeDataItemDetailLineItemNrUnitPrice; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice = true; // mark as set return this; } @@ -854,6 +940,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrUnitPrice( String enhancedSchemeDataItemDetailLineItemNrUnitPrice) { this.enhancedSchemeDataItemDetailLineItemNrUnitPrice = enhancedSchemeDataItemDetailLineItemNrUnitPrice; + isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice = true; // mark as set } /** @@ -865,6 +952,7 @@ public void setEnhancedSchemeDataItemDetailLineItemNrUnitPrice( */ public AdditionalDataLevel23 enhancedSchemeDataOrderDate(String enhancedSchemeDataOrderDate) { this.enhancedSchemeDataOrderDate = enhancedSchemeDataOrderDate; + isSetEnhancedSchemeDataOrderDate = true; // mark as set return this; } @@ -890,6 +978,7 @@ public String getEnhancedSchemeDataOrderDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataOrderDate(String enhancedSchemeDataOrderDate) { this.enhancedSchemeDataOrderDate = enhancedSchemeDataOrderDate; + isSetEnhancedSchemeDataOrderDate = true; // mark as set } /** @@ -908,6 +997,7 @@ public void setEnhancedSchemeDataOrderDate(String enhancedSchemeDataOrderDate) { public AdditionalDataLevel23 enhancedSchemeDataShipFromPostalCode( String enhancedSchemeDataShipFromPostalCode) { this.enhancedSchemeDataShipFromPostalCode = enhancedSchemeDataShipFromPostalCode; + isSetEnhancedSchemeDataShipFromPostalCode = true; // mark as set return this; } @@ -945,6 +1035,7 @@ public String getEnhancedSchemeDataShipFromPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataShipFromPostalCode(String enhancedSchemeDataShipFromPostalCode) { this.enhancedSchemeDataShipFromPostalCode = enhancedSchemeDataShipFromPostalCode; + isSetEnhancedSchemeDataShipFromPostalCode = true; // mark as set } /** @@ -965,6 +1056,7 @@ public void setEnhancedSchemeDataShipFromPostalCode(String enhancedSchemeDataShi public AdditionalDataLevel23 enhancedSchemeDataTotalTaxAmount( String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set return this; } @@ -1006,6 +1098,27 @@ public String getEnhancedSchemeDataTotalTaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTotalTaxAmount(String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataLevel23 includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataLevel23 object is equal to o. */ @@ -1021,74 +1134,142 @@ public boolean equals(Object o) { return Objects.equals( this.enhancedSchemeDataCustomerReference, additionalDataLevel23.enhancedSchemeDataCustomerReference) + && Objects.equals( + this.isSetEnhancedSchemeDataCustomerReference, + additionalDataLevel23.isSetEnhancedSchemeDataCustomerReference) && Objects.equals( this.enhancedSchemeDataDestinationCountryCode, additionalDataLevel23.enhancedSchemeDataDestinationCountryCode) + && Objects.equals( + this.isSetEnhancedSchemeDataDestinationCountryCode, + additionalDataLevel23.isSetEnhancedSchemeDataDestinationCountryCode) && Objects.equals( this.enhancedSchemeDataDestinationPostalCode, additionalDataLevel23.enhancedSchemeDataDestinationPostalCode) + && Objects.equals( + this.isSetEnhancedSchemeDataDestinationPostalCode, + additionalDataLevel23.isSetEnhancedSchemeDataDestinationPostalCode) && Objects.equals( this.enhancedSchemeDataDestinationStateProvinceCode, additionalDataLevel23.enhancedSchemeDataDestinationStateProvinceCode) + && Objects.equals( + this.isSetEnhancedSchemeDataDestinationStateProvinceCode, + additionalDataLevel23.isSetEnhancedSchemeDataDestinationStateProvinceCode) && Objects.equals( this.enhancedSchemeDataDutyAmount, additionalDataLevel23.enhancedSchemeDataDutyAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataDutyAmount, + additionalDataLevel23.isSetEnhancedSchemeDataDutyAmount) && Objects.equals( this.enhancedSchemeDataFreightAmount, additionalDataLevel23.enhancedSchemeDataFreightAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataFreightAmount, + additionalDataLevel23.isSetEnhancedSchemeDataFreightAmount) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrCommodityCode, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrCommodityCode) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrDescription, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrDescription) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrDescription, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrDescription) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrDiscountAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrProductCode, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrProductCode) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrProductCode, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrProductCode) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrQuantity, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrQuantity) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrQuantity, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrQuantity) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrTotalAmount, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrTotalAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) && Objects.equals( this.enhancedSchemeDataItemDetailLineItemNrUnitPrice, additionalDataLevel23.enhancedSchemeDataItemDetailLineItemNrUnitPrice) + && Objects.equals( + this.isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice, + additionalDataLevel23.isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice) && Objects.equals( this.enhancedSchemeDataOrderDate, additionalDataLevel23.enhancedSchemeDataOrderDate) + && Objects.equals( + this.isSetEnhancedSchemeDataOrderDate, + additionalDataLevel23.isSetEnhancedSchemeDataOrderDate) && Objects.equals( this.enhancedSchemeDataShipFromPostalCode, additionalDataLevel23.enhancedSchemeDataShipFromPostalCode) + && Objects.equals( + this.isSetEnhancedSchemeDataShipFromPostalCode, + additionalDataLevel23.isSetEnhancedSchemeDataShipFromPostalCode) && Objects.equals( this.enhancedSchemeDataTotalTaxAmount, - additionalDataLevel23.enhancedSchemeDataTotalTaxAmount); + additionalDataLevel23.enhancedSchemeDataTotalTaxAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataTotalTaxAmount, + additionalDataLevel23.isSetEnhancedSchemeDataTotalTaxAmount); } @Override public int hashCode() { return Objects.hash( enhancedSchemeDataCustomerReference, + isSetEnhancedSchemeDataCustomerReference, enhancedSchemeDataDestinationCountryCode, + isSetEnhancedSchemeDataDestinationCountryCode, enhancedSchemeDataDestinationPostalCode, + isSetEnhancedSchemeDataDestinationPostalCode, enhancedSchemeDataDestinationStateProvinceCode, + isSetEnhancedSchemeDataDestinationStateProvinceCode, enhancedSchemeDataDutyAmount, + isSetEnhancedSchemeDataDutyAmount, enhancedSchemeDataFreightAmount, + isSetEnhancedSchemeDataFreightAmount, enhancedSchemeDataItemDetailLineItemNrCommodityCode, + isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode, enhancedSchemeDataItemDetailLineItemNrDescription, + isSetEnhancedSchemeDataItemDetailLineItemNrDescription, enhancedSchemeDataItemDetailLineItemNrDiscountAmount, + isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount, enhancedSchemeDataItemDetailLineItemNrProductCode, + isSetEnhancedSchemeDataItemDetailLineItemNrProductCode, enhancedSchemeDataItemDetailLineItemNrQuantity, + isSetEnhancedSchemeDataItemDetailLineItemNrQuantity, enhancedSchemeDataItemDetailLineItemNrTotalAmount, + isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount, enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, + isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure, enhancedSchemeDataItemDetailLineItemNrUnitPrice, + isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice, enhancedSchemeDataOrderDate, + isSetEnhancedSchemeDataOrderDate, enhancedSchemeDataShipFromPostalCode, - enhancedSchemeDataTotalTaxAmount); + isSetEnhancedSchemeDataShipFromPostalCode, + enhancedSchemeDataTotalTaxAmount, + isSetEnhancedSchemeDataTotalTaxAmount); } @Override @@ -1160,6 +1341,125 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEnhancedSchemeDataCustomerReference) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_CUSTOMER_REFERENCE, + this.enhancedSchemeDataCustomerReference); + } + if (isSetEnhancedSchemeDataDestinationCountryCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_COUNTRY_CODE, + this.enhancedSchemeDataDestinationCountryCode); + } + if (isSetEnhancedSchemeDataDestinationPostalCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_POSTAL_CODE, + this.enhancedSchemeDataDestinationPostalCode); + } + if (isSetEnhancedSchemeDataDestinationStateProvinceCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_DESTINATION_STATE_PROVINCE_CODE, + this.enhancedSchemeDataDestinationStateProvinceCode); + } + if (isSetEnhancedSchemeDataDutyAmount) { + addIfNull( + nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA_DUTY_AMOUNT, this.enhancedSchemeDataDutyAmount); + } + if (isSetEnhancedSchemeDataFreightAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_FREIGHT_AMOUNT, + this.enhancedSchemeDataFreightAmount); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrCommodityCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_COMMODITY_CODE, + this.enhancedSchemeDataItemDetailLineItemNrCommodityCode); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrDescription) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DESCRIPTION, + this.enhancedSchemeDataItemDetailLineItemNrDescription); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrDiscountAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_DISCOUNT_AMOUNT, + this.enhancedSchemeDataItemDetailLineItemNrDiscountAmount); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrProductCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_PRODUCT_CODE, + this.enhancedSchemeDataItemDetailLineItemNrProductCode); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrQuantity) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_QUANTITY, + this.enhancedSchemeDataItemDetailLineItemNrQuantity); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrTotalAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_TOTAL_AMOUNT, + this.enhancedSchemeDataItemDetailLineItemNrTotalAmount); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrUnitOfMeasure) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_OF_MEASURE, + this.enhancedSchemeDataItemDetailLineItemNrUnitOfMeasure); + } + if (isSetEnhancedSchemeDataItemDetailLineItemNrUnitPrice) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_ITEM_DETAIL_LINE_ITEM_NR_UNIT_PRICE, + this.enhancedSchemeDataItemDetailLineItemNrUnitPrice); + } + if (isSetEnhancedSchemeDataOrderDate) { + addIfNull( + nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA_ORDER_DATE, this.enhancedSchemeDataOrderDate); + } + if (isSetEnhancedSchemeDataShipFromPostalCode) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_SHIP_FROM_POSTAL_CODE, + this.enhancedSchemeDataShipFromPostalCode); + } + if (isSetEnhancedSchemeDataTotalTaxAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT, + this.enhancedSchemeDataTotalTaxAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataLevel23 given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java index 66f480469..2914640eb 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataLodging.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,62 +44,119 @@ public class AdditionalDataLodging { "lodging.SpecialProgramCode"; private String lodgingSpecialProgramCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingSpecialProgramCode = false; + public static final String JSON_PROPERTY_LODGING_CHECK_IN_DATE = "lodging.checkInDate"; private String lodgingCheckInDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingCheckInDate = false; + public static final String JSON_PROPERTY_LODGING_CHECK_OUT_DATE = "lodging.checkOutDate"; private String lodgingCheckOutDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingCheckOutDate = false; + public static final String JSON_PROPERTY_LODGING_CUSTOMER_SERVICE_TOLL_FREE_NUMBER = "lodging.customerServiceTollFreeNumber"; private String lodgingCustomerServiceTollFreeNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingCustomerServiceTollFreeNumber = false; + public static final String JSON_PROPERTY_LODGING_FIRE_SAFETY_ACT_INDICATOR = "lodging.fireSafetyActIndicator"; private String lodgingFireSafetyActIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFireSafetyActIndicator = false; + public static final String JSON_PROPERTY_LODGING_FOLIO_CASH_ADVANCES = "lodging.folioCashAdvances"; private String lodgingFolioCashAdvances; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFolioCashAdvances = false; + public static final String JSON_PROPERTY_LODGING_FOLIO_NUMBER = "lodging.folioNumber"; private String lodgingFolioNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFolioNumber = false; + public static final String JSON_PROPERTY_LODGING_FOOD_BEVERAGE_CHARGES = "lodging.foodBeverageCharges"; private String lodgingFoodBeverageCharges; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingFoodBeverageCharges = false; + public static final String JSON_PROPERTY_LODGING_NO_SHOW_INDICATOR = "lodging.noShowIndicator"; private String lodgingNoShowIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingNoShowIndicator = false; + public static final String JSON_PROPERTY_LODGING_PREPAID_EXPENSES = "lodging.prepaidExpenses"; private String lodgingPrepaidExpenses; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingPrepaidExpenses = false; + public static final String JSON_PROPERTY_LODGING_PROPERTY_PHONE_NUMBER = "lodging.propertyPhoneNumber"; private String lodgingPropertyPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingPropertyPhoneNumber = false; + public static final String JSON_PROPERTY_LODGING_ROOM1_NUMBER_OF_NIGHTS = "lodging.room1.numberOfNights"; private String lodgingRoom1NumberOfNights; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingRoom1NumberOfNights = false; + public static final String JSON_PROPERTY_LODGING_ROOM1_RATE = "lodging.room1.rate"; private String lodgingRoom1Rate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingRoom1Rate = false; + public static final String JSON_PROPERTY_LODGING_TOTAL_ROOM_TAX = "lodging.totalRoomTax"; private String lodgingTotalRoomTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingTotalRoomTax = false; + public static final String JSON_PROPERTY_LODGING_TOTAL_TAX = "lodging.totalTax"; private String lodgingTotalTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLodgingTotalTax = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION = "travelEntertainmentAuthData.duration"; private String travelEntertainmentAuthDataDuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataDuration = false; + public static final String JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET = "travelEntertainmentAuthData.market"; private String travelEntertainmentAuthDataMarket; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelEntertainmentAuthDataMarket = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataLodging() {} /** @@ -110,6 +169,7 @@ public AdditionalDataLodging() {} */ public AdditionalDataLodging lodgingSpecialProgramCode(String lodgingSpecialProgramCode) { this.lodgingSpecialProgramCode = lodgingSpecialProgramCode; + isSetLodgingSpecialProgramCode = true; // mark as set return this; } @@ -138,6 +198,7 @@ public String getLodgingSpecialProgramCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingSpecialProgramCode(String lodgingSpecialProgramCode) { this.lodgingSpecialProgramCode = lodgingSpecialProgramCode; + isSetLodgingSpecialProgramCode = true; // mark as set } /** @@ -149,6 +210,7 @@ public void setLodgingSpecialProgramCode(String lodgingSpecialProgramCode) { */ public AdditionalDataLodging lodgingCheckInDate(String lodgingCheckInDate) { this.lodgingCheckInDate = lodgingCheckInDate; + isSetLodgingCheckInDate = true; // mark as set return this; } @@ -174,6 +236,7 @@ public String getLodgingCheckInDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingCheckInDate(String lodgingCheckInDate) { this.lodgingCheckInDate = lodgingCheckInDate; + isSetLodgingCheckInDate = true; // mark as set } /** @@ -185,6 +248,7 @@ public void setLodgingCheckInDate(String lodgingCheckInDate) { */ public AdditionalDataLodging lodgingCheckOutDate(String lodgingCheckOutDate) { this.lodgingCheckOutDate = lodgingCheckOutDate; + isSetLodgingCheckOutDate = true; // mark as set return this; } @@ -210,6 +274,7 @@ public String getLodgingCheckOutDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingCheckOutDate(String lodgingCheckOutDate) { this.lodgingCheckOutDate = lodgingCheckOutDate; + isSetLodgingCheckOutDate = true; // mark as set } /** @@ -226,6 +291,7 @@ public void setLodgingCheckOutDate(String lodgingCheckOutDate) { public AdditionalDataLodging lodgingCustomerServiceTollFreeNumber( String lodgingCustomerServiceTollFreeNumber) { this.lodgingCustomerServiceTollFreeNumber = lodgingCustomerServiceTollFreeNumber; + isSetLodgingCustomerServiceTollFreeNumber = true; // mark as set return this; } @@ -259,6 +325,7 @@ public String getLodgingCustomerServiceTollFreeNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingCustomerServiceTollFreeNumber(String lodgingCustomerServiceTollFreeNumber) { this.lodgingCustomerServiceTollFreeNumber = lodgingCustomerServiceTollFreeNumber; + isSetLodgingCustomerServiceTollFreeNumber = true; // mark as set } /** @@ -272,6 +339,7 @@ public void setLodgingCustomerServiceTollFreeNumber(String lodgingCustomerServic */ public AdditionalDataLodging lodgingFireSafetyActIndicator(String lodgingFireSafetyActIndicator) { this.lodgingFireSafetyActIndicator = lodgingFireSafetyActIndicator; + isSetLodgingFireSafetyActIndicator = true; // mark as set return this; } @@ -301,6 +369,7 @@ public String getLodgingFireSafetyActIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFireSafetyActIndicator(String lodgingFireSafetyActIndicator) { this.lodgingFireSafetyActIndicator = lodgingFireSafetyActIndicator; + isSetLodgingFireSafetyActIndicator = true; // mark as set } /** @@ -315,6 +384,7 @@ public void setLodgingFireSafetyActIndicator(String lodgingFireSafetyActIndicato */ public AdditionalDataLodging lodgingFolioCashAdvances(String lodgingFolioCashAdvances) { this.lodgingFolioCashAdvances = lodgingFolioCashAdvances; + isSetLodgingFolioCashAdvances = true; // mark as set return this; } @@ -346,6 +416,7 @@ public String getLodgingFolioCashAdvances() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFolioCashAdvances(String lodgingFolioCashAdvances) { this.lodgingFolioCashAdvances = lodgingFolioCashAdvances; + isSetLodgingFolioCashAdvances = true; // mark as set } /** @@ -360,6 +431,7 @@ public void setLodgingFolioCashAdvances(String lodgingFolioCashAdvances) { */ public AdditionalDataLodging lodgingFolioNumber(String lodgingFolioNumber) { this.lodgingFolioNumber = lodgingFolioNumber; + isSetLodgingFolioNumber = true; // mark as set return this; } @@ -391,6 +463,7 @@ public String getLodgingFolioNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFolioNumber(String lodgingFolioNumber) { this.lodgingFolioNumber = lodgingFolioNumber; + isSetLodgingFolioNumber = true; // mark as set } /** @@ -405,6 +478,7 @@ public void setLodgingFolioNumber(String lodgingFolioNumber) { */ public AdditionalDataLodging lodgingFoodBeverageCharges(String lodgingFoodBeverageCharges) { this.lodgingFoodBeverageCharges = lodgingFoodBeverageCharges; + isSetLodgingFoodBeverageCharges = true; // mark as set return this; } @@ -436,6 +510,7 @@ public String getLodgingFoodBeverageCharges() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingFoodBeverageCharges(String lodgingFoodBeverageCharges) { this.lodgingFoodBeverageCharges = lodgingFoodBeverageCharges; + isSetLodgingFoodBeverageCharges = true; // mark as set } /** @@ -448,6 +523,7 @@ public void setLodgingFoodBeverageCharges(String lodgingFoodBeverageCharges) { */ public AdditionalDataLodging lodgingNoShowIndicator(String lodgingNoShowIndicator) { this.lodgingNoShowIndicator = lodgingNoShowIndicator; + isSetLodgingNoShowIndicator = true; // mark as set return this; } @@ -475,6 +551,7 @@ public String getLodgingNoShowIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingNoShowIndicator(String lodgingNoShowIndicator) { this.lodgingNoShowIndicator = lodgingNoShowIndicator; + isSetLodgingNoShowIndicator = true; // mark as set } /** @@ -486,6 +563,7 @@ public void setLodgingNoShowIndicator(String lodgingNoShowIndicator) { */ public AdditionalDataLodging lodgingPrepaidExpenses(String lodgingPrepaidExpenses) { this.lodgingPrepaidExpenses = lodgingPrepaidExpenses; + isSetLodgingPrepaidExpenses = true; // mark as set return this; } @@ -511,6 +589,7 @@ public String getLodgingPrepaidExpenses() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingPrepaidExpenses(String lodgingPrepaidExpenses) { this.lodgingPrepaidExpenses = lodgingPrepaidExpenses; + isSetLodgingPrepaidExpenses = true; // mark as set } /** @@ -527,6 +606,7 @@ public void setLodgingPrepaidExpenses(String lodgingPrepaidExpenses) { */ public AdditionalDataLodging lodgingPropertyPhoneNumber(String lodgingPropertyPhoneNumber) { this.lodgingPropertyPhoneNumber = lodgingPropertyPhoneNumber; + isSetLodgingPropertyPhoneNumber = true; // mark as set return this; } @@ -562,6 +642,7 @@ public String getLodgingPropertyPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingPropertyPhoneNumber(String lodgingPropertyPhoneNumber) { this.lodgingPropertyPhoneNumber = lodgingPropertyPhoneNumber; + isSetLodgingPropertyPhoneNumber = true; // mark as set } /** @@ -574,6 +655,7 @@ public void setLodgingPropertyPhoneNumber(String lodgingPropertyPhoneNumber) { */ public AdditionalDataLodging lodgingRoom1NumberOfNights(String lodgingRoom1NumberOfNights) { this.lodgingRoom1NumberOfNights = lodgingRoom1NumberOfNights; + isSetLodgingRoom1NumberOfNights = true; // mark as set return this; } @@ -601,6 +683,7 @@ public String getLodgingRoom1NumberOfNights() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingRoom1NumberOfNights(String lodgingRoom1NumberOfNights) { this.lodgingRoom1NumberOfNights = lodgingRoom1NumberOfNights; + isSetLodgingRoom1NumberOfNights = true; // mark as set } /** @@ -615,6 +698,7 @@ public void setLodgingRoom1NumberOfNights(String lodgingRoom1NumberOfNights) { */ public AdditionalDataLodging lodgingRoom1Rate(String lodgingRoom1Rate) { this.lodgingRoom1Rate = lodgingRoom1Rate; + isSetLodgingRoom1Rate = true; // mark as set return this; } @@ -646,6 +730,7 @@ public String getLodgingRoom1Rate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingRoom1Rate(String lodgingRoom1Rate) { this.lodgingRoom1Rate = lodgingRoom1Rate; + isSetLodgingRoom1Rate = true; // mark as set } /** @@ -660,6 +745,7 @@ public void setLodgingRoom1Rate(String lodgingRoom1Rate) { */ public AdditionalDataLodging lodgingTotalRoomTax(String lodgingTotalRoomTax) { this.lodgingTotalRoomTax = lodgingTotalRoomTax; + isSetLodgingTotalRoomTax = true; // mark as set return this; } @@ -691,6 +777,7 @@ public String getLodgingTotalRoomTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingTotalRoomTax(String lodgingTotalRoomTax) { this.lodgingTotalRoomTax = lodgingTotalRoomTax; + isSetLodgingTotalRoomTax = true; // mark as set } /** @@ -705,6 +792,7 @@ public void setLodgingTotalRoomTax(String lodgingTotalRoomTax) { */ public AdditionalDataLodging lodgingTotalTax(String lodgingTotalTax) { this.lodgingTotalTax = lodgingTotalTax; + isSetLodgingTotalTax = true; // mark as set return this; } @@ -736,6 +824,7 @@ public String getLodgingTotalTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLodgingTotalTax(String lodgingTotalTax) { this.lodgingTotalTax = lodgingTotalTax; + isSetLodgingTotalTax = true; // mark as set } /** @@ -749,6 +838,7 @@ public void setLodgingTotalTax(String lodgingTotalTax) { public AdditionalDataLodging travelEntertainmentAuthDataDuration( String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set return this; } @@ -776,6 +866,7 @@ public String getTravelEntertainmentAuthDataDuration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAuthDataDuration) { this.travelEntertainmentAuthDataDuration = travelEntertainmentAuthDataDuration; + isSetTravelEntertainmentAuthDataDuration = true; // mark as set } /** @@ -790,6 +881,7 @@ public void setTravelEntertainmentAuthDataDuration(String travelEntertainmentAut public AdditionalDataLodging travelEntertainmentAuthDataMarket( String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set return this; } @@ -819,6 +911,27 @@ public String getTravelEntertainmentAuthDataMarket() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelEntertainmentAuthDataMarket(String travelEntertainmentAuthDataMarket) { this.travelEntertainmentAuthDataMarket = travelEntertainmentAuthDataMarket; + isSetTravelEntertainmentAuthDataMarket = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataLodging includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataLodging object is equal to o. */ @@ -833,55 +946,112 @@ public boolean equals(Object o) { AdditionalDataLodging additionalDataLodging = (AdditionalDataLodging) o; return Objects.equals( this.lodgingSpecialProgramCode, additionalDataLodging.lodgingSpecialProgramCode) + && Objects.equals( + this.isSetLodgingSpecialProgramCode, + additionalDataLodging.isSetLodgingSpecialProgramCode) && Objects.equals(this.lodgingCheckInDate, additionalDataLodging.lodgingCheckInDate) + && Objects.equals( + this.isSetLodgingCheckInDate, additionalDataLodging.isSetLodgingCheckInDate) && Objects.equals(this.lodgingCheckOutDate, additionalDataLodging.lodgingCheckOutDate) + && Objects.equals( + this.isSetLodgingCheckOutDate, additionalDataLodging.isSetLodgingCheckOutDate) && Objects.equals( this.lodgingCustomerServiceTollFreeNumber, additionalDataLodging.lodgingCustomerServiceTollFreeNumber) + && Objects.equals( + this.isSetLodgingCustomerServiceTollFreeNumber, + additionalDataLodging.isSetLodgingCustomerServiceTollFreeNumber) && Objects.equals( this.lodgingFireSafetyActIndicator, additionalDataLodging.lodgingFireSafetyActIndicator) + && Objects.equals( + this.isSetLodgingFireSafetyActIndicator, + additionalDataLodging.isSetLodgingFireSafetyActIndicator) && Objects.equals( this.lodgingFolioCashAdvances, additionalDataLodging.lodgingFolioCashAdvances) + && Objects.equals( + this.isSetLodgingFolioCashAdvances, additionalDataLodging.isSetLodgingFolioCashAdvances) && Objects.equals(this.lodgingFolioNumber, additionalDataLodging.lodgingFolioNumber) + && Objects.equals( + this.isSetLodgingFolioNumber, additionalDataLodging.isSetLodgingFolioNumber) && Objects.equals( this.lodgingFoodBeverageCharges, additionalDataLodging.lodgingFoodBeverageCharges) + && Objects.equals( + this.isSetLodgingFoodBeverageCharges, + additionalDataLodging.isSetLodgingFoodBeverageCharges) && Objects.equals(this.lodgingNoShowIndicator, additionalDataLodging.lodgingNoShowIndicator) + && Objects.equals( + this.isSetLodgingNoShowIndicator, additionalDataLodging.isSetLodgingNoShowIndicator) && Objects.equals(this.lodgingPrepaidExpenses, additionalDataLodging.lodgingPrepaidExpenses) + && Objects.equals( + this.isSetLodgingPrepaidExpenses, additionalDataLodging.isSetLodgingPrepaidExpenses) && Objects.equals( this.lodgingPropertyPhoneNumber, additionalDataLodging.lodgingPropertyPhoneNumber) + && Objects.equals( + this.isSetLodgingPropertyPhoneNumber, + additionalDataLodging.isSetLodgingPropertyPhoneNumber) && Objects.equals( this.lodgingRoom1NumberOfNights, additionalDataLodging.lodgingRoom1NumberOfNights) + && Objects.equals( + this.isSetLodgingRoom1NumberOfNights, + additionalDataLodging.isSetLodgingRoom1NumberOfNights) && Objects.equals(this.lodgingRoom1Rate, additionalDataLodging.lodgingRoom1Rate) + && Objects.equals(this.isSetLodgingRoom1Rate, additionalDataLodging.isSetLodgingRoom1Rate) && Objects.equals(this.lodgingTotalRoomTax, additionalDataLodging.lodgingTotalRoomTax) + && Objects.equals( + this.isSetLodgingTotalRoomTax, additionalDataLodging.isSetLodgingTotalRoomTax) && Objects.equals(this.lodgingTotalTax, additionalDataLodging.lodgingTotalTax) + && Objects.equals(this.isSetLodgingTotalTax, additionalDataLodging.isSetLodgingTotalTax) && Objects.equals( this.travelEntertainmentAuthDataDuration, additionalDataLodging.travelEntertainmentAuthDataDuration) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataDuration, + additionalDataLodging.isSetTravelEntertainmentAuthDataDuration) && Objects.equals( this.travelEntertainmentAuthDataMarket, - additionalDataLodging.travelEntertainmentAuthDataMarket); + additionalDataLodging.travelEntertainmentAuthDataMarket) + && Objects.equals( + this.isSetTravelEntertainmentAuthDataMarket, + additionalDataLodging.isSetTravelEntertainmentAuthDataMarket); } @Override public int hashCode() { return Objects.hash( lodgingSpecialProgramCode, + isSetLodgingSpecialProgramCode, lodgingCheckInDate, + isSetLodgingCheckInDate, lodgingCheckOutDate, + isSetLodgingCheckOutDate, lodgingCustomerServiceTollFreeNumber, + isSetLodgingCustomerServiceTollFreeNumber, lodgingFireSafetyActIndicator, + isSetLodgingFireSafetyActIndicator, lodgingFolioCashAdvances, + isSetLodgingFolioCashAdvances, lodgingFolioNumber, + isSetLodgingFolioNumber, lodgingFoodBeverageCharges, + isSetLodgingFoodBeverageCharges, lodgingNoShowIndicator, + isSetLodgingNoShowIndicator, lodgingPrepaidExpenses, + isSetLodgingPrepaidExpenses, lodgingPropertyPhoneNumber, + isSetLodgingPropertyPhoneNumber, lodgingRoom1NumberOfNights, + isSetLodgingRoom1NumberOfNights, lodgingRoom1Rate, + isSetLodgingRoom1Rate, lodgingTotalRoomTax, + isSetLodgingTotalRoomTax, lodgingTotalTax, + isSetLodgingTotalTax, travelEntertainmentAuthDataDuration, - travelEntertainmentAuthDataMarket); + isSetTravelEntertainmentAuthDataDuration, + travelEntertainmentAuthDataMarket, + isSetTravelEntertainmentAuthDataMarket); } @Override @@ -945,6 +1115,93 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLodgingSpecialProgramCode) { + addIfNull(nulls, JSON_PROPERTY_LODGING_SPECIAL_PROGRAM_CODE, this.lodgingSpecialProgramCode); + } + if (isSetLodgingCheckInDate) { + addIfNull(nulls, JSON_PROPERTY_LODGING_CHECK_IN_DATE, this.lodgingCheckInDate); + } + if (isSetLodgingCheckOutDate) { + addIfNull(nulls, JSON_PROPERTY_LODGING_CHECK_OUT_DATE, this.lodgingCheckOutDate); + } + if (isSetLodgingCustomerServiceTollFreeNumber) { + addIfNull( + nulls, + JSON_PROPERTY_LODGING_CUSTOMER_SERVICE_TOLL_FREE_NUMBER, + this.lodgingCustomerServiceTollFreeNumber); + } + if (isSetLodgingFireSafetyActIndicator) { + addIfNull( + nulls, + JSON_PROPERTY_LODGING_FIRE_SAFETY_ACT_INDICATOR, + this.lodgingFireSafetyActIndicator); + } + if (isSetLodgingFolioCashAdvances) { + addIfNull(nulls, JSON_PROPERTY_LODGING_FOLIO_CASH_ADVANCES, this.lodgingFolioCashAdvances); + } + if (isSetLodgingFolioNumber) { + addIfNull(nulls, JSON_PROPERTY_LODGING_FOLIO_NUMBER, this.lodgingFolioNumber); + } + if (isSetLodgingFoodBeverageCharges) { + addIfNull( + nulls, JSON_PROPERTY_LODGING_FOOD_BEVERAGE_CHARGES, this.lodgingFoodBeverageCharges); + } + if (isSetLodgingNoShowIndicator) { + addIfNull(nulls, JSON_PROPERTY_LODGING_NO_SHOW_INDICATOR, this.lodgingNoShowIndicator); + } + if (isSetLodgingPrepaidExpenses) { + addIfNull(nulls, JSON_PROPERTY_LODGING_PREPAID_EXPENSES, this.lodgingPrepaidExpenses); + } + if (isSetLodgingPropertyPhoneNumber) { + addIfNull( + nulls, JSON_PROPERTY_LODGING_PROPERTY_PHONE_NUMBER, this.lodgingPropertyPhoneNumber); + } + if (isSetLodgingRoom1NumberOfNights) { + addIfNull( + nulls, JSON_PROPERTY_LODGING_ROOM1_NUMBER_OF_NIGHTS, this.lodgingRoom1NumberOfNights); + } + if (isSetLodgingRoom1Rate) { + addIfNull(nulls, JSON_PROPERTY_LODGING_ROOM1_RATE, this.lodgingRoom1Rate); + } + if (isSetLodgingTotalRoomTax) { + addIfNull(nulls, JSON_PROPERTY_LODGING_TOTAL_ROOM_TAX, this.lodgingTotalRoomTax); + } + if (isSetLodgingTotalTax) { + addIfNull(nulls, JSON_PROPERTY_LODGING_TOTAL_TAX, this.lodgingTotalTax); + } + if (isSetTravelEntertainmentAuthDataDuration) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_DURATION, + this.travelEntertainmentAuthDataDuration); + } + if (isSetTravelEntertainmentAuthDataMarket) { + addIfNull( + nulls, + JSON_PROPERTY_TRAVEL_ENTERTAINMENT_AUTH_DATA_MARKET, + this.travelEntertainmentAuthDataMarket); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataLodging given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java b/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java index f7d5a7cf1..db777d274 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataOpenInvoice.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,74 +45,134 @@ public class AdditionalDataOpenInvoice { "openinvoicedata.merchantData"; private String openinvoicedataMerchantData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataMerchantData = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_NUMBER_OF_LINES = "openinvoicedata.numberOfLines"; private String openinvoicedataNumberOfLines; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataNumberOfLines = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_FIRST_NAME = "openinvoicedata.recipientFirstName"; private String openinvoicedataRecipientFirstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataRecipientFirstName = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_LAST_NAME = "openinvoicedata.recipientLastName"; private String openinvoicedataRecipientLastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataRecipientLastName = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_CURRENCY_CODE = "openinvoicedataLine[itemNr].currencyCode"; private String openinvoicedataLineItemNrCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrCurrencyCode = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_DESCRIPTION = "openinvoicedataLine[itemNr].description"; private String openinvoicedataLineItemNrDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrDescription = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_AMOUNT = "openinvoicedataLine[itemNr].itemAmount"; private String openinvoicedataLineItemNrItemAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemAmount = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_ID = "openinvoicedataLine[itemNr].itemId"; private String openinvoicedataLineItemNrItemId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemId = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_AMOUNT = "openinvoicedataLine[itemNr].itemVatAmount"; private String openinvoicedataLineItemNrItemVatAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemVatAmount = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_PERCENTAGE = "openinvoicedataLine[itemNr].itemVatPercentage"; private String openinvoicedataLineItemNrItemVatPercentage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrItemVatPercentage = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_NUMBER_OF_ITEMS = "openinvoicedataLine[itemNr].numberOfItems"; private String openinvoicedataLineItemNrNumberOfItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrNumberOfItems = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_SHIPPING_COMPANY = "openinvoicedataLine[itemNr].returnShippingCompany"; private String openinvoicedataLineItemNrReturnShippingCompany; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrReturnShippingCompany = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_NUMBER = "openinvoicedataLine[itemNr].returnTrackingNumber"; private String openinvoicedataLineItemNrReturnTrackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrReturnTrackingNumber = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_URI = "openinvoicedataLine[itemNr].returnTrackingUri"; private String openinvoicedataLineItemNrReturnTrackingUri; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrReturnTrackingUri = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_COMPANY = "openinvoicedataLine[itemNr].shippingCompany"; private String openinvoicedataLineItemNrShippingCompany; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrShippingCompany = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_METHOD = "openinvoicedataLine[itemNr].shippingMethod"; private String openinvoicedataLineItemNrShippingMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrShippingMethod = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_NUMBER = "openinvoicedataLine[itemNr].trackingNumber"; private String openinvoicedataLineItemNrTrackingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrTrackingNumber = false; + public static final String JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_URI = "openinvoicedataLine[itemNr].trackingUri"; private String openinvoicedataLineItemNrTrackingUri; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpeninvoicedataLineItemNrTrackingUri = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataOpenInvoice() {} /** @@ -130,6 +192,7 @@ public AdditionalDataOpenInvoice() {} */ public AdditionalDataOpenInvoice openinvoicedataMerchantData(String openinvoicedataMerchantData) { this.openinvoicedataMerchantData = openinvoicedataMerchantData; + isSetOpeninvoicedataMerchantData = true; // mark as set return this; } @@ -171,6 +234,7 @@ public String getOpeninvoicedataMerchantData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataMerchantData(String openinvoicedataMerchantData) { this.openinvoicedataMerchantData = openinvoicedataMerchantData; + isSetOpeninvoicedataMerchantData = true; // mark as set } /** @@ -185,6 +249,7 @@ public void setOpeninvoicedataMerchantData(String openinvoicedataMerchantData) { public AdditionalDataOpenInvoice openinvoicedataNumberOfLines( String openinvoicedataNumberOfLines) { this.openinvoicedataNumberOfLines = openinvoicedataNumberOfLines; + isSetOpeninvoicedataNumberOfLines = true; // mark as set return this; } @@ -214,6 +279,7 @@ public String getOpeninvoicedataNumberOfLines() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataNumberOfLines(String openinvoicedataNumberOfLines) { this.openinvoicedataNumberOfLines = openinvoicedataNumberOfLines; + isSetOpeninvoicedataNumberOfLines = true; // mark as set } /** @@ -230,6 +296,7 @@ public void setOpeninvoicedataNumberOfLines(String openinvoicedataNumberOfLines) public AdditionalDataOpenInvoice openinvoicedataRecipientFirstName( String openinvoicedataRecipientFirstName) { this.openinvoicedataRecipientFirstName = openinvoicedataRecipientFirstName; + isSetOpeninvoicedataRecipientFirstName = true; // mark as set return this; } @@ -263,6 +330,7 @@ public String getOpeninvoicedataRecipientFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataRecipientFirstName(String openinvoicedataRecipientFirstName) { this.openinvoicedataRecipientFirstName = openinvoicedataRecipientFirstName; + isSetOpeninvoicedataRecipientFirstName = true; // mark as set } /** @@ -279,6 +347,7 @@ public void setOpeninvoicedataRecipientFirstName(String openinvoicedataRecipient public AdditionalDataOpenInvoice openinvoicedataRecipientLastName( String openinvoicedataRecipientLastName) { this.openinvoicedataRecipientLastName = openinvoicedataRecipientLastName; + isSetOpeninvoicedataRecipientLastName = true; // mark as set return this; } @@ -312,6 +381,7 @@ public String getOpeninvoicedataRecipientLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataRecipientLastName(String openinvoicedataRecipientLastName) { this.openinvoicedataRecipientLastName = openinvoicedataRecipientLastName; + isSetOpeninvoicedataRecipientLastName = true; // mark as set } /** @@ -323,6 +393,7 @@ public void setOpeninvoicedataRecipientLastName(String openinvoicedataRecipientL public AdditionalDataOpenInvoice openinvoicedataLineItemNrCurrencyCode( String openinvoicedataLineItemNrCurrencyCode) { this.openinvoicedataLineItemNrCurrencyCode = openinvoicedataLineItemNrCurrencyCode; + isSetOpeninvoicedataLineItemNrCurrencyCode = true; // mark as set return this; } @@ -347,6 +418,7 @@ public String getOpeninvoicedataLineItemNrCurrencyCode() { public void setOpeninvoicedataLineItemNrCurrencyCode( String openinvoicedataLineItemNrCurrencyCode) { this.openinvoicedataLineItemNrCurrencyCode = openinvoicedataLineItemNrCurrencyCode; + isSetOpeninvoicedataLineItemNrCurrencyCode = true; // mark as set } /** @@ -359,6 +431,7 @@ public void setOpeninvoicedataLineItemNrCurrencyCode( public AdditionalDataOpenInvoice openinvoicedataLineItemNrDescription( String openinvoicedataLineItemNrDescription) { this.openinvoicedataLineItemNrDescription = openinvoicedataLineItemNrDescription; + isSetOpeninvoicedataLineItemNrDescription = true; // mark as set return this; } @@ -384,6 +457,7 @@ public String getOpeninvoicedataLineItemNrDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrDescription(String openinvoicedataLineItemNrDescription) { this.openinvoicedataLineItemNrDescription = openinvoicedataLineItemNrDescription; + isSetOpeninvoicedataLineItemNrDescription = true; // mark as set } /** @@ -397,6 +471,7 @@ public void setOpeninvoicedataLineItemNrDescription(String openinvoicedataLineIt public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemAmount( String openinvoicedataLineItemNrItemAmount) { this.openinvoicedataLineItemNrItemAmount = openinvoicedataLineItemNrItemAmount; + isSetOpeninvoicedataLineItemNrItemAmount = true; // mark as set return this; } @@ -424,6 +499,7 @@ public String getOpeninvoicedataLineItemNrItemAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrItemAmount(String openinvoicedataLineItemNrItemAmount) { this.openinvoicedataLineItemNrItemAmount = openinvoicedataLineItemNrItemAmount; + isSetOpeninvoicedataLineItemNrItemAmount = true; // mark as set } /** @@ -436,6 +512,7 @@ public void setOpeninvoicedataLineItemNrItemAmount(String openinvoicedataLineIte public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemId( String openinvoicedataLineItemNrItemId) { this.openinvoicedataLineItemNrItemId = openinvoicedataLineItemNrItemId; + isSetOpeninvoicedataLineItemNrItemId = true; // mark as set return this; } @@ -461,6 +538,7 @@ public String getOpeninvoicedataLineItemNrItemId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrItemId(String openinvoicedataLineItemNrItemId) { this.openinvoicedataLineItemNrItemId = openinvoicedataLineItemNrItemId; + isSetOpeninvoicedataLineItemNrItemId = true; // mark as set } /** @@ -473,6 +551,7 @@ public void setOpeninvoicedataLineItemNrItemId(String openinvoicedataLineItemNrI public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemVatAmount( String openinvoicedataLineItemNrItemVatAmount) { this.openinvoicedataLineItemNrItemVatAmount = openinvoicedataLineItemNrItemVatAmount; + isSetOpeninvoicedataLineItemNrItemVatAmount = true; // mark as set return this; } @@ -499,6 +578,7 @@ public String getOpeninvoicedataLineItemNrItemVatAmount() { public void setOpeninvoicedataLineItemNrItemVatAmount( String openinvoicedataLineItemNrItemVatAmount) { this.openinvoicedataLineItemNrItemVatAmount = openinvoicedataLineItemNrItemVatAmount; + isSetOpeninvoicedataLineItemNrItemVatAmount = true; // mark as set } /** @@ -512,6 +592,7 @@ public void setOpeninvoicedataLineItemNrItemVatAmount( public AdditionalDataOpenInvoice openinvoicedataLineItemNrItemVatPercentage( String openinvoicedataLineItemNrItemVatPercentage) { this.openinvoicedataLineItemNrItemVatPercentage = openinvoicedataLineItemNrItemVatPercentage; + isSetOpeninvoicedataLineItemNrItemVatPercentage = true; // mark as set return this; } @@ -540,6 +621,7 @@ public String getOpeninvoicedataLineItemNrItemVatPercentage() { public void setOpeninvoicedataLineItemNrItemVatPercentage( String openinvoicedataLineItemNrItemVatPercentage) { this.openinvoicedataLineItemNrItemVatPercentage = openinvoicedataLineItemNrItemVatPercentage; + isSetOpeninvoicedataLineItemNrItemVatPercentage = true; // mark as set } /** @@ -552,6 +634,7 @@ public void setOpeninvoicedataLineItemNrItemVatPercentage( public AdditionalDataOpenInvoice openinvoicedataLineItemNrNumberOfItems( String openinvoicedataLineItemNrNumberOfItems) { this.openinvoicedataLineItemNrNumberOfItems = openinvoicedataLineItemNrNumberOfItems; + isSetOpeninvoicedataLineItemNrNumberOfItems = true; // mark as set return this; } @@ -578,6 +661,7 @@ public String getOpeninvoicedataLineItemNrNumberOfItems() { public void setOpeninvoicedataLineItemNrNumberOfItems( String openinvoicedataLineItemNrNumberOfItems) { this.openinvoicedataLineItemNrNumberOfItems = openinvoicedataLineItemNrNumberOfItems; + isSetOpeninvoicedataLineItemNrNumberOfItems = true; // mark as set } /** @@ -591,6 +675,7 @@ public AdditionalDataOpenInvoice openinvoicedataLineItemNrReturnShippingCompany( String openinvoicedataLineItemNrReturnShippingCompany) { this.openinvoicedataLineItemNrReturnShippingCompany = openinvoicedataLineItemNrReturnShippingCompany; + isSetOpeninvoicedataLineItemNrReturnShippingCompany = true; // mark as set return this; } @@ -618,6 +703,7 @@ public void setOpeninvoicedataLineItemNrReturnShippingCompany( String openinvoicedataLineItemNrReturnShippingCompany) { this.openinvoicedataLineItemNrReturnShippingCompany = openinvoicedataLineItemNrReturnShippingCompany; + isSetOpeninvoicedataLineItemNrReturnShippingCompany = true; // mark as set } /** @@ -631,6 +717,7 @@ public AdditionalDataOpenInvoice openinvoicedataLineItemNrReturnTrackingNumber( String openinvoicedataLineItemNrReturnTrackingNumber) { this.openinvoicedataLineItemNrReturnTrackingNumber = openinvoicedataLineItemNrReturnTrackingNumber; + isSetOpeninvoicedataLineItemNrReturnTrackingNumber = true; // mark as set return this; } @@ -658,6 +745,7 @@ public void setOpeninvoicedataLineItemNrReturnTrackingNumber( String openinvoicedataLineItemNrReturnTrackingNumber) { this.openinvoicedataLineItemNrReturnTrackingNumber = openinvoicedataLineItemNrReturnTrackingNumber; + isSetOpeninvoicedataLineItemNrReturnTrackingNumber = true; // mark as set } /** @@ -670,6 +758,7 @@ public void setOpeninvoicedataLineItemNrReturnTrackingNumber( public AdditionalDataOpenInvoice openinvoicedataLineItemNrReturnTrackingUri( String openinvoicedataLineItemNrReturnTrackingUri) { this.openinvoicedataLineItemNrReturnTrackingUri = openinvoicedataLineItemNrReturnTrackingUri; + isSetOpeninvoicedataLineItemNrReturnTrackingUri = true; // mark as set return this; } @@ -696,6 +785,7 @@ public String getOpeninvoicedataLineItemNrReturnTrackingUri() { public void setOpeninvoicedataLineItemNrReturnTrackingUri( String openinvoicedataLineItemNrReturnTrackingUri) { this.openinvoicedataLineItemNrReturnTrackingUri = openinvoicedataLineItemNrReturnTrackingUri; + isSetOpeninvoicedataLineItemNrReturnTrackingUri = true; // mark as set } /** @@ -708,6 +798,7 @@ public void setOpeninvoicedataLineItemNrReturnTrackingUri( public AdditionalDataOpenInvoice openinvoicedataLineItemNrShippingCompany( String openinvoicedataLineItemNrShippingCompany) { this.openinvoicedataLineItemNrShippingCompany = openinvoicedataLineItemNrShippingCompany; + isSetOpeninvoicedataLineItemNrShippingCompany = true; // mark as set return this; } @@ -734,6 +825,7 @@ public String getOpeninvoicedataLineItemNrShippingCompany() { public void setOpeninvoicedataLineItemNrShippingCompany( String openinvoicedataLineItemNrShippingCompany) { this.openinvoicedataLineItemNrShippingCompany = openinvoicedataLineItemNrShippingCompany; + isSetOpeninvoicedataLineItemNrShippingCompany = true; // mark as set } /** @@ -745,6 +837,7 @@ public void setOpeninvoicedataLineItemNrShippingCompany( public AdditionalDataOpenInvoice openinvoicedataLineItemNrShippingMethod( String openinvoicedataLineItemNrShippingMethod) { this.openinvoicedataLineItemNrShippingMethod = openinvoicedataLineItemNrShippingMethod; + isSetOpeninvoicedataLineItemNrShippingMethod = true; // mark as set return this; } @@ -769,6 +862,7 @@ public String getOpeninvoicedataLineItemNrShippingMethod() { public void setOpeninvoicedataLineItemNrShippingMethod( String openinvoicedataLineItemNrShippingMethod) { this.openinvoicedataLineItemNrShippingMethod = openinvoicedataLineItemNrShippingMethod; + isSetOpeninvoicedataLineItemNrShippingMethod = true; // mark as set } /** @@ -780,6 +874,7 @@ public void setOpeninvoicedataLineItemNrShippingMethod( public AdditionalDataOpenInvoice openinvoicedataLineItemNrTrackingNumber( String openinvoicedataLineItemNrTrackingNumber) { this.openinvoicedataLineItemNrTrackingNumber = openinvoicedataLineItemNrTrackingNumber; + isSetOpeninvoicedataLineItemNrTrackingNumber = true; // mark as set return this; } @@ -804,6 +899,7 @@ public String getOpeninvoicedataLineItemNrTrackingNumber() { public void setOpeninvoicedataLineItemNrTrackingNumber( String openinvoicedataLineItemNrTrackingNumber) { this.openinvoicedataLineItemNrTrackingNumber = openinvoicedataLineItemNrTrackingNumber; + isSetOpeninvoicedataLineItemNrTrackingNumber = true; // mark as set } /** @@ -815,6 +911,7 @@ public void setOpeninvoicedataLineItemNrTrackingNumber( public AdditionalDataOpenInvoice openinvoicedataLineItemNrTrackingUri( String openinvoicedataLineItemNrTrackingUri) { this.openinvoicedataLineItemNrTrackingUri = openinvoicedataLineItemNrTrackingUri; + isSetOpeninvoicedataLineItemNrTrackingUri = true; // mark as set return this; } @@ -838,6 +935,27 @@ public String getOpeninvoicedataLineItemNrTrackingUri() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpeninvoicedataLineItemNrTrackingUri(String openinvoicedataLineItemNrTrackingUri) { this.openinvoicedataLineItemNrTrackingUri = openinvoicedataLineItemNrTrackingUri; + isSetOpeninvoicedataLineItemNrTrackingUri = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataOpenInvoice includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataOpenInvoice object is equal to o. */ @@ -852,80 +970,152 @@ public boolean equals(Object o) { AdditionalDataOpenInvoice additionalDataOpenInvoice = (AdditionalDataOpenInvoice) o; return Objects.equals( this.openinvoicedataMerchantData, additionalDataOpenInvoice.openinvoicedataMerchantData) + && Objects.equals( + this.isSetOpeninvoicedataMerchantData, + additionalDataOpenInvoice.isSetOpeninvoicedataMerchantData) && Objects.equals( this.openinvoicedataNumberOfLines, additionalDataOpenInvoice.openinvoicedataNumberOfLines) + && Objects.equals( + this.isSetOpeninvoicedataNumberOfLines, + additionalDataOpenInvoice.isSetOpeninvoicedataNumberOfLines) && Objects.equals( this.openinvoicedataRecipientFirstName, additionalDataOpenInvoice.openinvoicedataRecipientFirstName) + && Objects.equals( + this.isSetOpeninvoicedataRecipientFirstName, + additionalDataOpenInvoice.isSetOpeninvoicedataRecipientFirstName) && Objects.equals( this.openinvoicedataRecipientLastName, additionalDataOpenInvoice.openinvoicedataRecipientLastName) + && Objects.equals( + this.isSetOpeninvoicedataRecipientLastName, + additionalDataOpenInvoice.isSetOpeninvoicedataRecipientLastName) && Objects.equals( this.openinvoicedataLineItemNrCurrencyCode, additionalDataOpenInvoice.openinvoicedataLineItemNrCurrencyCode) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrCurrencyCode, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrCurrencyCode) && Objects.equals( this.openinvoicedataLineItemNrDescription, additionalDataOpenInvoice.openinvoicedataLineItemNrDescription) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrDescription, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrDescription) && Objects.equals( this.openinvoicedataLineItemNrItemAmount, additionalDataOpenInvoice.openinvoicedataLineItemNrItemAmount) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemAmount, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemAmount) && Objects.equals( this.openinvoicedataLineItemNrItemId, additionalDataOpenInvoice.openinvoicedataLineItemNrItemId) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemId, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemId) && Objects.equals( this.openinvoicedataLineItemNrItemVatAmount, additionalDataOpenInvoice.openinvoicedataLineItemNrItemVatAmount) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemVatAmount, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemVatAmount) && Objects.equals( this.openinvoicedataLineItemNrItemVatPercentage, additionalDataOpenInvoice.openinvoicedataLineItemNrItemVatPercentage) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrItemVatPercentage, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrItemVatPercentage) && Objects.equals( this.openinvoicedataLineItemNrNumberOfItems, additionalDataOpenInvoice.openinvoicedataLineItemNrNumberOfItems) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrNumberOfItems, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrNumberOfItems) && Objects.equals( this.openinvoicedataLineItemNrReturnShippingCompany, additionalDataOpenInvoice.openinvoicedataLineItemNrReturnShippingCompany) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrReturnShippingCompany, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrReturnShippingCompany) && Objects.equals( this.openinvoicedataLineItemNrReturnTrackingNumber, additionalDataOpenInvoice.openinvoicedataLineItemNrReturnTrackingNumber) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrReturnTrackingNumber, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrReturnTrackingNumber) && Objects.equals( this.openinvoicedataLineItemNrReturnTrackingUri, additionalDataOpenInvoice.openinvoicedataLineItemNrReturnTrackingUri) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrReturnTrackingUri, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrReturnTrackingUri) && Objects.equals( this.openinvoicedataLineItemNrShippingCompany, additionalDataOpenInvoice.openinvoicedataLineItemNrShippingCompany) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrShippingCompany, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrShippingCompany) && Objects.equals( this.openinvoicedataLineItemNrShippingMethod, additionalDataOpenInvoice.openinvoicedataLineItemNrShippingMethod) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrShippingMethod, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrShippingMethod) && Objects.equals( this.openinvoicedataLineItemNrTrackingNumber, additionalDataOpenInvoice.openinvoicedataLineItemNrTrackingNumber) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrTrackingNumber, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrTrackingNumber) && Objects.equals( this.openinvoicedataLineItemNrTrackingUri, - additionalDataOpenInvoice.openinvoicedataLineItemNrTrackingUri); + additionalDataOpenInvoice.openinvoicedataLineItemNrTrackingUri) + && Objects.equals( + this.isSetOpeninvoicedataLineItemNrTrackingUri, + additionalDataOpenInvoice.isSetOpeninvoicedataLineItemNrTrackingUri); } @Override public int hashCode() { return Objects.hash( openinvoicedataMerchantData, + isSetOpeninvoicedataMerchantData, openinvoicedataNumberOfLines, + isSetOpeninvoicedataNumberOfLines, openinvoicedataRecipientFirstName, + isSetOpeninvoicedataRecipientFirstName, openinvoicedataRecipientLastName, + isSetOpeninvoicedataRecipientLastName, openinvoicedataLineItemNrCurrencyCode, + isSetOpeninvoicedataLineItemNrCurrencyCode, openinvoicedataLineItemNrDescription, + isSetOpeninvoicedataLineItemNrDescription, openinvoicedataLineItemNrItemAmount, + isSetOpeninvoicedataLineItemNrItemAmount, openinvoicedataLineItemNrItemId, + isSetOpeninvoicedataLineItemNrItemId, openinvoicedataLineItemNrItemVatAmount, + isSetOpeninvoicedataLineItemNrItemVatAmount, openinvoicedataLineItemNrItemVatPercentage, + isSetOpeninvoicedataLineItemNrItemVatPercentage, openinvoicedataLineItemNrNumberOfItems, + isSetOpeninvoicedataLineItemNrNumberOfItems, openinvoicedataLineItemNrReturnShippingCompany, + isSetOpeninvoicedataLineItemNrReturnShippingCompany, openinvoicedataLineItemNrReturnTrackingNumber, + isSetOpeninvoicedataLineItemNrReturnTrackingNumber, openinvoicedataLineItemNrReturnTrackingUri, + isSetOpeninvoicedataLineItemNrReturnTrackingUri, openinvoicedataLineItemNrShippingCompany, + isSetOpeninvoicedataLineItemNrShippingCompany, openinvoicedataLineItemNrShippingMethod, + isSetOpeninvoicedataLineItemNrShippingMethod, openinvoicedataLineItemNrTrackingNumber, - openinvoicedataLineItemNrTrackingUri); + isSetOpeninvoicedataLineItemNrTrackingNumber, + openinvoicedataLineItemNrTrackingUri, + isSetOpeninvoicedataLineItemNrTrackingUri); } @Override @@ -1000,6 +1190,131 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOpeninvoicedataMerchantData) { + addIfNull( + nulls, JSON_PROPERTY_OPENINVOICEDATA_MERCHANT_DATA, this.openinvoicedataMerchantData); + } + if (isSetOpeninvoicedataNumberOfLines) { + addIfNull( + nulls, JSON_PROPERTY_OPENINVOICEDATA_NUMBER_OF_LINES, this.openinvoicedataNumberOfLines); + } + if (isSetOpeninvoicedataRecipientFirstName) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_FIRST_NAME, + this.openinvoicedataRecipientFirstName); + } + if (isSetOpeninvoicedataRecipientLastName) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_RECIPIENT_LAST_NAME, + this.openinvoicedataRecipientLastName); + } + if (isSetOpeninvoicedataLineItemNrCurrencyCode) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_CURRENCY_CODE, + this.openinvoicedataLineItemNrCurrencyCode); + } + if (isSetOpeninvoicedataLineItemNrDescription) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_DESCRIPTION, + this.openinvoicedataLineItemNrDescription); + } + if (isSetOpeninvoicedataLineItemNrItemAmount) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_AMOUNT, + this.openinvoicedataLineItemNrItemAmount); + } + if (isSetOpeninvoicedataLineItemNrItemId) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_ID, + this.openinvoicedataLineItemNrItemId); + } + if (isSetOpeninvoicedataLineItemNrItemVatAmount) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_AMOUNT, + this.openinvoicedataLineItemNrItemVatAmount); + } + if (isSetOpeninvoicedataLineItemNrItemVatPercentage) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_ITEM_VAT_PERCENTAGE, + this.openinvoicedataLineItemNrItemVatPercentage); + } + if (isSetOpeninvoicedataLineItemNrNumberOfItems) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_NUMBER_OF_ITEMS, + this.openinvoicedataLineItemNrNumberOfItems); + } + if (isSetOpeninvoicedataLineItemNrReturnShippingCompany) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_SHIPPING_COMPANY, + this.openinvoicedataLineItemNrReturnShippingCompany); + } + if (isSetOpeninvoicedataLineItemNrReturnTrackingNumber) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_NUMBER, + this.openinvoicedataLineItemNrReturnTrackingNumber); + } + if (isSetOpeninvoicedataLineItemNrReturnTrackingUri) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_RETURN_TRACKING_URI, + this.openinvoicedataLineItemNrReturnTrackingUri); + } + if (isSetOpeninvoicedataLineItemNrShippingCompany) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_COMPANY, + this.openinvoicedataLineItemNrShippingCompany); + } + if (isSetOpeninvoicedataLineItemNrShippingMethod) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_SHIPPING_METHOD, + this.openinvoicedataLineItemNrShippingMethod); + } + if (isSetOpeninvoicedataLineItemNrTrackingNumber) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_NUMBER, + this.openinvoicedataLineItemNrTrackingNumber); + } + if (isSetOpeninvoicedataLineItemNrTrackingUri) { + addIfNull( + nulls, + JSON_PROPERTY_OPENINVOICEDATA_LINE_ITEM_NR_TRACKING_URI, + this.openinvoicedataLineItemNrTrackingUri); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataOpenInvoice given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java b/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java index 95283e1af..b343ed3c7 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class AdditionalDataOpi { public static final String JSON_PROPERTY_OPI_INCLUDE_TRANS_TOKEN = "opi.includeTransToken"; private String opiIncludeTransToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpiIncludeTransToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataOpi() {} /** @@ -40,6 +51,7 @@ public AdditionalDataOpi() {} */ public AdditionalDataOpi opiIncludeTransToken(String opiIncludeTransToken) { this.opiIncludeTransToken = opiIncludeTransToken; + isSetOpiIncludeTransToken = true; // mark as set return this; } @@ -77,6 +89,27 @@ public String getOpiIncludeTransToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpiIncludeTransToken(String opiIncludeTransToken) { this.opiIncludeTransToken = opiIncludeTransToken; + isSetOpiIncludeTransToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataOpi includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataOpi object is equal to o. */ @@ -89,12 +122,14 @@ public boolean equals(Object o) { return false; } AdditionalDataOpi additionalDataOpi = (AdditionalDataOpi) o; - return Objects.equals(this.opiIncludeTransToken, additionalDataOpi.opiIncludeTransToken); + return Objects.equals(this.opiIncludeTransToken, additionalDataOpi.opiIncludeTransToken) + && Objects.equals( + this.isSetOpiIncludeTransToken, additionalDataOpi.isSetOpiIncludeTransToken); } @Override public int hashCode() { - return Objects.hash(opiIncludeTransToken); + return Objects.hash(opiIncludeTransToken, isSetOpiIncludeTransToken); } @Override @@ -118,6 +153,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOpiIncludeTransToken) { + addIfNull(nulls, JSON_PROPERTY_OPI_INCLUDE_TRANS_TOKEN, this.opiIncludeTransToken); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataOpi given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java index a51848a87..a34e9c206 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRatepay.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,28 +34,58 @@ public class AdditionalDataRatepay { public static final String JSON_PROPERTY_RATEPAY_INSTALLMENT_AMOUNT = "ratepay.installmentAmount"; private String ratepayInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayInstallmentAmount = false; + public static final String JSON_PROPERTY_RATEPAY_INTEREST_RATE = "ratepay.interestRate"; private String ratepayInterestRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayInterestRate = false; + public static final String JSON_PROPERTY_RATEPAY_LAST_INSTALLMENT_AMOUNT = "ratepay.lastInstallmentAmount"; private String ratepayLastInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayLastInstallmentAmount = false; + public static final String JSON_PROPERTY_RATEPAY_PAYMENT_FIRSTDAY = "ratepay.paymentFirstday"; private String ratepayPaymentFirstday; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepayPaymentFirstday = false; + public static final String JSON_PROPERTY_RATEPAYDATA_DELIVERY_DATE = "ratepaydata.deliveryDate"; private String ratepaydataDeliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataDeliveryDate = false; + public static final String JSON_PROPERTY_RATEPAYDATA_DUE_DATE = "ratepaydata.dueDate"; private String ratepaydataDueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataDueDate = false; + public static final String JSON_PROPERTY_RATEPAYDATA_INVOICE_DATE = "ratepaydata.invoiceDate"; private String ratepaydataInvoiceDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataInvoiceDate = false; + public static final String JSON_PROPERTY_RATEPAYDATA_INVOICE_ID = "ratepaydata.invoiceId"; private String ratepaydataInvoiceId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRatepaydataInvoiceId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRatepay() {} /** @@ -64,6 +96,7 @@ public AdditionalDataRatepay() {} */ public AdditionalDataRatepay ratepayInstallmentAmount(String ratepayInstallmentAmount) { this.ratepayInstallmentAmount = ratepayInstallmentAmount; + isSetRatepayInstallmentAmount = true; // mark as set return this; } @@ -87,6 +120,7 @@ public String getRatepayInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayInstallmentAmount(String ratepayInstallmentAmount) { this.ratepayInstallmentAmount = ratepayInstallmentAmount; + isSetRatepayInstallmentAmount = true; // mark as set } /** @@ -97,6 +131,7 @@ public void setRatepayInstallmentAmount(String ratepayInstallmentAmount) { */ public AdditionalDataRatepay ratepayInterestRate(String ratepayInterestRate) { this.ratepayInterestRate = ratepayInterestRate; + isSetRatepayInterestRate = true; // mark as set return this; } @@ -120,6 +155,7 @@ public String getRatepayInterestRate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayInterestRate(String ratepayInterestRate) { this.ratepayInterestRate = ratepayInterestRate; + isSetRatepayInterestRate = true; // mark as set } /** @@ -130,6 +166,7 @@ public void setRatepayInterestRate(String ratepayInterestRate) { */ public AdditionalDataRatepay ratepayLastInstallmentAmount(String ratepayLastInstallmentAmount) { this.ratepayLastInstallmentAmount = ratepayLastInstallmentAmount; + isSetRatepayLastInstallmentAmount = true; // mark as set return this; } @@ -153,6 +190,7 @@ public String getRatepayLastInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayLastInstallmentAmount(String ratepayLastInstallmentAmount) { this.ratepayLastInstallmentAmount = ratepayLastInstallmentAmount; + isSetRatepayLastInstallmentAmount = true; // mark as set } /** @@ -163,6 +201,7 @@ public void setRatepayLastInstallmentAmount(String ratepayLastInstallmentAmount) */ public AdditionalDataRatepay ratepayPaymentFirstday(String ratepayPaymentFirstday) { this.ratepayPaymentFirstday = ratepayPaymentFirstday; + isSetRatepayPaymentFirstday = true; // mark as set return this; } @@ -186,6 +225,7 @@ public String getRatepayPaymentFirstday() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepayPaymentFirstday(String ratepayPaymentFirstday) { this.ratepayPaymentFirstday = ratepayPaymentFirstday; + isSetRatepayPaymentFirstday = true; // mark as set } /** @@ -196,6 +236,7 @@ public void setRatepayPaymentFirstday(String ratepayPaymentFirstday) { */ public AdditionalDataRatepay ratepaydataDeliveryDate(String ratepaydataDeliveryDate) { this.ratepaydataDeliveryDate = ratepaydataDeliveryDate; + isSetRatepaydataDeliveryDate = true; // mark as set return this; } @@ -219,6 +260,7 @@ public String getRatepaydataDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataDeliveryDate(String ratepaydataDeliveryDate) { this.ratepaydataDeliveryDate = ratepaydataDeliveryDate; + isSetRatepaydataDeliveryDate = true; // mark as set } /** @@ -229,6 +271,7 @@ public void setRatepaydataDeliveryDate(String ratepaydataDeliveryDate) { */ public AdditionalDataRatepay ratepaydataDueDate(String ratepaydataDueDate) { this.ratepaydataDueDate = ratepaydataDueDate; + isSetRatepaydataDueDate = true; // mark as set return this; } @@ -252,6 +295,7 @@ public String getRatepaydataDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataDueDate(String ratepaydataDueDate) { this.ratepaydataDueDate = ratepaydataDueDate; + isSetRatepaydataDueDate = true; // mark as set } /** @@ -264,6 +308,7 @@ public void setRatepaydataDueDate(String ratepaydataDueDate) { */ public AdditionalDataRatepay ratepaydataInvoiceDate(String ratepaydataInvoiceDate) { this.ratepaydataInvoiceDate = ratepaydataInvoiceDate; + isSetRatepaydataInvoiceDate = true; // mark as set return this; } @@ -291,6 +336,7 @@ public String getRatepaydataInvoiceDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataInvoiceDate(String ratepaydataInvoiceDate) { this.ratepaydataInvoiceDate = ratepaydataInvoiceDate; + isSetRatepaydataInvoiceDate = true; // mark as set } /** @@ -302,6 +348,7 @@ public void setRatepaydataInvoiceDate(String ratepaydataInvoiceDate) { */ public AdditionalDataRatepay ratepaydataInvoiceId(String ratepaydataInvoiceId) { this.ratepaydataInvoiceId = ratepaydataInvoiceId; + isSetRatepaydataInvoiceId = true; // mark as set return this; } @@ -327,6 +374,27 @@ public String getRatepaydataInvoiceId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRatepaydataInvoiceId(String ratepaydataInvoiceId) { this.ratepaydataInvoiceId = ratepaydataInvoiceId; + isSetRatepaydataInvoiceId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRatepay includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataRatepay object is equal to o. */ @@ -341,28 +409,53 @@ public boolean equals(Object o) { AdditionalDataRatepay additionalDataRatepay = (AdditionalDataRatepay) o; return Objects.equals( this.ratepayInstallmentAmount, additionalDataRatepay.ratepayInstallmentAmount) + && Objects.equals( + this.isSetRatepayInstallmentAmount, additionalDataRatepay.isSetRatepayInstallmentAmount) && Objects.equals(this.ratepayInterestRate, additionalDataRatepay.ratepayInterestRate) + && Objects.equals( + this.isSetRatepayInterestRate, additionalDataRatepay.isSetRatepayInterestRate) && Objects.equals( this.ratepayLastInstallmentAmount, additionalDataRatepay.ratepayLastInstallmentAmount) + && Objects.equals( + this.isSetRatepayLastInstallmentAmount, + additionalDataRatepay.isSetRatepayLastInstallmentAmount) && Objects.equals(this.ratepayPaymentFirstday, additionalDataRatepay.ratepayPaymentFirstday) + && Objects.equals( + this.isSetRatepayPaymentFirstday, additionalDataRatepay.isSetRatepayPaymentFirstday) && Objects.equals( this.ratepaydataDeliveryDate, additionalDataRatepay.ratepaydataDeliveryDate) + && Objects.equals( + this.isSetRatepaydataDeliveryDate, additionalDataRatepay.isSetRatepaydataDeliveryDate) && Objects.equals(this.ratepaydataDueDate, additionalDataRatepay.ratepaydataDueDate) + && Objects.equals( + this.isSetRatepaydataDueDate, additionalDataRatepay.isSetRatepaydataDueDate) && Objects.equals(this.ratepaydataInvoiceDate, additionalDataRatepay.ratepaydataInvoiceDate) - && Objects.equals(this.ratepaydataInvoiceId, additionalDataRatepay.ratepaydataInvoiceId); + && Objects.equals( + this.isSetRatepaydataInvoiceDate, additionalDataRatepay.isSetRatepaydataInvoiceDate) + && Objects.equals(this.ratepaydataInvoiceId, additionalDataRatepay.ratepaydataInvoiceId) + && Objects.equals( + this.isSetRatepaydataInvoiceId, additionalDataRatepay.isSetRatepaydataInvoiceId); } @Override public int hashCode() { return Objects.hash( ratepayInstallmentAmount, + isSetRatepayInstallmentAmount, ratepayInterestRate, + isSetRatepayInterestRate, ratepayLastInstallmentAmount, + isSetRatepayLastInstallmentAmount, ratepayPaymentFirstday, + isSetRatepayPaymentFirstday, ratepaydataDeliveryDate, + isSetRatepaydataDeliveryDate, ratepaydataDueDate, + isSetRatepaydataDueDate, ratepaydataInvoiceDate, - ratepaydataInvoiceId); + isSetRatepaydataInvoiceDate, + ratepaydataInvoiceId, + isSetRatepaydataInvoiceId); } @Override @@ -405,6 +498,52 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetRatepayInstallmentAmount) { + addIfNull(nulls, JSON_PROPERTY_RATEPAY_INSTALLMENT_AMOUNT, this.ratepayInstallmentAmount); + } + if (isSetRatepayInterestRate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAY_INTEREST_RATE, this.ratepayInterestRate); + } + if (isSetRatepayLastInstallmentAmount) { + addIfNull( + nulls, JSON_PROPERTY_RATEPAY_LAST_INSTALLMENT_AMOUNT, this.ratepayLastInstallmentAmount); + } + if (isSetRatepayPaymentFirstday) { + addIfNull(nulls, JSON_PROPERTY_RATEPAY_PAYMENT_FIRSTDAY, this.ratepayPaymentFirstday); + } + if (isSetRatepaydataDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_DELIVERY_DATE, this.ratepaydataDeliveryDate); + } + if (isSetRatepaydataDueDate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_DUE_DATE, this.ratepaydataDueDate); + } + if (isSetRatepaydataInvoiceDate) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_INVOICE_DATE, this.ratepaydataInvoiceDate); + } + if (isSetRatepaydataInvoiceId) { + addIfNull(nulls, JSON_PROPERTY_RATEPAYDATA_INVOICE_ID, this.ratepaydataInvoiceId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataRatepay given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java index 39af136d2..f3622fe0f 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRetry.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class AdditionalDataRetry { public static final String JSON_PROPERTY_RETRY_CHAIN_ATTEMPT_NUMBER = "retry.chainAttemptNumber"; private String retryChainAttemptNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetryChainAttemptNumber = false; + public static final String JSON_PROPERTY_RETRY_ORDER_ATTEMPT_NUMBER = "retry.orderAttemptNumber"; private String retryOrderAttemptNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetryOrderAttemptNumber = false; + public static final String JSON_PROPERTY_RETRY_SKIP_RETRY = "retry.skipRetry"; private String retrySkipRetry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetrySkipRetry = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRetry() {} /** @@ -54,6 +71,7 @@ public AdditionalDataRetry() {} */ public AdditionalDataRetry retryChainAttemptNumber(String retryChainAttemptNumber) { this.retryChainAttemptNumber = retryChainAttemptNumber; + isSetRetryChainAttemptNumber = true; // mark as set return this; } @@ -99,6 +117,7 @@ public String getRetryChainAttemptNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetryChainAttemptNumber(String retryChainAttemptNumber) { this.retryChainAttemptNumber = retryChainAttemptNumber; + isSetRetryChainAttemptNumber = true; // mark as set } /** @@ -120,6 +139,7 @@ public void setRetryChainAttemptNumber(String retryChainAttemptNumber) { */ public AdditionalDataRetry retryOrderAttemptNumber(String retryOrderAttemptNumber) { this.retryOrderAttemptNumber = retryOrderAttemptNumber; + isSetRetryOrderAttemptNumber = true; // mark as set return this; } @@ -165,6 +185,7 @@ public String getRetryOrderAttemptNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetryOrderAttemptNumber(String retryOrderAttemptNumber) { this.retryOrderAttemptNumber = retryOrderAttemptNumber; + isSetRetryOrderAttemptNumber = true; // mark as set } /** @@ -182,6 +203,7 @@ public void setRetryOrderAttemptNumber(String retryOrderAttemptNumber) { */ public AdditionalDataRetry retrySkipRetry(String retrySkipRetry) { this.retrySkipRetry = retrySkipRetry; + isSetRetrySkipRetry = true; // mark as set return this; } @@ -219,6 +241,27 @@ public String getRetrySkipRetry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetrySkipRetry(String retrySkipRetry) { this.retrySkipRetry = retrySkipRetry; + isSetRetrySkipRetry = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRetry includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataRetry object is equal to o. */ @@ -232,13 +275,24 @@ public boolean equals(Object o) { } AdditionalDataRetry additionalDataRetry = (AdditionalDataRetry) o; return Objects.equals(this.retryChainAttemptNumber, additionalDataRetry.retryChainAttemptNumber) + && Objects.equals( + this.isSetRetryChainAttemptNumber, additionalDataRetry.isSetRetryChainAttemptNumber) && Objects.equals(this.retryOrderAttemptNumber, additionalDataRetry.retryOrderAttemptNumber) - && Objects.equals(this.retrySkipRetry, additionalDataRetry.retrySkipRetry); + && Objects.equals( + this.isSetRetryOrderAttemptNumber, additionalDataRetry.isSetRetryOrderAttemptNumber) + && Objects.equals(this.retrySkipRetry, additionalDataRetry.retrySkipRetry) + && Objects.equals(this.isSetRetrySkipRetry, additionalDataRetry.isSetRetrySkipRetry); } @Override public int hashCode() { - return Objects.hash(retryChainAttemptNumber, retryOrderAttemptNumber, retrySkipRetry); + return Objects.hash( + retryChainAttemptNumber, + isSetRetryChainAttemptNumber, + retryOrderAttemptNumber, + isSetRetryOrderAttemptNumber, + retrySkipRetry, + isSetRetrySkipRetry); } @Override @@ -266,6 +320,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetRetryChainAttemptNumber) { + addIfNull(nulls, JSON_PROPERTY_RETRY_CHAIN_ATTEMPT_NUMBER, this.retryChainAttemptNumber); + } + if (isSetRetryOrderAttemptNumber) { + addIfNull(nulls, JSON_PROPERTY_RETRY_ORDER_ATTEMPT_NUMBER, this.retryOrderAttemptNumber); + } + if (isSetRetrySkipRetry) { + addIfNull(nulls, JSON_PROPERTY_RETRY_SKIP_RETRY, this.retrySkipRetry); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataRetry given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java index f8f352421..6ae0ec0ec 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRisk.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -48,88 +50,157 @@ public class AdditionalDataRisk { "riskdata.[customFieldName]"; private String riskdataCustomFieldName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataCustomFieldName = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_AMOUNT_PER_ITEM = "riskdata.basket.item[itemNr].amountPerItem"; private String riskdataBasketItemItemNrAmountPerItem; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrAmountPerItem = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_BRAND = "riskdata.basket.item[itemNr].brand"; private String riskdataBasketItemItemNrBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrBrand = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CATEGORY = "riskdata.basket.item[itemNr].category"; private String riskdataBasketItemItemNrCategory; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrCategory = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_COLOR = "riskdata.basket.item[itemNr].color"; private String riskdataBasketItemItemNrColor; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrColor = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CURRENCY = "riskdata.basket.item[itemNr].currency"; private String riskdataBasketItemItemNrCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrCurrency = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_ITEM_I_D = "riskdata.basket.item[itemNr].itemID"; private String riskdataBasketItemItemNrItemID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrItemID = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_MANUFACTURER = "riskdata.basket.item[itemNr].manufacturer"; private String riskdataBasketItemItemNrManufacturer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrManufacturer = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_PRODUCT_TITLE = "riskdata.basket.item[itemNr].productTitle"; private String riskdataBasketItemItemNrProductTitle; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrProductTitle = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_QUANTITY = "riskdata.basket.item[itemNr].quantity"; private String riskdataBasketItemItemNrQuantity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrQuantity = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_RECEIVER_EMAIL = "riskdata.basket.item[itemNr].receiverEmail"; private String riskdataBasketItemItemNrReceiverEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrReceiverEmail = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SIZE = "riskdata.basket.item[itemNr].size"; private String riskdataBasketItemItemNrSize; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrSize = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SKU = "riskdata.basket.item[itemNr].sku"; private String riskdataBasketItemItemNrSku; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrSku = false; + public static final String JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_UPC = "riskdata.basket.item[itemNr].upc"; private String riskdataBasketItemItemNrUpc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataBasketItemItemNrUpc = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_CODE = "riskdata.promotions.promotion[itemNr].promotionCode"; private String riskdataPromotionsPromotionItemNrPromotionCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionCode = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_AMOUNT = "riskdata.promotions.promotion[itemNr].promotionDiscountAmount"; private String riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_CURRENCY = "riskdata.promotions.promotion[itemNr].promotionDiscountCurrency"; private String riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_PERCENTAGE = "riskdata.promotions.promotion[itemNr].promotionDiscountPercentage"; private String riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = false; + public static final String JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_NAME = "riskdata.promotions.promotion[itemNr].promotionName"; private String riskdataPromotionsPromotionItemNrPromotionName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataPromotionsPromotionItemNrPromotionName = false; + public static final String JSON_PROPERTY_RISKDATA_RISK_PROFILE_REFERENCE = "riskdata.riskProfileReference"; private String riskdataRiskProfileReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataRiskProfileReference = false; + public static final String JSON_PROPERTY_RISKDATA_SKIP_RISK = "riskdata.skipRisk"; private String riskdataSkipRisk; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskdataSkipRisk = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRisk() {} /** @@ -143,6 +214,7 @@ public AdditionalDataRisk() {} */ public AdditionalDataRisk riskdataCustomFieldName(String riskdataCustomFieldName) { this.riskdataCustomFieldName = riskdataCustomFieldName; + isSetRiskdataCustomFieldName = true; // mark as set return this; } @@ -172,6 +244,7 @@ public String getRiskdataCustomFieldName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataCustomFieldName(String riskdataCustomFieldName) { this.riskdataCustomFieldName = riskdataCustomFieldName; + isSetRiskdataCustomFieldName = true; // mark as set } /** @@ -185,6 +258,7 @@ public void setRiskdataCustomFieldName(String riskdataCustomFieldName) { public AdditionalDataRisk riskdataBasketItemItemNrAmountPerItem( String riskdataBasketItemItemNrAmountPerItem) { this.riskdataBasketItemItemNrAmountPerItem = riskdataBasketItemItemNrAmountPerItem; + isSetRiskdataBasketItemItemNrAmountPerItem = true; // mark as set return this; } @@ -213,6 +287,7 @@ public String getRiskdataBasketItemItemNrAmountPerItem() { public void setRiskdataBasketItemItemNrAmountPerItem( String riskdataBasketItemItemNrAmountPerItem) { this.riskdataBasketItemItemNrAmountPerItem = riskdataBasketItemItemNrAmountPerItem; + isSetRiskdataBasketItemItemNrAmountPerItem = true; // mark as set } /** @@ -223,6 +298,7 @@ public void setRiskdataBasketItemItemNrAmountPerItem( */ public AdditionalDataRisk riskdataBasketItemItemNrBrand(String riskdataBasketItemItemNrBrand) { this.riskdataBasketItemItemNrBrand = riskdataBasketItemItemNrBrand; + isSetRiskdataBasketItemItemNrBrand = true; // mark as set return this; } @@ -246,6 +322,7 @@ public String getRiskdataBasketItemItemNrBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrBrand(String riskdataBasketItemItemNrBrand) { this.riskdataBasketItemItemNrBrand = riskdataBasketItemItemNrBrand; + isSetRiskdataBasketItemItemNrBrand = true; // mark as set } /** @@ -257,6 +334,7 @@ public void setRiskdataBasketItemItemNrBrand(String riskdataBasketItemItemNrBran public AdditionalDataRisk riskdataBasketItemItemNrCategory( String riskdataBasketItemItemNrCategory) { this.riskdataBasketItemItemNrCategory = riskdataBasketItemItemNrCategory; + isSetRiskdataBasketItemItemNrCategory = true; // mark as set return this; } @@ -280,6 +358,7 @@ public String getRiskdataBasketItemItemNrCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrCategory(String riskdataBasketItemItemNrCategory) { this.riskdataBasketItemItemNrCategory = riskdataBasketItemItemNrCategory; + isSetRiskdataBasketItemItemNrCategory = true; // mark as set } /** @@ -290,6 +369,7 @@ public void setRiskdataBasketItemItemNrCategory(String riskdataBasketItemItemNrC */ public AdditionalDataRisk riskdataBasketItemItemNrColor(String riskdataBasketItemItemNrColor) { this.riskdataBasketItemItemNrColor = riskdataBasketItemItemNrColor; + isSetRiskdataBasketItemItemNrColor = true; // mark as set return this; } @@ -313,6 +393,7 @@ public String getRiskdataBasketItemItemNrColor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrColor(String riskdataBasketItemItemNrColor) { this.riskdataBasketItemItemNrColor = riskdataBasketItemItemNrColor; + isSetRiskdataBasketItemItemNrColor = true; // mark as set } /** @@ -325,6 +406,7 @@ public void setRiskdataBasketItemItemNrColor(String riskdataBasketItemItemNrColo public AdditionalDataRisk riskdataBasketItemItemNrCurrency( String riskdataBasketItemItemNrCurrency) { this.riskdataBasketItemItemNrCurrency = riskdataBasketItemItemNrCurrency; + isSetRiskdataBasketItemItemNrCurrency = true; // mark as set return this; } @@ -350,6 +432,7 @@ public String getRiskdataBasketItemItemNrCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrCurrency(String riskdataBasketItemItemNrCurrency) { this.riskdataBasketItemItemNrCurrency = riskdataBasketItemItemNrCurrency; + isSetRiskdataBasketItemItemNrCurrency = true; // mark as set } /** @@ -360,6 +443,7 @@ public void setRiskdataBasketItemItemNrCurrency(String riskdataBasketItemItemNrC */ public AdditionalDataRisk riskdataBasketItemItemNrItemID(String riskdataBasketItemItemNrItemID) { this.riskdataBasketItemItemNrItemID = riskdataBasketItemItemNrItemID; + isSetRiskdataBasketItemItemNrItemID = true; // mark as set return this; } @@ -383,6 +467,7 @@ public String getRiskdataBasketItemItemNrItemID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrItemID(String riskdataBasketItemItemNrItemID) { this.riskdataBasketItemItemNrItemID = riskdataBasketItemItemNrItemID; + isSetRiskdataBasketItemItemNrItemID = true; // mark as set } /** @@ -394,6 +479,7 @@ public void setRiskdataBasketItemItemNrItemID(String riskdataBasketItemItemNrIte public AdditionalDataRisk riskdataBasketItemItemNrManufacturer( String riskdataBasketItemItemNrManufacturer) { this.riskdataBasketItemItemNrManufacturer = riskdataBasketItemItemNrManufacturer; + isSetRiskdataBasketItemItemNrManufacturer = true; // mark as set return this; } @@ -417,6 +503,7 @@ public String getRiskdataBasketItemItemNrManufacturer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrManufacturer(String riskdataBasketItemItemNrManufacturer) { this.riskdataBasketItemItemNrManufacturer = riskdataBasketItemItemNrManufacturer; + isSetRiskdataBasketItemItemNrManufacturer = true; // mark as set } /** @@ -429,6 +516,7 @@ public void setRiskdataBasketItemItemNrManufacturer(String riskdataBasketItemIte public AdditionalDataRisk riskdataBasketItemItemNrProductTitle( String riskdataBasketItemItemNrProductTitle) { this.riskdataBasketItemItemNrProductTitle = riskdataBasketItemItemNrProductTitle; + isSetRiskdataBasketItemItemNrProductTitle = true; // mark as set return this; } @@ -454,6 +542,7 @@ public String getRiskdataBasketItemItemNrProductTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrProductTitle(String riskdataBasketItemItemNrProductTitle) { this.riskdataBasketItemItemNrProductTitle = riskdataBasketItemItemNrProductTitle; + isSetRiskdataBasketItemItemNrProductTitle = true; // mark as set } /** @@ -465,6 +554,7 @@ public void setRiskdataBasketItemItemNrProductTitle(String riskdataBasketItemIte public AdditionalDataRisk riskdataBasketItemItemNrQuantity( String riskdataBasketItemItemNrQuantity) { this.riskdataBasketItemItemNrQuantity = riskdataBasketItemItemNrQuantity; + isSetRiskdataBasketItemItemNrQuantity = true; // mark as set return this; } @@ -488,6 +578,7 @@ public String getRiskdataBasketItemItemNrQuantity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrQuantity(String riskdataBasketItemItemNrQuantity) { this.riskdataBasketItemItemNrQuantity = riskdataBasketItemItemNrQuantity; + isSetRiskdataBasketItemItemNrQuantity = true; // mark as set } /** @@ -500,6 +591,7 @@ public void setRiskdataBasketItemItemNrQuantity(String riskdataBasketItemItemNrQ public AdditionalDataRisk riskdataBasketItemItemNrReceiverEmail( String riskdataBasketItemItemNrReceiverEmail) { this.riskdataBasketItemItemNrReceiverEmail = riskdataBasketItemItemNrReceiverEmail; + isSetRiskdataBasketItemItemNrReceiverEmail = true; // mark as set return this; } @@ -526,6 +618,7 @@ public String getRiskdataBasketItemItemNrReceiverEmail() { public void setRiskdataBasketItemItemNrReceiverEmail( String riskdataBasketItemItemNrReceiverEmail) { this.riskdataBasketItemItemNrReceiverEmail = riskdataBasketItemItemNrReceiverEmail; + isSetRiskdataBasketItemItemNrReceiverEmail = true; // mark as set } /** @@ -536,6 +629,7 @@ public void setRiskdataBasketItemItemNrReceiverEmail( */ public AdditionalDataRisk riskdataBasketItemItemNrSize(String riskdataBasketItemItemNrSize) { this.riskdataBasketItemItemNrSize = riskdataBasketItemItemNrSize; + isSetRiskdataBasketItemItemNrSize = true; // mark as set return this; } @@ -559,6 +653,7 @@ public String getRiskdataBasketItemItemNrSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrSize(String riskdataBasketItemItemNrSize) { this.riskdataBasketItemItemNrSize = riskdataBasketItemItemNrSize; + isSetRiskdataBasketItemItemNrSize = true; // mark as set } /** @@ -570,6 +665,7 @@ public void setRiskdataBasketItemItemNrSize(String riskdataBasketItemItemNrSize) */ public AdditionalDataRisk riskdataBasketItemItemNrSku(String riskdataBasketItemItemNrSku) { this.riskdataBasketItemItemNrSku = riskdataBasketItemItemNrSku; + isSetRiskdataBasketItemItemNrSku = true; // mark as set return this; } @@ -595,6 +691,7 @@ public String getRiskdataBasketItemItemNrSku() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrSku(String riskdataBasketItemItemNrSku) { this.riskdataBasketItemItemNrSku = riskdataBasketItemItemNrSku; + isSetRiskdataBasketItemItemNrSku = true; // mark as set } /** @@ -606,6 +703,7 @@ public void setRiskdataBasketItemItemNrSku(String riskdataBasketItemItemNrSku) { */ public AdditionalDataRisk riskdataBasketItemItemNrUpc(String riskdataBasketItemItemNrUpc) { this.riskdataBasketItemItemNrUpc = riskdataBasketItemItemNrUpc; + isSetRiskdataBasketItemItemNrUpc = true; // mark as set return this; } @@ -631,6 +729,7 @@ public String getRiskdataBasketItemItemNrUpc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataBasketItemItemNrUpc(String riskdataBasketItemItemNrUpc) { this.riskdataBasketItemItemNrUpc = riskdataBasketItemItemNrUpc; + isSetRiskdataBasketItemItemNrUpc = true; // mark as set } /** @@ -643,6 +742,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionCode( String riskdataPromotionsPromotionItemNrPromotionCode) { this.riskdataPromotionsPromotionItemNrPromotionCode = riskdataPromotionsPromotionItemNrPromotionCode; + isSetRiskdataPromotionsPromotionItemNrPromotionCode = true; // mark as set return this; } @@ -668,6 +768,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionCode( String riskdataPromotionsPromotionItemNrPromotionCode) { this.riskdataPromotionsPromotionItemNrPromotionCode = riskdataPromotionsPromotionItemNrPromotionCode; + isSetRiskdataPromotionsPromotionItemNrPromotionCode = true; // mark as set } /** @@ -683,6 +784,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionDiscountAmou String riskdataPromotionsPromotionItemNrPromotionDiscountAmount) { this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount = true; // mark as set return this; } @@ -714,6 +816,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionDiscountAmount( String riskdataPromotionsPromotionItemNrPromotionDiscountAmount) { this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount = riskdataPromotionsPromotionItemNrPromotionDiscountAmount; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount = true; // mark as set } /** @@ -727,6 +830,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionDiscountCurr String riskdataPromotionsPromotionItemNrPromotionDiscountCurrency) { this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = true; // mark as set return this; } @@ -754,6 +858,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency( String riskdataPromotionsPromotionItemNrPromotionDiscountCurrency) { this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency = riskdataPromotionsPromotionItemNrPromotionDiscountCurrency; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency = true; // mark as set } /** @@ -771,6 +876,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionDiscountPerc String riskdataPromotionsPromotionItemNrPromotionDiscountPercentage) { this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = true; // mark as set return this; } @@ -806,6 +912,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage( String riskdataPromotionsPromotionItemNrPromotionDiscountPercentage) { this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage = riskdataPromotionsPromotionItemNrPromotionDiscountPercentage; + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage = true; // mark as set } /** @@ -818,6 +925,7 @@ public AdditionalDataRisk riskdataPromotionsPromotionItemNrPromotionName( String riskdataPromotionsPromotionItemNrPromotionName) { this.riskdataPromotionsPromotionItemNrPromotionName = riskdataPromotionsPromotionItemNrPromotionName; + isSetRiskdataPromotionsPromotionItemNrPromotionName = true; // mark as set return this; } @@ -843,6 +951,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionName( String riskdataPromotionsPromotionItemNrPromotionName) { this.riskdataPromotionsPromotionItemNrPromotionName = riskdataPromotionsPromotionItemNrPromotionName; + isSetRiskdataPromotionsPromotionItemNrPromotionName = true; // mark as set } /** @@ -860,6 +969,7 @@ public void setRiskdataPromotionsPromotionItemNrPromotionName( */ public AdditionalDataRisk riskdataRiskProfileReference(String riskdataRiskProfileReference) { this.riskdataRiskProfileReference = riskdataRiskProfileReference; + isSetRiskdataRiskProfileReference = true; // mark as set return this; } @@ -897,6 +1007,7 @@ public String getRiskdataRiskProfileReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataRiskProfileReference(String riskdataRiskProfileReference) { this.riskdataRiskProfileReference = riskdataRiskProfileReference; + isSetRiskdataRiskProfileReference = true; // mark as set } /** @@ -909,6 +1020,7 @@ public void setRiskdataRiskProfileReference(String riskdataRiskProfileReference) */ public AdditionalDataRisk riskdataSkipRisk(String riskdataSkipRisk) { this.riskdataSkipRisk = riskdataSkipRisk; + isSetRiskdataSkipRisk = true; // mark as set return this; } @@ -936,6 +1048,27 @@ public String getRiskdataSkipRisk() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskdataSkipRisk(String riskdataSkipRisk) { this.riskdataSkipRisk = riskdataSkipRisk; + isSetRiskdataSkipRisk = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRisk includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataRisk object is equal to o. */ @@ -949,83 +1082,164 @@ public boolean equals(Object o) { } AdditionalDataRisk additionalDataRisk = (AdditionalDataRisk) o; return Objects.equals(this.riskdataCustomFieldName, additionalDataRisk.riskdataCustomFieldName) + && Objects.equals( + this.isSetRiskdataCustomFieldName, additionalDataRisk.isSetRiskdataCustomFieldName) && Objects.equals( this.riskdataBasketItemItemNrAmountPerItem, additionalDataRisk.riskdataBasketItemItemNrAmountPerItem) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrAmountPerItem, + additionalDataRisk.isSetRiskdataBasketItemItemNrAmountPerItem) && Objects.equals( this.riskdataBasketItemItemNrBrand, additionalDataRisk.riskdataBasketItemItemNrBrand) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrBrand, + additionalDataRisk.isSetRiskdataBasketItemItemNrBrand) && Objects.equals( this.riskdataBasketItemItemNrCategory, additionalDataRisk.riskdataBasketItemItemNrCategory) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrCategory, + additionalDataRisk.isSetRiskdataBasketItemItemNrCategory) && Objects.equals( this.riskdataBasketItemItemNrColor, additionalDataRisk.riskdataBasketItemItemNrColor) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrColor, + additionalDataRisk.isSetRiskdataBasketItemItemNrColor) && Objects.equals( this.riskdataBasketItemItemNrCurrency, additionalDataRisk.riskdataBasketItemItemNrCurrency) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrCurrency, + additionalDataRisk.isSetRiskdataBasketItemItemNrCurrency) && Objects.equals( this.riskdataBasketItemItemNrItemID, additionalDataRisk.riskdataBasketItemItemNrItemID) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrItemID, + additionalDataRisk.isSetRiskdataBasketItemItemNrItemID) && Objects.equals( this.riskdataBasketItemItemNrManufacturer, additionalDataRisk.riskdataBasketItemItemNrManufacturer) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrManufacturer, + additionalDataRisk.isSetRiskdataBasketItemItemNrManufacturer) && Objects.equals( this.riskdataBasketItemItemNrProductTitle, additionalDataRisk.riskdataBasketItemItemNrProductTitle) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrProductTitle, + additionalDataRisk.isSetRiskdataBasketItemItemNrProductTitle) && Objects.equals( this.riskdataBasketItemItemNrQuantity, additionalDataRisk.riskdataBasketItemItemNrQuantity) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrQuantity, + additionalDataRisk.isSetRiskdataBasketItemItemNrQuantity) && Objects.equals( this.riskdataBasketItemItemNrReceiverEmail, additionalDataRisk.riskdataBasketItemItemNrReceiverEmail) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrReceiverEmail, + additionalDataRisk.isSetRiskdataBasketItemItemNrReceiverEmail) && Objects.equals( this.riskdataBasketItemItemNrSize, additionalDataRisk.riskdataBasketItemItemNrSize) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrSize, + additionalDataRisk.isSetRiskdataBasketItemItemNrSize) && Objects.equals( this.riskdataBasketItemItemNrSku, additionalDataRisk.riskdataBasketItemItemNrSku) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrSku, + additionalDataRisk.isSetRiskdataBasketItemItemNrSku) && Objects.equals( this.riskdataBasketItemItemNrUpc, additionalDataRisk.riskdataBasketItemItemNrUpc) + && Objects.equals( + this.isSetRiskdataBasketItemItemNrUpc, + additionalDataRisk.isSetRiskdataBasketItemItemNrUpc) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionCode, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionCode) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionCode, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionCode) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionDiscountAmount) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage) && Objects.equals( this.riskdataPromotionsPromotionItemNrPromotionName, additionalDataRisk.riskdataPromotionsPromotionItemNrPromotionName) + && Objects.equals( + this.isSetRiskdataPromotionsPromotionItemNrPromotionName, + additionalDataRisk.isSetRiskdataPromotionsPromotionItemNrPromotionName) && Objects.equals( this.riskdataRiskProfileReference, additionalDataRisk.riskdataRiskProfileReference) - && Objects.equals(this.riskdataSkipRisk, additionalDataRisk.riskdataSkipRisk); + && Objects.equals( + this.isSetRiskdataRiskProfileReference, + additionalDataRisk.isSetRiskdataRiskProfileReference) + && Objects.equals(this.riskdataSkipRisk, additionalDataRisk.riskdataSkipRisk) + && Objects.equals(this.isSetRiskdataSkipRisk, additionalDataRisk.isSetRiskdataSkipRisk); } @Override public int hashCode() { return Objects.hash( riskdataCustomFieldName, + isSetRiskdataCustomFieldName, riskdataBasketItemItemNrAmountPerItem, + isSetRiskdataBasketItemItemNrAmountPerItem, riskdataBasketItemItemNrBrand, + isSetRiskdataBasketItemItemNrBrand, riskdataBasketItemItemNrCategory, + isSetRiskdataBasketItemItemNrCategory, riskdataBasketItemItemNrColor, + isSetRiskdataBasketItemItemNrColor, riskdataBasketItemItemNrCurrency, + isSetRiskdataBasketItemItemNrCurrency, riskdataBasketItemItemNrItemID, + isSetRiskdataBasketItemItemNrItemID, riskdataBasketItemItemNrManufacturer, + isSetRiskdataBasketItemItemNrManufacturer, riskdataBasketItemItemNrProductTitle, + isSetRiskdataBasketItemItemNrProductTitle, riskdataBasketItemItemNrQuantity, + isSetRiskdataBasketItemItemNrQuantity, riskdataBasketItemItemNrReceiverEmail, + isSetRiskdataBasketItemItemNrReceiverEmail, riskdataBasketItemItemNrSize, + isSetRiskdataBasketItemItemNrSize, riskdataBasketItemItemNrSku, + isSetRiskdataBasketItemItemNrSku, riskdataBasketItemItemNrUpc, + isSetRiskdataBasketItemItemNrUpc, riskdataPromotionsPromotionItemNrPromotionCode, + isSetRiskdataPromotionsPromotionItemNrPromotionCode, riskdataPromotionsPromotionItemNrPromotionDiscountAmount, + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount, riskdataPromotionsPromotionItemNrPromotionDiscountCurrency, + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency, riskdataPromotionsPromotionItemNrPromotionDiscountPercentage, + isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage, riskdataPromotionsPromotionItemNrPromotionName, + isSetRiskdataPromotionsPromotionItemNrPromotionName, riskdataRiskProfileReference, - riskdataSkipRisk); + isSetRiskdataRiskProfileReference, + riskdataSkipRisk, + isSetRiskdataSkipRisk); } @Override @@ -1107,6 +1321,141 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetRiskdataCustomFieldName) { + addIfNull(nulls, JSON_PROPERTY_RISKDATA_CUSTOM_FIELD_NAME, this.riskdataCustomFieldName); + } + if (isSetRiskdataBasketItemItemNrAmountPerItem) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_AMOUNT_PER_ITEM, + this.riskdataBasketItemItemNrAmountPerItem); + } + if (isSetRiskdataBasketItemItemNrBrand) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_BRAND, + this.riskdataBasketItemItemNrBrand); + } + if (isSetRiskdataBasketItemItemNrCategory) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CATEGORY, + this.riskdataBasketItemItemNrCategory); + } + if (isSetRiskdataBasketItemItemNrColor) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_COLOR, + this.riskdataBasketItemItemNrColor); + } + if (isSetRiskdataBasketItemItemNrCurrency) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_CURRENCY, + this.riskdataBasketItemItemNrCurrency); + } + if (isSetRiskdataBasketItemItemNrItemID) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_ITEM_I_D, + this.riskdataBasketItemItemNrItemID); + } + if (isSetRiskdataBasketItemItemNrManufacturer) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_MANUFACTURER, + this.riskdataBasketItemItemNrManufacturer); + } + if (isSetRiskdataBasketItemItemNrProductTitle) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_PRODUCT_TITLE, + this.riskdataBasketItemItemNrProductTitle); + } + if (isSetRiskdataBasketItemItemNrQuantity) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_QUANTITY, + this.riskdataBasketItemItemNrQuantity); + } + if (isSetRiskdataBasketItemItemNrReceiverEmail) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_RECEIVER_EMAIL, + this.riskdataBasketItemItemNrReceiverEmail); + } + if (isSetRiskdataBasketItemItemNrSize) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SIZE, + this.riskdataBasketItemItemNrSize); + } + if (isSetRiskdataBasketItemItemNrSku) { + addIfNull( + nulls, JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_SKU, this.riskdataBasketItemItemNrSku); + } + if (isSetRiskdataBasketItemItemNrUpc) { + addIfNull( + nulls, JSON_PROPERTY_RISKDATA_BASKET_ITEM_ITEM_NR_UPC, this.riskdataBasketItemItemNrUpc); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionCode) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_CODE, + this.riskdataPromotionsPromotionItemNrPromotionCode); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionDiscountAmount) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_AMOUNT, + this.riskdataPromotionsPromotionItemNrPromotionDiscountAmount); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionDiscountCurrency) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_CURRENCY, + this.riskdataPromotionsPromotionItemNrPromotionDiscountCurrency); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionDiscountPercentage) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_DISCOUNT_PERCENTAGE, + this.riskdataPromotionsPromotionItemNrPromotionDiscountPercentage); + } + if (isSetRiskdataPromotionsPromotionItemNrPromotionName) { + addIfNull( + nulls, + JSON_PROPERTY_RISKDATA_PROMOTIONS_PROMOTION_ITEM_NR_PROMOTION_NAME, + this.riskdataPromotionsPromotionItemNrPromotionName); + } + if (isSetRiskdataRiskProfileReference) { + addIfNull( + nulls, JSON_PROPERTY_RISKDATA_RISK_PROFILE_REFERENCE, this.riskdataRiskProfileReference); + } + if (isSetRiskdataSkipRisk) { + addIfNull(nulls, JSON_PROPERTY_RISKDATA_SKIP_RISK, this.riskdataSkipRisk); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataRisk given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java b/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java index b3afd2db9..5c0f37d03 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataRiskStandalone.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,49 +41,100 @@ public class AdditionalDataRiskStandalone { public static final String JSON_PROPERTY_PAY_PAL_COUNTRY_CODE = "PayPal.CountryCode"; private String payPalCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalCountryCode = false; + public static final String JSON_PROPERTY_PAY_PAL_EMAIL_ID = "PayPal.EmailId"; private String payPalEmailId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalEmailId = false; + public static final String JSON_PROPERTY_PAY_PAL_FIRST_NAME = "PayPal.FirstName"; private String payPalFirstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalFirstName = false; + public static final String JSON_PROPERTY_PAY_PAL_LAST_NAME = "PayPal.LastName"; private String payPalLastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalLastName = false; + public static final String JSON_PROPERTY_PAY_PAL_PAYER_ID = "PayPal.PayerId"; private String payPalPayerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalPayerId = false; + public static final String JSON_PROPERTY_PAY_PAL_PHONE = "PayPal.Phone"; private String payPalPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalPhone = false; + public static final String JSON_PROPERTY_PAY_PAL_PROTECTION_ELIGIBILITY = "PayPal.ProtectionEligibility"; private String payPalProtectionEligibility; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalProtectionEligibility = false; + public static final String JSON_PROPERTY_PAY_PAL_TRANSACTION_ID = "PayPal.TransactionId"; private String payPalTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayPalTransactionId = false; + public static final String JSON_PROPERTY_AVS_RESULT_RAW = "avsResultRaw"; private String avsResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvsResultRaw = false; + public static final String JSON_PROPERTY_BIN = "bin"; private String bin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBin = false; + public static final String JSON_PROPERTY_CVC_RESULT_RAW = "cvcResultRaw"; private String cvcResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvcResultRaw = false; + public static final String JSON_PROPERTY_RISK_TOKEN = "riskToken"; private String riskToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskToken = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED = "threeDAuthenticated"; private String threeDAuthenticated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticated = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED = "threeDOffered"; private String threeDOffered; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOffered = false; + public static final String JSON_PROPERTY_TOKEN_DATA_TYPE = "tokenDataType"; private String tokenDataType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenDataType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataRiskStandalone() {} /** @@ -93,6 +146,7 @@ public AdditionalDataRiskStandalone() {} */ public AdditionalDataRiskStandalone payPalCountryCode(String payPalCountryCode) { this.payPalCountryCode = payPalCountryCode; + isSetPayPalCountryCode = true; // mark as set return this; } @@ -118,6 +172,7 @@ public String getPayPalCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalCountryCode(String payPalCountryCode) { this.payPalCountryCode = payPalCountryCode; + isSetPayPalCountryCode = true; // mark as set } /** @@ -128,6 +183,7 @@ public void setPayPalCountryCode(String payPalCountryCode) { */ public AdditionalDataRiskStandalone payPalEmailId(String payPalEmailId) { this.payPalEmailId = payPalEmailId; + isSetPayPalEmailId = true; // mark as set return this; } @@ -151,6 +207,7 @@ public String getPayPalEmailId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalEmailId(String payPalEmailId) { this.payPalEmailId = payPalEmailId; + isSetPayPalEmailId = true; // mark as set } /** @@ -161,6 +218,7 @@ public void setPayPalEmailId(String payPalEmailId) { */ public AdditionalDataRiskStandalone payPalFirstName(String payPalFirstName) { this.payPalFirstName = payPalFirstName; + isSetPayPalFirstName = true; // mark as set return this; } @@ -184,6 +242,7 @@ public String getPayPalFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalFirstName(String payPalFirstName) { this.payPalFirstName = payPalFirstName; + isSetPayPalFirstName = true; // mark as set } /** @@ -194,6 +253,7 @@ public void setPayPalFirstName(String payPalFirstName) { */ public AdditionalDataRiskStandalone payPalLastName(String payPalLastName) { this.payPalLastName = payPalLastName; + isSetPayPalLastName = true; // mark as set return this; } @@ -217,6 +277,7 @@ public String getPayPalLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalLastName(String payPalLastName) { this.payPalLastName = payPalLastName; + isSetPayPalLastName = true; // mark as set } /** @@ -229,6 +290,7 @@ public void setPayPalLastName(String payPalLastName) { */ public AdditionalDataRiskStandalone payPalPayerId(String payPalPayerId) { this.payPalPayerId = payPalPayerId; + isSetPayPalPayerId = true; // mark as set return this; } @@ -256,6 +318,7 @@ public String getPayPalPayerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalPayerId(String payPalPayerId) { this.payPalPayerId = payPalPayerId; + isSetPayPalPayerId = true; // mark as set } /** @@ -266,6 +329,7 @@ public void setPayPalPayerId(String payPalPayerId) { */ public AdditionalDataRiskStandalone payPalPhone(String payPalPhone) { this.payPalPhone = payPalPhone; + isSetPayPalPhone = true; // mark as set return this; } @@ -289,6 +353,7 @@ public String getPayPalPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalPhone(String payPalPhone) { this.payPalPhone = payPalPhone; + isSetPayPalPhone = true; // mark as set } /** @@ -307,6 +372,7 @@ public void setPayPalPhone(String payPalPhone) { public AdditionalDataRiskStandalone payPalProtectionEligibility( String payPalProtectionEligibility) { this.payPalProtectionEligibility = payPalProtectionEligibility; + isSetPayPalProtectionEligibility = true; // mark as set return this; } @@ -344,6 +410,7 @@ public String getPayPalProtectionEligibility() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalProtectionEligibility(String payPalProtectionEligibility) { this.payPalProtectionEligibility = payPalProtectionEligibility; + isSetPayPalProtectionEligibility = true; // mark as set } /** @@ -354,6 +421,7 @@ public void setPayPalProtectionEligibility(String payPalProtectionEligibility) { */ public AdditionalDataRiskStandalone payPalTransactionId(String payPalTransactionId) { this.payPalTransactionId = payPalTransactionId; + isSetPayPalTransactionId = true; // mark as set return this; } @@ -377,6 +445,7 @@ public String getPayPalTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayPalTransactionId(String payPalTransactionId) { this.payPalTransactionId = payPalTransactionId; + isSetPayPalTransactionId = true; // mark as set } /** @@ -387,6 +456,7 @@ public void setPayPalTransactionId(String payPalTransactionId) { */ public AdditionalDataRiskStandalone avsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set return this; } @@ -410,6 +480,7 @@ public String getAvsResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set } /** @@ -424,6 +495,7 @@ public void setAvsResultRaw(String avsResultRaw) { */ public AdditionalDataRiskStandalone bin(String bin) { this.bin = bin; + isSetBin = true; // mark as set return this; } @@ -455,6 +527,7 @@ public String getBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBin(String bin) { this.bin = bin; + isSetBin = true; // mark as set } /** @@ -465,6 +538,7 @@ public void setBin(String bin) { */ public AdditionalDataRiskStandalone cvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set return this; } @@ -488,6 +562,7 @@ public String getCvcResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set } /** @@ -498,6 +573,7 @@ public void setCvcResultRaw(String cvcResultRaw) { */ public AdditionalDataRiskStandalone riskToken(String riskToken) { this.riskToken = riskToken; + isSetRiskToken = true; // mark as set return this; } @@ -521,6 +597,7 @@ public String getRiskToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskToken(String riskToken) { this.riskToken = riskToken; + isSetRiskToken = true; // mark as set } /** @@ -533,6 +610,7 @@ public void setRiskToken(String riskToken) { */ public AdditionalDataRiskStandalone threeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set return this; } @@ -560,6 +638,7 @@ public String getThreeDAuthenticated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set } /** @@ -571,6 +650,7 @@ public void setThreeDAuthenticated(String threeDAuthenticated) { */ public AdditionalDataRiskStandalone threeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set return this; } @@ -596,6 +676,7 @@ public String getThreeDOffered() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set } /** @@ -607,6 +688,7 @@ public void setThreeDOffered(String threeDOffered) { */ public AdditionalDataRiskStandalone tokenDataType(String tokenDataType) { this.tokenDataType = tokenDataType; + isSetTokenDataType = true; // mark as set return this; } @@ -632,6 +714,27 @@ public String getTokenDataType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenDataType(String tokenDataType) { this.tokenDataType = tokenDataType; + isSetTokenDataType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataRiskStandalone includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataRiskStandalone object is equal to o. */ @@ -645,44 +748,81 @@ public boolean equals(Object o) { } AdditionalDataRiskStandalone additionalDataRiskStandalone = (AdditionalDataRiskStandalone) o; return Objects.equals(this.payPalCountryCode, additionalDataRiskStandalone.payPalCountryCode) + && Objects.equals( + this.isSetPayPalCountryCode, additionalDataRiskStandalone.isSetPayPalCountryCode) && Objects.equals(this.payPalEmailId, additionalDataRiskStandalone.payPalEmailId) + && Objects.equals(this.isSetPayPalEmailId, additionalDataRiskStandalone.isSetPayPalEmailId) && Objects.equals(this.payPalFirstName, additionalDataRiskStandalone.payPalFirstName) + && Objects.equals( + this.isSetPayPalFirstName, additionalDataRiskStandalone.isSetPayPalFirstName) && Objects.equals(this.payPalLastName, additionalDataRiskStandalone.payPalLastName) + && Objects.equals( + this.isSetPayPalLastName, additionalDataRiskStandalone.isSetPayPalLastName) && Objects.equals(this.payPalPayerId, additionalDataRiskStandalone.payPalPayerId) + && Objects.equals(this.isSetPayPalPayerId, additionalDataRiskStandalone.isSetPayPalPayerId) && Objects.equals(this.payPalPhone, additionalDataRiskStandalone.payPalPhone) + && Objects.equals(this.isSetPayPalPhone, additionalDataRiskStandalone.isSetPayPalPhone) && Objects.equals( this.payPalProtectionEligibility, additionalDataRiskStandalone.payPalProtectionEligibility) + && Objects.equals( + this.isSetPayPalProtectionEligibility, + additionalDataRiskStandalone.isSetPayPalProtectionEligibility) && Objects.equals( this.payPalTransactionId, additionalDataRiskStandalone.payPalTransactionId) + && Objects.equals( + this.isSetPayPalTransactionId, additionalDataRiskStandalone.isSetPayPalTransactionId) && Objects.equals(this.avsResultRaw, additionalDataRiskStandalone.avsResultRaw) + && Objects.equals(this.isSetAvsResultRaw, additionalDataRiskStandalone.isSetAvsResultRaw) && Objects.equals(this.bin, additionalDataRiskStandalone.bin) + && Objects.equals(this.isSetBin, additionalDataRiskStandalone.isSetBin) && Objects.equals(this.cvcResultRaw, additionalDataRiskStandalone.cvcResultRaw) + && Objects.equals(this.isSetCvcResultRaw, additionalDataRiskStandalone.isSetCvcResultRaw) && Objects.equals(this.riskToken, additionalDataRiskStandalone.riskToken) + && Objects.equals(this.isSetRiskToken, additionalDataRiskStandalone.isSetRiskToken) && Objects.equals( this.threeDAuthenticated, additionalDataRiskStandalone.threeDAuthenticated) + && Objects.equals( + this.isSetThreeDAuthenticated, additionalDataRiskStandalone.isSetThreeDAuthenticated) && Objects.equals(this.threeDOffered, additionalDataRiskStandalone.threeDOffered) - && Objects.equals(this.tokenDataType, additionalDataRiskStandalone.tokenDataType); + && Objects.equals(this.isSetThreeDOffered, additionalDataRiskStandalone.isSetThreeDOffered) + && Objects.equals(this.tokenDataType, additionalDataRiskStandalone.tokenDataType) + && Objects.equals(this.isSetTokenDataType, additionalDataRiskStandalone.isSetTokenDataType); } @Override public int hashCode() { return Objects.hash( payPalCountryCode, + isSetPayPalCountryCode, payPalEmailId, + isSetPayPalEmailId, payPalFirstName, + isSetPayPalFirstName, payPalLastName, + isSetPayPalLastName, payPalPayerId, + isSetPayPalPayerId, payPalPhone, + isSetPayPalPhone, payPalProtectionEligibility, + isSetPayPalProtectionEligibility, payPalTransactionId, + isSetPayPalTransactionId, avsResultRaw, + isSetAvsResultRaw, bin, + isSetBin, cvcResultRaw, + isSetCvcResultRaw, riskToken, + isSetRiskToken, threeDAuthenticated, + isSetThreeDAuthenticated, threeDOffered, - tokenDataType); + isSetThreeDOffered, + tokenDataType, + isSetTokenDataType); } @Override @@ -724,6 +864,73 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPayPalCountryCode) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_COUNTRY_CODE, this.payPalCountryCode); + } + if (isSetPayPalEmailId) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_EMAIL_ID, this.payPalEmailId); + } + if (isSetPayPalFirstName) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_FIRST_NAME, this.payPalFirstName); + } + if (isSetPayPalLastName) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_LAST_NAME, this.payPalLastName); + } + if (isSetPayPalPayerId) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_PAYER_ID, this.payPalPayerId); + } + if (isSetPayPalPhone) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_PHONE, this.payPalPhone); + } + if (isSetPayPalProtectionEligibility) { + addIfNull( + nulls, JSON_PROPERTY_PAY_PAL_PROTECTION_ELIGIBILITY, this.payPalProtectionEligibility); + } + if (isSetPayPalTransactionId) { + addIfNull(nulls, JSON_PROPERTY_PAY_PAL_TRANSACTION_ID, this.payPalTransactionId); + } + if (isSetAvsResultRaw) { + addIfNull(nulls, JSON_PROPERTY_AVS_RESULT_RAW, this.avsResultRaw); + } + if (isSetBin) { + addIfNull(nulls, JSON_PROPERTY_BIN, this.bin); + } + if (isSetCvcResultRaw) { + addIfNull(nulls, JSON_PROPERTY_CVC_RESULT_RAW, this.cvcResultRaw); + } + if (isSetRiskToken) { + addIfNull(nulls, JSON_PROPERTY_RISK_TOKEN, this.riskToken); + } + if (isSetThreeDAuthenticated) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED, this.threeDAuthenticated); + } + if (isSetThreeDOffered) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED, this.threeDOffered); + } + if (isSetTokenDataType) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_DATA_TYPE, this.tokenDataType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataRiskStandalone given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java b/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java index b4fd35e7c..99158c3a3 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataSubMerchant.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,50 +39,92 @@ public class AdditionalDataSubMerchant { "subMerchant.numberOfSubSellers"; private String subMerchantNumberOfSubSellers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantNumberOfSubSellers = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_CITY = "subMerchant.subSeller[subSellerNr].city"; private String subMerchantSubSellerSubSellerNrCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrCity = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_COUNTRY = "subMerchant.subSeller[subSellerNr].country"; private String subMerchantSubSellerSubSellerNrCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrCountry = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_EMAIL = "subMerchant.subSeller[subSellerNr].email"; private String subMerchantSubSellerSubSellerNrEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrEmail = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_ID = "subMerchant.subSeller[subSellerNr].id"; private String subMerchantSubSellerSubSellerNrId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrId = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_MCC = "subMerchant.subSeller[subSellerNr].mcc"; private String subMerchantSubSellerSubSellerNrMcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrMcc = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_NAME = "subMerchant.subSeller[subSellerNr].name"; private String subMerchantSubSellerSubSellerNrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrName = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_PHONE_NUMBER = "subMerchant.subSeller[subSellerNr].phoneNumber"; private String subMerchantSubSellerSubSellerNrPhoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrPhoneNumber = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_POSTAL_CODE = "subMerchant.subSeller[subSellerNr].postalCode"; private String subMerchantSubSellerSubSellerNrPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrPostalCode = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STATE = "subMerchant.subSeller[subSellerNr].state"; private String subMerchantSubSellerSubSellerNrState; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrState = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STREET = "subMerchant.subSeller[subSellerNr].street"; private String subMerchantSubSellerSubSellerNrStreet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrStreet = false; + public static final String JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_TAX_ID = "subMerchant.subSeller[subSellerNr].taxId"; private String subMerchantSubSellerSubSellerNrTaxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantSubSellerSubSellerNrTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataSubMerchant() {} /** @@ -95,6 +139,7 @@ public AdditionalDataSubMerchant() {} public AdditionalDataSubMerchant subMerchantNumberOfSubSellers( String subMerchantNumberOfSubSellers) { this.subMerchantNumberOfSubSellers = subMerchantNumberOfSubSellers; + isSetSubMerchantNumberOfSubSellers = true; // mark as set return this; } @@ -124,6 +169,7 @@ public String getSubMerchantNumberOfSubSellers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantNumberOfSubSellers(String subMerchantNumberOfSubSellers) { this.subMerchantNumberOfSubSellers = subMerchantNumberOfSubSellers; + isSetSubMerchantNumberOfSubSellers = true; // mark as set } /** @@ -138,6 +184,7 @@ public void setSubMerchantNumberOfSubSellers(String subMerchantNumberOfSubSeller public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrCity( String subMerchantSubSellerSubSellerNrCity) { this.subMerchantSubSellerSubSellerNrCity = subMerchantSubSellerSubSellerNrCity; + isSetSubMerchantSubSellerSubSellerNrCity = true; // mark as set return this; } @@ -167,6 +214,7 @@ public String getSubMerchantSubSellerSubSellerNrCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrCity(String subMerchantSubSellerSubSellerNrCity) { this.subMerchantSubSellerSubSellerNrCity = subMerchantSubSellerSubSellerNrCity; + isSetSubMerchantSubSellerSubSellerNrCity = true; // mark as set } /** @@ -183,6 +231,7 @@ public void setSubMerchantSubSellerSubSellerNrCity(String subMerchantSubSellerSu public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrCountry( String subMerchantSubSellerSubSellerNrCountry) { this.subMerchantSubSellerSubSellerNrCountry = subMerchantSubSellerSubSellerNrCountry; + isSetSubMerchantSubSellerSubSellerNrCountry = true; // mark as set return this; } @@ -217,6 +266,7 @@ public String getSubMerchantSubSellerSubSellerNrCountry() { public void setSubMerchantSubSellerSubSellerNrCountry( String subMerchantSubSellerSubSellerNrCountry) { this.subMerchantSubSellerSubSellerNrCountry = subMerchantSubSellerSubSellerNrCountry; + isSetSubMerchantSubSellerSubSellerNrCountry = true; // mark as set } /** @@ -231,6 +281,7 @@ public void setSubMerchantSubSellerSubSellerNrCountry( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrEmail( String subMerchantSubSellerSubSellerNrEmail) { this.subMerchantSubSellerSubSellerNrEmail = subMerchantSubSellerSubSellerNrEmail; + isSetSubMerchantSubSellerSubSellerNrEmail = true; // mark as set return this; } @@ -260,6 +311,7 @@ public String getSubMerchantSubSellerSubSellerNrEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrEmail(String subMerchantSubSellerSubSellerNrEmail) { this.subMerchantSubSellerSubSellerNrEmail = subMerchantSubSellerSubSellerNrEmail; + isSetSubMerchantSubSellerSubSellerNrEmail = true; // mark as set } /** @@ -276,6 +328,7 @@ public void setSubMerchantSubSellerSubSellerNrEmail(String subMerchantSubSellerS public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrId( String subMerchantSubSellerSubSellerNrId) { this.subMerchantSubSellerSubSellerNrId = subMerchantSubSellerSubSellerNrId; + isSetSubMerchantSubSellerSubSellerNrId = true; // mark as set return this; } @@ -309,6 +362,7 @@ public String getSubMerchantSubSellerSubSellerNrId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrId(String subMerchantSubSellerSubSellerNrId) { this.subMerchantSubSellerSubSellerNrId = subMerchantSubSellerSubSellerNrId; + isSetSubMerchantSubSellerSubSellerNrId = true; // mark as set } /** @@ -323,6 +377,7 @@ public void setSubMerchantSubSellerSubSellerNrId(String subMerchantSubSellerSubS public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrMcc( String subMerchantSubSellerSubSellerNrMcc) { this.subMerchantSubSellerSubSellerNrMcc = subMerchantSubSellerSubSellerNrMcc; + isSetSubMerchantSubSellerSubSellerNrMcc = true; // mark as set return this; } @@ -352,6 +407,7 @@ public String getSubMerchantSubSellerSubSellerNrMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrMcc(String subMerchantSubSellerSubSellerNrMcc) { this.subMerchantSubSellerSubSellerNrMcc = subMerchantSubSellerSubSellerNrMcc; + isSetSubMerchantSubSellerSubSellerNrMcc = true; // mark as set } /** @@ -370,6 +426,7 @@ public void setSubMerchantSubSellerSubSellerNrMcc(String subMerchantSubSellerSub public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrName( String subMerchantSubSellerSubSellerNrName) { this.subMerchantSubSellerSubSellerNrName = subMerchantSubSellerSubSellerNrName; + isSetSubMerchantSubSellerSubSellerNrName = true; // mark as set return this; } @@ -407,6 +464,7 @@ public String getSubMerchantSubSellerSubSellerNrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrName(String subMerchantSubSellerSubSellerNrName) { this.subMerchantSubSellerSubSellerNrName = subMerchantSubSellerSubSellerNrName; + isSetSubMerchantSubSellerSubSellerNrName = true; // mark as set } /** @@ -421,6 +479,7 @@ public void setSubMerchantSubSellerSubSellerNrName(String subMerchantSubSellerSu public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrPhoneNumber( String subMerchantSubSellerSubSellerNrPhoneNumber) { this.subMerchantSubSellerSubSellerNrPhoneNumber = subMerchantSubSellerSubSellerNrPhoneNumber; + isSetSubMerchantSubSellerSubSellerNrPhoneNumber = true; // mark as set return this; } @@ -451,6 +510,7 @@ public String getSubMerchantSubSellerSubSellerNrPhoneNumber() { public void setSubMerchantSubSellerSubSellerNrPhoneNumber( String subMerchantSubSellerSubSellerNrPhoneNumber) { this.subMerchantSubSellerSubSellerNrPhoneNumber = subMerchantSubSellerSubSellerNrPhoneNumber; + isSetSubMerchantSubSellerSubSellerNrPhoneNumber = true; // mark as set } /** @@ -465,6 +525,7 @@ public void setSubMerchantSubSellerSubSellerNrPhoneNumber( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrPostalCode( String subMerchantSubSellerSubSellerNrPostalCode) { this.subMerchantSubSellerSubSellerNrPostalCode = subMerchantSubSellerSubSellerNrPostalCode; + isSetSubMerchantSubSellerSubSellerNrPostalCode = true; // mark as set return this; } @@ -495,6 +556,7 @@ public String getSubMerchantSubSellerSubSellerNrPostalCode() { public void setSubMerchantSubSellerSubSellerNrPostalCode( String subMerchantSubSellerSubSellerNrPostalCode) { this.subMerchantSubSellerSubSellerNrPostalCode = subMerchantSubSellerSubSellerNrPostalCode; + isSetSubMerchantSubSellerSubSellerNrPostalCode = true; // mark as set } /** @@ -510,6 +572,7 @@ public void setSubMerchantSubSellerSubSellerNrPostalCode( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrState( String subMerchantSubSellerSubSellerNrState) { this.subMerchantSubSellerSubSellerNrState = subMerchantSubSellerSubSellerNrState; + isSetSubMerchantSubSellerSubSellerNrState = true; // mark as set return this; } @@ -541,6 +604,7 @@ public String getSubMerchantSubSellerSubSellerNrState() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrState(String subMerchantSubSellerSubSellerNrState) { this.subMerchantSubSellerSubSellerNrState = subMerchantSubSellerSubSellerNrState; + isSetSubMerchantSubSellerSubSellerNrState = true; // mark as set } /** @@ -556,6 +620,7 @@ public void setSubMerchantSubSellerSubSellerNrState(String subMerchantSubSellerS public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrStreet( String subMerchantSubSellerSubSellerNrStreet) { this.subMerchantSubSellerSubSellerNrStreet = subMerchantSubSellerSubSellerNrStreet; + isSetSubMerchantSubSellerSubSellerNrStreet = true; // mark as set return this; } @@ -588,6 +653,7 @@ public String getSubMerchantSubSellerSubSellerNrStreet() { public void setSubMerchantSubSellerSubSellerNrStreet( String subMerchantSubSellerSubSellerNrStreet) { this.subMerchantSubSellerSubSellerNrStreet = subMerchantSubSellerSubSellerNrStreet; + isSetSubMerchantSubSellerSubSellerNrStreet = true; // mark as set } /** @@ -602,6 +668,7 @@ public void setSubMerchantSubSellerSubSellerNrStreet( public AdditionalDataSubMerchant subMerchantSubSellerSubSellerNrTaxId( String subMerchantSubSellerSubSellerNrTaxId) { this.subMerchantSubSellerSubSellerNrTaxId = subMerchantSubSellerSubSellerNrTaxId; + isSetSubMerchantSubSellerSubSellerNrTaxId = true; // mark as set return this; } @@ -631,6 +698,27 @@ public String getSubMerchantSubSellerSubSellerNrTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchantSubSellerSubSellerNrTaxId(String subMerchantSubSellerSubSellerNrTaxId) { this.subMerchantSubSellerSubSellerNrTaxId = subMerchantSubSellerSubSellerNrTaxId; + isSetSubMerchantSubSellerSubSellerNrTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataSubMerchant includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataSubMerchant object is equal to o. */ @@ -646,56 +734,104 @@ public boolean equals(Object o) { return Objects.equals( this.subMerchantNumberOfSubSellers, additionalDataSubMerchant.subMerchantNumberOfSubSellers) + && Objects.equals( + this.isSetSubMerchantNumberOfSubSellers, + additionalDataSubMerchant.isSetSubMerchantNumberOfSubSellers) && Objects.equals( this.subMerchantSubSellerSubSellerNrCity, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrCity) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrCity, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrCity) && Objects.equals( this.subMerchantSubSellerSubSellerNrCountry, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrCountry) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrCountry, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrCountry) && Objects.equals( this.subMerchantSubSellerSubSellerNrEmail, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrEmail) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrEmail, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrEmail) && Objects.equals( this.subMerchantSubSellerSubSellerNrId, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrId) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrId, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrId) && Objects.equals( this.subMerchantSubSellerSubSellerNrMcc, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrMcc) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrMcc, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrMcc) && Objects.equals( this.subMerchantSubSellerSubSellerNrName, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrName) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrName, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrName) && Objects.equals( this.subMerchantSubSellerSubSellerNrPhoneNumber, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrPhoneNumber) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrPhoneNumber, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrPhoneNumber) && Objects.equals( this.subMerchantSubSellerSubSellerNrPostalCode, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrPostalCode) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrPostalCode, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrPostalCode) && Objects.equals( this.subMerchantSubSellerSubSellerNrState, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrState) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrState, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrState) && Objects.equals( this.subMerchantSubSellerSubSellerNrStreet, additionalDataSubMerchant.subMerchantSubSellerSubSellerNrStreet) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrStreet, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrStreet) && Objects.equals( this.subMerchantSubSellerSubSellerNrTaxId, - additionalDataSubMerchant.subMerchantSubSellerSubSellerNrTaxId); + additionalDataSubMerchant.subMerchantSubSellerSubSellerNrTaxId) + && Objects.equals( + this.isSetSubMerchantSubSellerSubSellerNrTaxId, + additionalDataSubMerchant.isSetSubMerchantSubSellerSubSellerNrTaxId); } @Override public int hashCode() { return Objects.hash( subMerchantNumberOfSubSellers, + isSetSubMerchantNumberOfSubSellers, subMerchantSubSellerSubSellerNrCity, + isSetSubMerchantSubSellerSubSellerNrCity, subMerchantSubSellerSubSellerNrCountry, + isSetSubMerchantSubSellerSubSellerNrCountry, subMerchantSubSellerSubSellerNrEmail, + isSetSubMerchantSubSellerSubSellerNrEmail, subMerchantSubSellerSubSellerNrId, + isSetSubMerchantSubSellerSubSellerNrId, subMerchantSubSellerSubSellerNrMcc, + isSetSubMerchantSubSellerSubSellerNrMcc, subMerchantSubSellerSubSellerNrName, + isSetSubMerchantSubSellerSubSellerNrName, subMerchantSubSellerSubSellerNrPhoneNumber, + isSetSubMerchantSubSellerSubSellerNrPhoneNumber, subMerchantSubSellerSubSellerNrPostalCode, + isSetSubMerchantSubSellerSubSellerNrPostalCode, subMerchantSubSellerSubSellerNrState, + isSetSubMerchantSubSellerSubSellerNrState, subMerchantSubSellerSubSellerNrStreet, - subMerchantSubSellerSubSellerNrTaxId); + isSetSubMerchantSubSellerSubSellerNrStreet, + subMerchantSubSellerSubSellerNrTaxId, + isSetSubMerchantSubSellerSubSellerNrTaxId); } @Override @@ -752,6 +888,99 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSubMerchantNumberOfSubSellers) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_NUMBER_OF_SUB_SELLERS, + this.subMerchantNumberOfSubSellers); + } + if (isSetSubMerchantSubSellerSubSellerNrCity) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_CITY, + this.subMerchantSubSellerSubSellerNrCity); + } + if (isSetSubMerchantSubSellerSubSellerNrCountry) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_COUNTRY, + this.subMerchantSubSellerSubSellerNrCountry); + } + if (isSetSubMerchantSubSellerSubSellerNrEmail) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_EMAIL, + this.subMerchantSubSellerSubSellerNrEmail); + } + if (isSetSubMerchantSubSellerSubSellerNrId) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_ID, + this.subMerchantSubSellerSubSellerNrId); + } + if (isSetSubMerchantSubSellerSubSellerNrMcc) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_MCC, + this.subMerchantSubSellerSubSellerNrMcc); + } + if (isSetSubMerchantSubSellerSubSellerNrName) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_NAME, + this.subMerchantSubSellerSubSellerNrName); + } + if (isSetSubMerchantSubSellerSubSellerNrPhoneNumber) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_PHONE_NUMBER, + this.subMerchantSubSellerSubSellerNrPhoneNumber); + } + if (isSetSubMerchantSubSellerSubSellerNrPostalCode) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_POSTAL_CODE, + this.subMerchantSubSellerSubSellerNrPostalCode); + } + if (isSetSubMerchantSubSellerSubSellerNrState) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STATE, + this.subMerchantSubSellerSubSellerNrState); + } + if (isSetSubMerchantSubSellerSubSellerNrStreet) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_STREET, + this.subMerchantSubSellerSubSellerNrStreet); + } + if (isSetSubMerchantSubSellerSubSellerNrTaxId) { + addIfNull( + nulls, + JSON_PROPERTY_SUB_MERCHANT_SUB_SELLER_SUB_SELLER_NR_TAX_ID, + this.subMerchantSubSellerSubSellerNrTaxId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataSubMerchant given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java index f27f68c52..0dcd1da8c 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataTemporaryServices.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,38 +36,71 @@ public class AdditionalDataTemporaryServices { "enhancedSchemeData.customerReference"; private String enhancedSchemeDataCustomerReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataCustomerReference = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_EMPLOYEE_NAME = "enhancedSchemeData.employeeName"; private String enhancedSchemeDataEmployeeName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataEmployeeName = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_JOB_DESCRIPTION = "enhancedSchemeData.jobDescription"; private String enhancedSchemeDataJobDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataJobDescription = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_RATE = "enhancedSchemeData.regularHoursRate"; private String enhancedSchemeDataRegularHoursRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataRegularHoursRate = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_WORKED = "enhancedSchemeData.regularHoursWorked"; private String enhancedSchemeDataRegularHoursWorked; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataRegularHoursWorked = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_REQUEST_NAME = "enhancedSchemeData.requestName"; private String enhancedSchemeDataRequestName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataRequestName = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_START_DATE = "enhancedSchemeData.tempStartDate"; private String enhancedSchemeDataTempStartDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTempStartDate = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_WEEK_ENDING = "enhancedSchemeData.tempWeekEnding"; private String enhancedSchemeDataTempWeekEnding; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTempWeekEnding = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT = "enhancedSchemeData.totalTaxAmount"; private String enhancedSchemeDataTotalTaxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeDataTotalTaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataTemporaryServices() {} /** @@ -79,6 +114,7 @@ public AdditionalDataTemporaryServices() {} public AdditionalDataTemporaryServices enhancedSchemeDataCustomerReference( String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set return this; } @@ -104,6 +140,7 @@ public String getEnhancedSchemeDataCustomerReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCustomerReference) { this.enhancedSchemeDataCustomerReference = enhancedSchemeDataCustomerReference; + isSetEnhancedSchemeDataCustomerReference = true; // mark as set } /** @@ -118,6 +155,7 @@ public void setEnhancedSchemeDataCustomerReference(String enhancedSchemeDataCust public AdditionalDataTemporaryServices enhancedSchemeDataEmployeeName( String enhancedSchemeDataEmployeeName) { this.enhancedSchemeDataEmployeeName = enhancedSchemeDataEmployeeName; + isSetEnhancedSchemeDataEmployeeName = true; // mark as set return this; } @@ -145,6 +183,7 @@ public String getEnhancedSchemeDataEmployeeName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataEmployeeName(String enhancedSchemeDataEmployeeName) { this.enhancedSchemeDataEmployeeName = enhancedSchemeDataEmployeeName; + isSetEnhancedSchemeDataEmployeeName = true; // mark as set } /** @@ -159,6 +198,7 @@ public void setEnhancedSchemeDataEmployeeName(String enhancedSchemeDataEmployeeN public AdditionalDataTemporaryServices enhancedSchemeDataJobDescription( String enhancedSchemeDataJobDescription) { this.enhancedSchemeDataJobDescription = enhancedSchemeDataJobDescription; + isSetEnhancedSchemeDataJobDescription = true; // mark as set return this; } @@ -186,6 +226,7 @@ public String getEnhancedSchemeDataJobDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataJobDescription(String enhancedSchemeDataJobDescription) { this.enhancedSchemeDataJobDescription = enhancedSchemeDataJobDescription; + isSetEnhancedSchemeDataJobDescription = true; // mark as set } /** @@ -202,6 +243,7 @@ public void setEnhancedSchemeDataJobDescription(String enhancedSchemeDataJobDesc public AdditionalDataTemporaryServices enhancedSchemeDataRegularHoursRate( String enhancedSchemeDataRegularHoursRate) { this.enhancedSchemeDataRegularHoursRate = enhancedSchemeDataRegularHoursRate; + isSetEnhancedSchemeDataRegularHoursRate = true; // mark as set return this; } @@ -233,6 +275,7 @@ public String getEnhancedSchemeDataRegularHoursRate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataRegularHoursRate(String enhancedSchemeDataRegularHoursRate) { this.enhancedSchemeDataRegularHoursRate = enhancedSchemeDataRegularHoursRate; + isSetEnhancedSchemeDataRegularHoursRate = true; // mark as set } /** @@ -246,6 +289,7 @@ public void setEnhancedSchemeDataRegularHoursRate(String enhancedSchemeDataRegul public AdditionalDataTemporaryServices enhancedSchemeDataRegularHoursWorked( String enhancedSchemeDataRegularHoursWorked) { this.enhancedSchemeDataRegularHoursWorked = enhancedSchemeDataRegularHoursWorked; + isSetEnhancedSchemeDataRegularHoursWorked = true; // mark as set return this; } @@ -271,6 +315,7 @@ public String getEnhancedSchemeDataRegularHoursWorked() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataRegularHoursWorked(String enhancedSchemeDataRegularHoursWorked) { this.enhancedSchemeDataRegularHoursWorked = enhancedSchemeDataRegularHoursWorked; + isSetEnhancedSchemeDataRegularHoursWorked = true; // mark as set } /** @@ -285,6 +330,7 @@ public void setEnhancedSchemeDataRegularHoursWorked(String enhancedSchemeDataReg public AdditionalDataTemporaryServices enhancedSchemeDataRequestName( String enhancedSchemeDataRequestName) { this.enhancedSchemeDataRequestName = enhancedSchemeDataRequestName; + isSetEnhancedSchemeDataRequestName = true; // mark as set return this; } @@ -312,6 +358,7 @@ public String getEnhancedSchemeDataRequestName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataRequestName(String enhancedSchemeDataRequestName) { this.enhancedSchemeDataRequestName = enhancedSchemeDataRequestName; + isSetEnhancedSchemeDataRequestName = true; // mark as set } /** @@ -325,6 +372,7 @@ public void setEnhancedSchemeDataRequestName(String enhancedSchemeDataRequestNam public AdditionalDataTemporaryServices enhancedSchemeDataTempStartDate( String enhancedSchemeDataTempStartDate) { this.enhancedSchemeDataTempStartDate = enhancedSchemeDataTempStartDate; + isSetEnhancedSchemeDataTempStartDate = true; // mark as set return this; } @@ -350,6 +398,7 @@ public String getEnhancedSchemeDataTempStartDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTempStartDate(String enhancedSchemeDataTempStartDate) { this.enhancedSchemeDataTempStartDate = enhancedSchemeDataTempStartDate; + isSetEnhancedSchemeDataTempStartDate = true; // mark as set } /** @@ -363,6 +412,7 @@ public void setEnhancedSchemeDataTempStartDate(String enhancedSchemeDataTempStar public AdditionalDataTemporaryServices enhancedSchemeDataTempWeekEnding( String enhancedSchemeDataTempWeekEnding) { this.enhancedSchemeDataTempWeekEnding = enhancedSchemeDataTempWeekEnding; + isSetEnhancedSchemeDataTempWeekEnding = true; // mark as set return this; } @@ -388,6 +438,7 @@ public String getEnhancedSchemeDataTempWeekEnding() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTempWeekEnding(String enhancedSchemeDataTempWeekEnding) { this.enhancedSchemeDataTempWeekEnding = enhancedSchemeDataTempWeekEnding; + isSetEnhancedSchemeDataTempWeekEnding = true; // mark as set } /** @@ -404,6 +455,7 @@ public void setEnhancedSchemeDataTempWeekEnding(String enhancedSchemeDataTempWee public AdditionalDataTemporaryServices enhancedSchemeDataTotalTaxAmount( String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set return this; } @@ -435,6 +487,27 @@ public String getEnhancedSchemeDataTotalTaxAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeDataTotalTaxAmount(String enhancedSchemeDataTotalTaxAmount) { this.enhancedSchemeDataTotalTaxAmount = enhancedSchemeDataTotalTaxAmount; + isSetEnhancedSchemeDataTotalTaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataTemporaryServices includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataTemporaryServices object is equal to o. */ @@ -451,44 +524,80 @@ public boolean equals(Object o) { return Objects.equals( this.enhancedSchemeDataCustomerReference, additionalDataTemporaryServices.enhancedSchemeDataCustomerReference) + && Objects.equals( + this.isSetEnhancedSchemeDataCustomerReference, + additionalDataTemporaryServices.isSetEnhancedSchemeDataCustomerReference) && Objects.equals( this.enhancedSchemeDataEmployeeName, additionalDataTemporaryServices.enhancedSchemeDataEmployeeName) + && Objects.equals( + this.isSetEnhancedSchemeDataEmployeeName, + additionalDataTemporaryServices.isSetEnhancedSchemeDataEmployeeName) && Objects.equals( this.enhancedSchemeDataJobDescription, additionalDataTemporaryServices.enhancedSchemeDataJobDescription) + && Objects.equals( + this.isSetEnhancedSchemeDataJobDescription, + additionalDataTemporaryServices.isSetEnhancedSchemeDataJobDescription) && Objects.equals( this.enhancedSchemeDataRegularHoursRate, additionalDataTemporaryServices.enhancedSchemeDataRegularHoursRate) + && Objects.equals( + this.isSetEnhancedSchemeDataRegularHoursRate, + additionalDataTemporaryServices.isSetEnhancedSchemeDataRegularHoursRate) && Objects.equals( this.enhancedSchemeDataRegularHoursWorked, additionalDataTemporaryServices.enhancedSchemeDataRegularHoursWorked) + && Objects.equals( + this.isSetEnhancedSchemeDataRegularHoursWorked, + additionalDataTemporaryServices.isSetEnhancedSchemeDataRegularHoursWorked) && Objects.equals( this.enhancedSchemeDataRequestName, additionalDataTemporaryServices.enhancedSchemeDataRequestName) + && Objects.equals( + this.isSetEnhancedSchemeDataRequestName, + additionalDataTemporaryServices.isSetEnhancedSchemeDataRequestName) && Objects.equals( this.enhancedSchemeDataTempStartDate, additionalDataTemporaryServices.enhancedSchemeDataTempStartDate) + && Objects.equals( + this.isSetEnhancedSchemeDataTempStartDate, + additionalDataTemporaryServices.isSetEnhancedSchemeDataTempStartDate) && Objects.equals( this.enhancedSchemeDataTempWeekEnding, additionalDataTemporaryServices.enhancedSchemeDataTempWeekEnding) + && Objects.equals( + this.isSetEnhancedSchemeDataTempWeekEnding, + additionalDataTemporaryServices.isSetEnhancedSchemeDataTempWeekEnding) && Objects.equals( this.enhancedSchemeDataTotalTaxAmount, - additionalDataTemporaryServices.enhancedSchemeDataTotalTaxAmount); + additionalDataTemporaryServices.enhancedSchemeDataTotalTaxAmount) + && Objects.equals( + this.isSetEnhancedSchemeDataTotalTaxAmount, + additionalDataTemporaryServices.isSetEnhancedSchemeDataTotalTaxAmount); } @Override public int hashCode() { return Objects.hash( enhancedSchemeDataCustomerReference, + isSetEnhancedSchemeDataCustomerReference, enhancedSchemeDataEmployeeName, + isSetEnhancedSchemeDataEmployeeName, enhancedSchemeDataJobDescription, + isSetEnhancedSchemeDataJobDescription, enhancedSchemeDataRegularHoursRate, + isSetEnhancedSchemeDataRegularHoursRate, enhancedSchemeDataRegularHoursWorked, + isSetEnhancedSchemeDataRegularHoursWorked, enhancedSchemeDataRequestName, + isSetEnhancedSchemeDataRequestName, enhancedSchemeDataTempStartDate, + isSetEnhancedSchemeDataTempStartDate, enhancedSchemeDataTempWeekEnding, - enhancedSchemeDataTotalTaxAmount); + isSetEnhancedSchemeDataTempWeekEnding, + enhancedSchemeDataTotalTaxAmount, + isSetEnhancedSchemeDataTotalTaxAmount); } @Override @@ -536,6 +645,81 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetEnhancedSchemeDataCustomerReference) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_CUSTOMER_REFERENCE, + this.enhancedSchemeDataCustomerReference); + } + if (isSetEnhancedSchemeDataEmployeeName) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_EMPLOYEE_NAME, + this.enhancedSchemeDataEmployeeName); + } + if (isSetEnhancedSchemeDataJobDescription) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_JOB_DESCRIPTION, + this.enhancedSchemeDataJobDescription); + } + if (isSetEnhancedSchemeDataRegularHoursRate) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_RATE, + this.enhancedSchemeDataRegularHoursRate); + } + if (isSetEnhancedSchemeDataRegularHoursWorked) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_REGULAR_HOURS_WORKED, + this.enhancedSchemeDataRegularHoursWorked); + } + if (isSetEnhancedSchemeDataRequestName) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_REQUEST_NAME, + this.enhancedSchemeDataRequestName); + } + if (isSetEnhancedSchemeDataTempStartDate) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_START_DATE, + this.enhancedSchemeDataTempStartDate); + } + if (isSetEnhancedSchemeDataTempWeekEnding) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TEMP_WEEK_ENDING, + this.enhancedSchemeDataTempWeekEnding); + } + if (isSetEnhancedSchemeDataTotalTaxAmount) { + addIfNull( + nulls, + JSON_PROPERTY_ENHANCED_SCHEME_DATA_TOTAL_TAX_AMOUNT, + this.enhancedSchemeDataTotalTaxAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataTemporaryServices given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java b/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java index d5c3315b8..f702641c3 100644 --- a/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java +++ b/src/main/java/com/adyen/model/checkout/AdditionalDataWallets.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class AdditionalDataWallets { public static final String JSON_PROPERTY_ANDROIDPAY_TOKEN = "androidpay.token"; private String androidpayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAndroidpayToken = false; + public static final String JSON_PROPERTY_MASTERPASS_TRANSACTION_ID = "masterpass.transactionId"; private String masterpassTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMasterpassTransactionId = false; + public static final String JSON_PROPERTY_PAYMENT_TOKEN = "payment.token"; private String paymentToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentToken = false; + public static final String JSON_PROPERTY_PAYWITHGOOGLE_TOKEN = "paywithgoogle.token"; private String paywithgoogleToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaywithgoogleToken = false; + public static final String JSON_PROPERTY_SAMSUNGPAY_TOKEN = "samsungpay.token"; private String samsungpayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSamsungpayToken = false; + public static final String JSON_PROPERTY_VISACHECKOUT_CALL_ID = "visacheckout.callId"; private String visacheckoutCallId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisacheckoutCallId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AdditionalDataWallets() {} /** @@ -55,6 +81,7 @@ public AdditionalDataWallets() {} */ public AdditionalDataWallets androidpayToken(String androidpayToken) { this.androidpayToken = androidpayToken; + isSetAndroidpayToken = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getAndroidpayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAndroidpayToken(String androidpayToken) { this.androidpayToken = androidpayToken; + isSetAndroidpayToken = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAndroidpayToken(String androidpayToken) { */ public AdditionalDataWallets masterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set return this; } @@ -112,6 +141,7 @@ public String getMasterpassTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMasterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set } /** @@ -122,6 +152,7 @@ public void setMasterpassTransactionId(String masterpassTransactionId) { */ public AdditionalDataWallets paymentToken(String paymentToken) { this.paymentToken = paymentToken; + isSetPaymentToken = true; // mark as set return this; } @@ -145,6 +176,7 @@ public String getPaymentToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentToken(String paymentToken) { this.paymentToken = paymentToken; + isSetPaymentToken = true; // mark as set } /** @@ -155,6 +187,7 @@ public void setPaymentToken(String paymentToken) { */ public AdditionalDataWallets paywithgoogleToken(String paywithgoogleToken) { this.paywithgoogleToken = paywithgoogleToken; + isSetPaywithgoogleToken = true; // mark as set return this; } @@ -178,6 +211,7 @@ public String getPaywithgoogleToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaywithgoogleToken(String paywithgoogleToken) { this.paywithgoogleToken = paywithgoogleToken; + isSetPaywithgoogleToken = true; // mark as set } /** @@ -188,6 +222,7 @@ public void setPaywithgoogleToken(String paywithgoogleToken) { */ public AdditionalDataWallets samsungpayToken(String samsungpayToken) { this.samsungpayToken = samsungpayToken; + isSetSamsungpayToken = true; // mark as set return this; } @@ -211,6 +246,7 @@ public String getSamsungpayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSamsungpayToken(String samsungpayToken) { this.samsungpayToken = samsungpayToken; + isSetSamsungpayToken = true; // mark as set } /** @@ -221,6 +257,7 @@ public void setSamsungpayToken(String samsungpayToken) { */ public AdditionalDataWallets visacheckoutCallId(String visacheckoutCallId) { this.visacheckoutCallId = visacheckoutCallId; + isSetVisacheckoutCallId = true; // mark as set return this; } @@ -244,6 +281,27 @@ public String getVisacheckoutCallId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisacheckoutCallId(String visacheckoutCallId) { this.visacheckoutCallId = visacheckoutCallId; + isSetVisacheckoutCallId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AdditionalDataWallets includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AdditionalDataWallets object is equal to o. */ @@ -257,23 +315,38 @@ public boolean equals(Object o) { } AdditionalDataWallets additionalDataWallets = (AdditionalDataWallets) o; return Objects.equals(this.androidpayToken, additionalDataWallets.androidpayToken) + && Objects.equals(this.isSetAndroidpayToken, additionalDataWallets.isSetAndroidpayToken) && Objects.equals( this.masterpassTransactionId, additionalDataWallets.masterpassTransactionId) + && Objects.equals( + this.isSetMasterpassTransactionId, additionalDataWallets.isSetMasterpassTransactionId) && Objects.equals(this.paymentToken, additionalDataWallets.paymentToken) + && Objects.equals(this.isSetPaymentToken, additionalDataWallets.isSetPaymentToken) && Objects.equals(this.paywithgoogleToken, additionalDataWallets.paywithgoogleToken) + && Objects.equals( + this.isSetPaywithgoogleToken, additionalDataWallets.isSetPaywithgoogleToken) && Objects.equals(this.samsungpayToken, additionalDataWallets.samsungpayToken) - && Objects.equals(this.visacheckoutCallId, additionalDataWallets.visacheckoutCallId); + && Objects.equals(this.isSetSamsungpayToken, additionalDataWallets.isSetSamsungpayToken) + && Objects.equals(this.visacheckoutCallId, additionalDataWallets.visacheckoutCallId) + && Objects.equals( + this.isSetVisacheckoutCallId, additionalDataWallets.isSetVisacheckoutCallId); } @Override public int hashCode() { return Objects.hash( androidpayToken, + isSetAndroidpayToken, masterpassTransactionId, + isSetMasterpassTransactionId, paymentToken, + isSetPaymentToken, paywithgoogleToken, + isSetPaywithgoogleToken, samsungpayToken, - visacheckoutCallId); + isSetSamsungpayToken, + visacheckoutCallId, + isSetVisacheckoutCallId); } @Override @@ -302,6 +375,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAndroidpayToken) { + addIfNull(nulls, JSON_PROPERTY_ANDROIDPAY_TOKEN, this.androidpayToken); + } + if (isSetMasterpassTransactionId) { + addIfNull(nulls, JSON_PROPERTY_MASTERPASS_TRANSACTION_ID, this.masterpassTransactionId); + } + if (isSetPaymentToken) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_TOKEN, this.paymentToken); + } + if (isSetPaywithgoogleToken) { + addIfNull(nulls, JSON_PROPERTY_PAYWITHGOOGLE_TOKEN, this.paywithgoogleToken); + } + if (isSetSamsungpayToken) { + addIfNull(nulls, JSON_PROPERTY_SAMSUNGPAY_TOKEN, this.samsungpayToken); + } + if (isSetVisacheckoutCallId) { + addIfNull(nulls, JSON_PROPERTY_VISACHECKOUT_CALL_ID, this.visacheckoutCallId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AdditionalDataWallets given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Address.java b/src/main/java/com/adyen/model/checkout/Address.java index b8f2434e7..df0edfdb5 100644 --- a/src/main/java/com/adyen/model/checkout/Address.java +++ b/src/main/java/com/adyen/model/checkout/Address.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Address { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; private String houseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHouseNumberOrName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + public static final String JSON_PROPERTY_STREET = "street"; private String street; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Address() {} /** @@ -55,6 +81,7 @@ public Address() {} */ public Address city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -92,6 +120,7 @@ public void setCity(String city) { */ public Address country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -123,6 +152,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public Address houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -156,6 +187,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -168,6 +200,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public Address postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -207,6 +241,7 @@ public void setPostalCode(String postalCode) { */ public Address stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -234,6 +269,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -247,6 +283,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public Address street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -276,6 +313,27 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Address includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Address object is equal to o. */ @@ -289,16 +347,34 @@ public boolean equals(Object o) { } Address address = (Address) o; return Objects.equals(this.city, address.city) + && Objects.equals(this.isSetCity, address.isSetCity) && Objects.equals(this.country, address.country) + && Objects.equals(this.isSetCountry, address.isSetCountry) && Objects.equals(this.houseNumberOrName, address.houseNumberOrName) + && Objects.equals(this.isSetHouseNumberOrName, address.isSetHouseNumberOrName) && Objects.equals(this.postalCode, address.postalCode) + && Objects.equals(this.isSetPostalCode, address.isSetPostalCode) && Objects.equals(this.stateOrProvince, address.stateOrProvince) - && Objects.equals(this.street, address.street); + && Objects.equals(this.isSetStateOrProvince, address.isSetStateOrProvince) + && Objects.equals(this.street, address.street) + && Objects.equals(this.isSetStreet, address.isSetStreet); } @Override public int hashCode() { - return Objects.hash(city, country, houseNumberOrName, postalCode, stateOrProvince, street); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + houseNumberOrName, + isSetHouseNumberOrName, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince, + street, + isSetStreet); } @Override @@ -325,6 +401,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Address given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AffirmDetails.java b/src/main/java/com/adyen/model/checkout/AffirmDetails.java index 3e873314a..2a4b4464f 100644 --- a/src/main/java/com/adyen/model/checkout/AffirmDetails.java +++ b/src/main/java/com/adyen/model/checkout/AffirmDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class AffirmDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **affirm** */ public enum TypeEnum { AFFIRM(String.valueOf("affirm")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AffirmDetails() {} /** @@ -86,6 +103,7 @@ public AffirmDetails() {} */ public AffirmDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AffirmDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -143,6 +163,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -153,6 +174,7 @@ public void setSdkData(String sdkData) { */ public AffirmDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -176,6 +198,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AffirmDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AffirmDetails object is equal to o. */ @@ -189,13 +232,17 @@ public boolean equals(Object o) { } AffirmDetails affirmDetails = (AffirmDetails) o; return Objects.equals(this.checkoutAttemptId, affirmDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, affirmDetails.isSetCheckoutAttemptId) && Objects.equals(this.sdkData, affirmDetails.sdkData) - && Objects.equals(this.type, affirmDetails.type); + && Objects.equals(this.isSetSdkData, affirmDetails.isSetSdkData) + && Objects.equals(this.type, affirmDetails.type) + && Objects.equals(this.isSetType, affirmDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, sdkData, type); + return Objects.hash( + checkoutAttemptId, isSetCheckoutAttemptId, sdkData, isSetSdkData, type, isSetType); } @Override @@ -219,6 +266,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AffirmDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java index 989e36972..21efc433f 100644 --- a/src/main/java/com/adyen/model/checkout/AfterpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AfterpayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,25 +38,46 @@ public class AfterpayDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **afterpay_default** */ public enum TypeEnum { AFTERPAY_DEFAULT(String.valueOf("afterpay_default")), @@ -103,6 +126,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AfterpayDetails() {} /** @@ -113,6 +145,7 @@ public AfterpayDetails() {} */ public AfterpayDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -136,6 +169,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -146,6 +180,7 @@ public void setBillingAddress(String billingAddress) { */ public AfterpayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -169,6 +204,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -179,6 +215,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AfterpayDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -202,6 +239,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -212,6 +250,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public AfterpayDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -235,6 +274,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -249,6 +289,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public AfterpayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -280,6 +321,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -290,6 +332,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public AfterpayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -314,6 +357,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -326,6 +370,7 @@ public void setSdkData(String sdkData) { */ public AfterpayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -353,6 +398,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -363,6 +409,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public AfterpayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -386,6 +433,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AfterpayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AfterpayDetails object is equal to o. */ @@ -399,26 +467,44 @@ public boolean equals(Object o) { } AfterpayDetails afterpayDetails = (AfterpayDetails) o; return Objects.equals(this.billingAddress, afterpayDetails.billingAddress) + && Objects.equals(this.isSetBillingAddress, afterpayDetails.isSetBillingAddress) && Objects.equals(this.checkoutAttemptId, afterpayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, afterpayDetails.isSetCheckoutAttemptId) && Objects.equals(this.deliveryAddress, afterpayDetails.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, afterpayDetails.isSetDeliveryAddress) && Objects.equals(this.personalDetails, afterpayDetails.personalDetails) + && Objects.equals(this.isSetPersonalDetails, afterpayDetails.isSetPersonalDetails) && Objects.equals(this.recurringDetailReference, afterpayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, afterpayDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, afterpayDetails.sdkData) + && Objects.equals(this.isSetSdkData, afterpayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, afterpayDetails.storedPaymentMethodId) - && Objects.equals(this.type, afterpayDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, afterpayDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, afterpayDetails.type) + && Objects.equals(this.isSetType, afterpayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingAddress, + isSetBillingAddress, checkoutAttemptId, + isSetCheckoutAttemptId, deliveryAddress, + isSetDeliveryAddress, personalDetails, + isSetPersonalDetails, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -451,6 +537,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AfterpayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Agency.java b/src/main/java/com/adyen/model/checkout/Agency.java index 1f4e0105e..95059d711 100644 --- a/src/main/java/com/adyen/model/checkout/Agency.java +++ b/src/main/java/com/adyen/model/checkout/Agency.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Agency { public static final String JSON_PROPERTY_INVOICE_NUMBER = "invoiceNumber"; private String invoiceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvoiceNumber = false; + public static final String JSON_PROPERTY_PLAN_NAME = "planName"; private String planName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlanName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Agency() {} /** @@ -38,6 +52,7 @@ public Agency() {} */ public Agency invoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; + isSetInvoiceNumber = true; // mark as set return this; } @@ -65,6 +80,7 @@ public String getInvoiceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvoiceNumber(String invoiceNumber) { this.invoiceNumber = invoiceNumber; + isSetInvoiceNumber = true; // mark as set } /** @@ -77,6 +93,7 @@ public void setInvoiceNumber(String invoiceNumber) { */ public Agency planName(String planName) { this.planName = planName; + isSetPlanName = true; // mark as set return this; } @@ -104,6 +121,27 @@ public String getPlanName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlanName(String planName) { this.planName = planName; + isSetPlanName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Agency includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Agency object is equal to o. */ @@ -117,12 +155,14 @@ public boolean equals(Object o) { } Agency agency = (Agency) o; return Objects.equals(this.invoiceNumber, agency.invoiceNumber) - && Objects.equals(this.planName, agency.planName); + && Objects.equals(this.isSetInvoiceNumber, agency.isSetInvoiceNumber) + && Objects.equals(this.planName, agency.planName) + && Objects.equals(this.isSetPlanName, agency.isSetPlanName); } @Override public int hashCode() { - return Objects.hash(invoiceNumber, planName); + return Objects.hash(invoiceNumber, isSetInvoiceNumber, planName, isSetPlanName); } @Override @@ -145,6 +185,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetInvoiceNumber) { + addIfNull(nulls, JSON_PROPERTY_INVOICE_NUMBER, this.invoiceNumber); + } + if (isSetPlanName) { + addIfNull(nulls, JSON_PROPERTY_PLAN_NAME, this.planName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Agency given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Airline.java b/src/main/java/com/adyen/model/checkout/Airline.java index 96e8b1138..371f2dde9 100644 --- a/src/main/java/com/adyen/model/checkout/Airline.java +++ b/src/main/java/com/adyen/model/checkout/Airline.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,43 +42,88 @@ public class Airline { public static final String JSON_PROPERTY_AGENCY = "agency"; private Agency agency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAgency = false; + public static final String JSON_PROPERTY_BOARDING_FEE = "boardingFee"; private Long boardingFee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBoardingFee = false; + public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_COMPUTERIZED_RESERVATION_SYSTEM = "computerizedReservationSystem"; private String computerizedReservationSystem; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetComputerizedReservationSystem = false; + public static final String JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER = "customerReferenceNumber"; private String customerReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerReferenceNumber = false; + public static final String JSON_PROPERTY_DESIGNATOR_CODE = "designatorCode"; private String designatorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDesignatorCode = false; + public static final String JSON_PROPERTY_DOCUMENT_TYPE = "documentType"; private String documentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDocumentType = false; + public static final String JSON_PROPERTY_FLIGHT_DATE = "flightDate"; private OffsetDateTime flightDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightDate = false; + public static final String JSON_PROPERTY_LEGS = "legs"; private List legs; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLegs = false; + public static final String JSON_PROPERTY_PASSENGER_NAME = "passengerName"; private String passengerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassengerName = false; + public static final String JSON_PROPERTY_PASSENGERS = "passengers"; private List passengers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassengers = false; + public static final String JSON_PROPERTY_TICKET = "ticket"; private Ticket ticket; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTicket = false; + public static final String JSON_PROPERTY_TRAVEL_AGENCY = "travelAgency"; private TravelAgency travelAgency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravelAgency = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Airline() {} /** @@ -87,6 +134,7 @@ public Airline() {} */ public Airline agency(Agency agency) { this.agency = agency; + isSetAgency = true; // mark as set return this; } @@ -110,6 +158,7 @@ public Agency getAgency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAgency(Agency agency) { this.agency = agency; + isSetAgency = true; // mark as set } /** @@ -124,6 +173,7 @@ public void setAgency(Agency agency) { */ public Airline boardingFee(Long boardingFee) { this.boardingFee = boardingFee; + isSetBoardingFee = true; // mark as set return this; } @@ -155,6 +205,7 @@ public Long getBoardingFee() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBoardingFee(Long boardingFee) { this.boardingFee = boardingFee; + isSetBoardingFee = true; // mark as set } /** @@ -171,6 +222,7 @@ public void setBoardingFee(Long boardingFee) { */ public Airline code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -206,6 +258,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -221,6 +274,7 @@ public void setCode(String code) { */ public Airline computerizedReservationSystem(String computerizedReservationSystem) { this.computerizedReservationSystem = computerizedReservationSystem; + isSetComputerizedReservationSystem = true; // mark as set return this; } @@ -254,6 +308,7 @@ public String getComputerizedReservationSystem() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setComputerizedReservationSystem(String computerizedReservationSystem) { this.computerizedReservationSystem = computerizedReservationSystem; + isSetComputerizedReservationSystem = true; // mark as set } /** @@ -268,6 +323,7 @@ public void setComputerizedReservationSystem(String computerizedReservationSyste */ public Airline customerReferenceNumber(String customerReferenceNumber) { this.customerReferenceNumber = customerReferenceNumber; + isSetCustomerReferenceNumber = true; // mark as set return this; } @@ -299,6 +355,7 @@ public String getCustomerReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomerReferenceNumber(String customerReferenceNumber) { this.customerReferenceNumber = customerReferenceNumber; + isSetCustomerReferenceNumber = true; // mark as set } /** @@ -314,6 +371,7 @@ public void setCustomerReferenceNumber(String customerReferenceNumber) { */ public Airline designatorCode(String designatorCode) { this.designatorCode = designatorCode; + isSetDesignatorCode = true; // mark as set return this; } @@ -347,6 +405,7 @@ public String getDesignatorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDesignatorCode(String designatorCode) { this.designatorCode = designatorCode; + isSetDesignatorCode = true; // mark as set } /** @@ -361,6 +420,7 @@ public void setDesignatorCode(String designatorCode) { */ public Airline documentType(String documentType) { this.documentType = documentType; + isSetDocumentType = true; // mark as set return this; } @@ -392,6 +452,7 @@ public String getDocumentType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDocumentType(String documentType) { this.documentType = documentType; + isSetDocumentType = true; // mark as set } /** @@ -406,6 +467,7 @@ public void setDocumentType(String documentType) { */ public Airline flightDate(OffsetDateTime flightDate) { this.flightDate = flightDate; + isSetFlightDate = true; // mark as set return this; } @@ -437,6 +499,7 @@ public OffsetDateTime getFlightDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightDate(OffsetDateTime flightDate) { this.flightDate = flightDate; + isSetFlightDate = true; // mark as set } /** @@ -447,6 +510,7 @@ public void setFlightDate(OffsetDateTime flightDate) { */ public Airline legs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set return this; } @@ -478,6 +542,7 @@ public List getLegs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLegs(List legs) { this.legs = legs; + isSetLegs = true; // mark as set } /** @@ -494,6 +559,7 @@ public void setLegs(List legs) { */ public Airline passengerName(String passengerName) { this.passengerName = passengerName; + isSetPassengerName = true; // mark as set return this; } @@ -529,6 +595,7 @@ public String getPassengerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassengerName(String passengerName) { this.passengerName = passengerName; + isSetPassengerName = true; // mark as set } /** @@ -539,6 +606,7 @@ public void setPassengerName(String passengerName) { */ public Airline passengers(List passengers) { this.passengers = passengers; + isSetPassengers = true; // mark as set return this; } @@ -570,6 +638,7 @@ public List getPassengers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassengers(List passengers) { this.passengers = passengers; + isSetPassengers = true; // mark as set } /** @@ -580,6 +649,7 @@ public void setPassengers(List passengers) { */ public Airline ticket(Ticket ticket) { this.ticket = ticket; + isSetTicket = true; // mark as set return this; } @@ -603,6 +673,7 @@ public Ticket getTicket() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTicket(Ticket ticket) { this.ticket = ticket; + isSetTicket = true; // mark as set } /** @@ -613,6 +684,7 @@ public void setTicket(Ticket ticket) { */ public Airline travelAgency(TravelAgency travelAgency) { this.travelAgency = travelAgency; + isSetTravelAgency = true; // mark as set return this; } @@ -636,6 +708,27 @@ public TravelAgency getTravelAgency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravelAgency(TravelAgency travelAgency) { this.travelAgency = travelAgency; + isSetTravelAgency = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Airline includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Airline object is equal to o. */ @@ -649,36 +742,63 @@ public boolean equals(Object o) { } Airline airline = (Airline) o; return Objects.equals(this.agency, airline.agency) + && Objects.equals(this.isSetAgency, airline.isSetAgency) && Objects.equals(this.boardingFee, airline.boardingFee) + && Objects.equals(this.isSetBoardingFee, airline.isSetBoardingFee) && Objects.equals(this.code, airline.code) + && Objects.equals(this.isSetCode, airline.isSetCode) && Objects.equals(this.computerizedReservationSystem, airline.computerizedReservationSystem) + && Objects.equals( + this.isSetComputerizedReservationSystem, airline.isSetComputerizedReservationSystem) && Objects.equals(this.customerReferenceNumber, airline.customerReferenceNumber) + && Objects.equals(this.isSetCustomerReferenceNumber, airline.isSetCustomerReferenceNumber) && Objects.equals(this.designatorCode, airline.designatorCode) + && Objects.equals(this.isSetDesignatorCode, airline.isSetDesignatorCode) && Objects.equals(this.documentType, airline.documentType) + && Objects.equals(this.isSetDocumentType, airline.isSetDocumentType) && Objects.equals(this.flightDate, airline.flightDate) + && Objects.equals(this.isSetFlightDate, airline.isSetFlightDate) && Objects.equals(this.legs, airline.legs) + && Objects.equals(this.isSetLegs, airline.isSetLegs) && Objects.equals(this.passengerName, airline.passengerName) + && Objects.equals(this.isSetPassengerName, airline.isSetPassengerName) && Objects.equals(this.passengers, airline.passengers) + && Objects.equals(this.isSetPassengers, airline.isSetPassengers) && Objects.equals(this.ticket, airline.ticket) - && Objects.equals(this.travelAgency, airline.travelAgency); + && Objects.equals(this.isSetTicket, airline.isSetTicket) + && Objects.equals(this.travelAgency, airline.travelAgency) + && Objects.equals(this.isSetTravelAgency, airline.isSetTravelAgency); } @Override public int hashCode() { return Objects.hash( agency, + isSetAgency, boardingFee, + isSetBoardingFee, code, + isSetCode, computerizedReservationSystem, + isSetComputerizedReservationSystem, customerReferenceNumber, + isSetCustomerReferenceNumber, designatorCode, + isSetDesignatorCode, documentType, + isSetDocumentType, flightDate, + isSetFlightDate, legs, + isSetLegs, passengerName, + isSetPassengerName, passengers, + isSetPassengers, ticket, - travelAgency); + isSetTicket, + travelAgency, + isSetTravelAgency); } @Override @@ -716,6 +836,67 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAgency) { + addIfNull(nulls, JSON_PROPERTY_AGENCY, this.agency); + } + if (isSetBoardingFee) { + addIfNull(nulls, JSON_PROPERTY_BOARDING_FEE, this.boardingFee); + } + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetComputerizedReservationSystem) { + addIfNull( + nulls, JSON_PROPERTY_COMPUTERIZED_RESERVATION_SYSTEM, this.computerizedReservationSystem); + } + if (isSetCustomerReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER, this.customerReferenceNumber); + } + if (isSetDesignatorCode) { + addIfNull(nulls, JSON_PROPERTY_DESIGNATOR_CODE, this.designatorCode); + } + if (isSetDocumentType) { + addIfNull(nulls, JSON_PROPERTY_DOCUMENT_TYPE, this.documentType); + } + if (isSetFlightDate) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_DATE, this.flightDate); + } + if (isSetLegs) { + addIfNull(nulls, JSON_PROPERTY_LEGS, this.legs); + } + if (isSetPassengerName) { + addIfNull(nulls, JSON_PROPERTY_PASSENGER_NAME, this.passengerName); + } + if (isSetPassengers) { + addIfNull(nulls, JSON_PROPERTY_PASSENGERS, this.passengers); + } + if (isSetTicket) { + addIfNull(nulls, JSON_PROPERTY_TICKET, this.ticket); + } + if (isSetTravelAgency) { + addIfNull(nulls, JSON_PROPERTY_TRAVEL_AGENCY, this.travelAgency); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Airline given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java b/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java index cd92a982a..277d456e5 100644 --- a/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AmazonPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class AmazonPayDetails { public static final String JSON_PROPERTY_AMAZON_PAY_TOKEN = "amazonPayToken"; private String amazonPayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmazonPayToken = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CHECKOUT_SESSION_ID = "checkoutSessionId"; private String checkoutSessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutSessionId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **amazonpay** */ public enum TypeEnum { AMAZONPAY(String.valueOf("amazonpay")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AmazonPayDetails() {} /** @@ -99,6 +122,7 @@ public AmazonPayDetails() {} */ public AmazonPayDetails amazonPayToken(String amazonPayToken) { this.amazonPayToken = amazonPayToken; + isSetAmazonPayToken = true; // mark as set return this; } @@ -132,6 +156,7 @@ public String getAmazonPayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmazonPayToken(String amazonPayToken) { this.amazonPayToken = amazonPayToken; + isSetAmazonPayToken = true; // mark as set } /** @@ -142,6 +167,7 @@ public void setAmazonPayToken(String amazonPayToken) { */ public AmazonPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -165,6 +191,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -179,6 +206,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AmazonPayDetails checkoutSessionId(String checkoutSessionId) { this.checkoutSessionId = checkoutSessionId; + isSetCheckoutSessionId = true; // mark as set return this; } @@ -210,6 +238,7 @@ public String getCheckoutSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutSessionId(String checkoutSessionId) { this.checkoutSessionId = checkoutSessionId; + isSetCheckoutSessionId = true; // mark as set } /** @@ -220,6 +249,7 @@ public void setCheckoutSessionId(String checkoutSessionId) { */ public AmazonPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -244,6 +274,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -254,6 +285,7 @@ public void setSdkData(String sdkData) { */ public AmazonPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -277,6 +309,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AmazonPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AmazonPayDetails object is equal to o. */ @@ -290,15 +343,30 @@ public boolean equals(Object o) { } AmazonPayDetails amazonPayDetails = (AmazonPayDetails) o; return Objects.equals(this.amazonPayToken, amazonPayDetails.amazonPayToken) + && Objects.equals(this.isSetAmazonPayToken, amazonPayDetails.isSetAmazonPayToken) && Objects.equals(this.checkoutAttemptId, amazonPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, amazonPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.checkoutSessionId, amazonPayDetails.checkoutSessionId) + && Objects.equals(this.isSetCheckoutSessionId, amazonPayDetails.isSetCheckoutSessionId) && Objects.equals(this.sdkData, amazonPayDetails.sdkData) - && Objects.equals(this.type, amazonPayDetails.type); + && Objects.equals(this.isSetSdkData, amazonPayDetails.isSetSdkData) + && Objects.equals(this.type, amazonPayDetails.type) + && Objects.equals(this.isSetType, amazonPayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(amazonPayToken, checkoutAttemptId, checkoutSessionId, sdkData, type); + return Objects.hash( + amazonPayToken, + isSetAmazonPayToken, + checkoutAttemptId, + isSetCheckoutAttemptId, + checkoutSessionId, + isSetCheckoutSessionId, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -324,6 +392,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmazonPayToken) { + addIfNull(nulls, JSON_PROPERTY_AMAZON_PAY_TOKEN, this.amazonPayToken); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCheckoutSessionId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_SESSION_ID, this.checkoutSessionId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AmazonPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Amount.java b/src/main/java/com/adyen/model/checkout/Amount.java index 7f0b61d65..8d62ea4ed 100644 --- a/src/main/java/com/adyen/model/checkout/Amount.java +++ b/src/main/java/com/adyen/model/checkout/Amount.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,30 +25,47 @@ public class Amount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amount() {} /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * @return the current {@code Amount} instance, allowing for method chaining */ public Amount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @return currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -56,35 +75,39 @@ public String getCurrency() { /** * The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. * * @param currency The three-character [ISO currency - * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes). + * code](https://docs.adyen.com/development-resources/currency-codes#currency-codes) of the + * amount. */ @JsonProperty(JSON_PROPERTY_CURRENCY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * @return the current {@code Amount} instance, allowing for method chaining */ public Amount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @return value The amount of the transaction, in [minor + * @return value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @@ -94,16 +117,37 @@ public Long getValue() { } /** - * The amount of the transaction, in [minor + * The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). * - * @param value The amount of the transaction, in [minor + * @param value The numeric value of the amount, in [minor * units](https://docs.adyen.com/development-resources/currency-codes#minor-units). */ @JsonProperty(JSON_PROPERTY_VALUE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Amount object is equal to o. */ @@ -117,12 +161,14 @@ public boolean equals(Object o) { } Amount amount = (Amount) o; return Objects.equals(this.currency, amount.currency) - && Objects.equals(this.value, amount.value); + && Objects.equals(this.isSetCurrency, amount.isSetCurrency) + && Objects.equals(this.value, amount.value) + && Objects.equals(this.isSetValue, amount.isSetValue); } @Override public int hashCode() { - return Objects.hash(currency, value); + return Objects.hash(currency, isSetCurrency, value, isSetValue); } @Override @@ -145,6 +191,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amount given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Amounts.java b/src/main/java/com/adyen/model/checkout/Amounts.java index a0ecfc893..bfdf7dbbe 100644 --- a/src/main/java/com/adyen/model/checkout/Amounts.java +++ b/src/main/java/com/adyen/model/checkout/Amounts.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,9 +27,21 @@ public class Amounts { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Amounts() {} /** @@ -40,6 +54,7 @@ public Amounts() {} */ public Amounts currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -67,6 +82,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -79,6 +95,7 @@ public void setCurrency(String currency) { */ public Amounts values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -114,6 +131,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Amounts includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Amounts object is equal to o. */ @@ -127,12 +165,14 @@ public boolean equals(Object o) { } Amounts amounts = (Amounts) o; return Objects.equals(this.currency, amounts.currency) - && Objects.equals(this.values, amounts.values); + && Objects.equals(this.isSetCurrency, amounts.isSetCurrency) + && Objects.equals(this.values, amounts.values) + && Objects.equals(this.isSetValues, amounts.isSetValues); } @Override public int hashCode() { - return Objects.hash(currency, values); + return Objects.hash(currency, isSetCurrency, values, isSetValues); } @Override @@ -155,6 +195,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Amounts given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AncvDetails.java b/src/main/java/com/adyen/model/checkout/AncvDetails.java index 414b19ebe..3f6db62d9 100644 --- a/src/main/java/com/adyen/model/checkout/AncvDetails.java +++ b/src/main/java/com/adyen/model/checkout/AncvDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class AncvDetails { public static final String JSON_PROPERTY_BENEFICIARY_ID = "beneficiaryId"; private String beneficiaryId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeneficiaryId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ancv** */ public enum TypeEnum { ANCV(String.valueOf("ancv")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AncvDetails() {} /** @@ -99,6 +125,7 @@ public AncvDetails() {} */ public AncvDetails beneficiaryId(String beneficiaryId) { this.beneficiaryId = beneficiaryId; + isSetBeneficiaryId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getBeneficiaryId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBeneficiaryId(String beneficiaryId) { this.beneficiaryId = beneficiaryId; + isSetBeneficiaryId = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setBeneficiaryId(String beneficiaryId) { */ public AncvDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -155,6 +184,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public AncvDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public AncvDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public AncvDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public AncvDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AncvDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AncvDetails object is equal to o. */ @@ -319,22 +377,35 @@ public boolean equals(Object o) { } AncvDetails ancvDetails = (AncvDetails) o; return Objects.equals(this.beneficiaryId, ancvDetails.beneficiaryId) + && Objects.equals(this.isSetBeneficiaryId, ancvDetails.isSetBeneficiaryId) && Objects.equals(this.checkoutAttemptId, ancvDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, ancvDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, ancvDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, ancvDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, ancvDetails.sdkData) + && Objects.equals(this.isSetSdkData, ancvDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, ancvDetails.storedPaymentMethodId) - && Objects.equals(this.type, ancvDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, ancvDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, ancvDetails.type) + && Objects.equals(this.isSetType, ancvDetails.isSetType); } @Override public int hashCode() { return Objects.hash( beneficiaryId, + isSetBeneficiaryId, checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -365,6 +436,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBeneficiaryId) { + addIfNull(nulls, JSON_PROPERTY_BENEFICIARY_ID, this.beneficiaryId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AncvDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java b/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java index 5ec29d824..f51eb3c5e 100644 --- a/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/AndroidPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class AndroidPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **androidpay** */ public enum TypeEnum { ANDROIDPAY(String.valueOf("androidpay")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AndroidPayDetails() {} /** @@ -86,6 +103,7 @@ public AndroidPayDetails() {} */ public AndroidPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public AndroidPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -143,6 +163,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -153,6 +174,7 @@ public void setSdkData(String sdkData) { */ public AndroidPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -176,6 +198,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AndroidPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AndroidPayDetails object is equal to o. */ @@ -189,13 +232,17 @@ public boolean equals(Object o) { } AndroidPayDetails androidPayDetails = (AndroidPayDetails) o; return Objects.equals(this.checkoutAttemptId, androidPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, androidPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.sdkData, androidPayDetails.sdkData) - && Objects.equals(this.type, androidPayDetails.type); + && Objects.equals(this.isSetSdkData, androidPayDetails.isSetSdkData) + && Objects.equals(this.type, androidPayDetails.type) + && Objects.equals(this.isSetType, androidPayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, sdkData, type); + return Objects.hash( + checkoutAttemptId, isSetCheckoutAttemptId, sdkData, isSetSdkData, type, isSetType); } @Override @@ -219,6 +266,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AndroidPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java index df1ec1622..f78178e98 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/ApplePayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class ApplePayDetails { public static final String JSON_PROPERTY_APPLE_PAY_TOKEN = "applePayToken"; private String applePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplePayToken = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -45,7 +53,9 @@ public class ApplePayDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -85,16 +95,28 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **applepay** */ public enum TypeEnum { APPLEPAY(String.valueOf("applepay")); @@ -137,6 +159,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplePayDetails() {} /** @@ -149,6 +180,7 @@ public ApplePayDetails() {} */ public ApplePayDetails applePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set return this; } @@ -176,6 +208,7 @@ public String getApplePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set } /** @@ -186,6 +219,7 @@ public void setApplePayToken(String applePayToken) { */ public ApplePayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -209,6 +243,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -222,6 +257,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public ApplePayDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -251,6 +287,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public ApplePayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -296,6 +334,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ApplePayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -330,6 +370,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -342,6 +383,7 @@ public void setSdkData(String sdkData) { */ public ApplePayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -369,6 +411,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -379,6 +422,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public ApplePayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +446,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplePayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApplePayDetails object is equal to o. */ @@ -415,24 +480,40 @@ public boolean equals(Object o) { } ApplePayDetails applePayDetails = (ApplePayDetails) o; return Objects.equals(this.applePayToken, applePayDetails.applePayToken) + && Objects.equals(this.isSetApplePayToken, applePayDetails.isSetApplePayToken) && Objects.equals(this.checkoutAttemptId, applePayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, applePayDetails.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, applePayDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, applePayDetails.isSetFundingSource) && Objects.equals(this.recurringDetailReference, applePayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, applePayDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, applePayDetails.sdkData) + && Objects.equals(this.isSetSdkData, applePayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, applePayDetails.storedPaymentMethodId) - && Objects.equals(this.type, applePayDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, applePayDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, applePayDetails.type) + && Objects.equals(this.isSetType, applePayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( applePayToken, + isSetApplePayToken, checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -464,6 +545,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplePayToken) { + addIfNull(nulls, JSON_PROPERTY_APPLE_PAY_TOKEN, this.applePayToken); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApplePayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePayDonations.java b/src/main/java/com/adyen/model/checkout/ApplePayDonations.java index 641efc502..2b14d8f9f 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePayDonations.java +++ b/src/main/java/com/adyen/model/checkout/ApplePayDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,9 +37,15 @@ public class ApplePayDonations { public static final String JSON_PROPERTY_APPLE_PAY_TOKEN = "applePayToken"; private String applePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplePayToken = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -45,7 +53,9 @@ public class ApplePayDonations { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -85,16 +95,28 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **applepay** */ public enum TypeEnum { APPLEPAY(String.valueOf("applepay")); @@ -137,6 +159,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplePayDonations() {} /** @@ -149,6 +180,7 @@ public ApplePayDonations() {} */ public ApplePayDonations applePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set return this; } @@ -176,6 +208,7 @@ public String getApplePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplePayToken(String applePayToken) { this.applePayToken = applePayToken; + isSetApplePayToken = true; // mark as set } /** @@ -186,6 +219,7 @@ public void setApplePayToken(String applePayToken) { */ public ApplePayDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -209,6 +243,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -222,6 +257,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public ApplePayDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -251,6 +287,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -265,6 +302,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public ApplePayDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -296,6 +334,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -306,6 +345,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ApplePayDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -330,6 +370,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -342,6 +383,7 @@ public void setSdkData(String sdkData) { */ public ApplePayDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -369,6 +411,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -379,6 +422,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public ApplePayDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -402,6 +446,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplePayDonations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApplePayDonations object is equal to o. */ @@ -415,24 +480,40 @@ public boolean equals(Object o) { } ApplePayDonations applePayDonations = (ApplePayDonations) o; return Objects.equals(this.applePayToken, applePayDonations.applePayToken) + && Objects.equals(this.isSetApplePayToken, applePayDonations.isSetApplePayToken) && Objects.equals(this.checkoutAttemptId, applePayDonations.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, applePayDonations.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, applePayDonations.fundingSource) + && Objects.equals(this.isSetFundingSource, applePayDonations.isSetFundingSource) && Objects.equals(this.recurringDetailReference, applePayDonations.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, applePayDonations.isSetRecurringDetailReference) && Objects.equals(this.sdkData, applePayDonations.sdkData) + && Objects.equals(this.isSetSdkData, applePayDonations.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, applePayDonations.storedPaymentMethodId) - && Objects.equals(this.type, applePayDonations.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, applePayDonations.isSetStoredPaymentMethodId) + && Objects.equals(this.type, applePayDonations.type) + && Objects.equals(this.isSetType, applePayDonations.isSetType); } @Override public int hashCode() { return Objects.hash( applePayToken, + isSetApplePayToken, checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -464,6 +545,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplePayToken) { + addIfNull(nulls, JSON_PROPERTY_APPLE_PAY_TOKEN, this.applePayToken); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApplePayDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java b/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java index bf154ed7c..9b6db4a91 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/ApplePaySessionRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ApplePaySessionRequest { public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName"; private String displayName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayName = false; + public static final String JSON_PROPERTY_DOMAIN_NAME = "domainName"; private String domainName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDomainName = false; + public static final String JSON_PROPERTY_MERCHANT_IDENTIFIER = "merchantIdentifier"; private String merchantIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantIdentifier = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplePaySessionRequest() {} /** @@ -49,6 +66,7 @@ public ApplePaySessionRequest() {} */ public ApplePaySessionRequest displayName(String displayName) { this.displayName = displayName; + isSetDisplayName = true; // mark as set return this; } @@ -84,6 +102,7 @@ public String getDisplayName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisplayName(String displayName) { this.displayName = displayName; + isSetDisplayName = true; // mark as set } /** @@ -96,6 +115,7 @@ public void setDisplayName(String displayName) { */ public ApplePaySessionRequest domainName(String domainName) { this.domainName = domainName; + isSetDomainName = true; // mark as set return this; } @@ -123,6 +143,7 @@ public String getDomainName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDomainName(String domainName) { this.domainName = domainName; + isSetDomainName = true; // mark as set } /** @@ -139,6 +160,7 @@ public void setDomainName(String domainName) { */ public ApplePaySessionRequest merchantIdentifier(String merchantIdentifier) { this.merchantIdentifier = merchantIdentifier; + isSetMerchantIdentifier = true; // mark as set return this; } @@ -174,6 +196,27 @@ public String getMerchantIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantIdentifier(String merchantIdentifier) { this.merchantIdentifier = merchantIdentifier; + isSetMerchantIdentifier = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplePaySessionRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApplePaySessionRequest object is equal to o. */ @@ -187,13 +230,23 @@ public boolean equals(Object o) { } ApplePaySessionRequest applePaySessionRequest = (ApplePaySessionRequest) o; return Objects.equals(this.displayName, applePaySessionRequest.displayName) + && Objects.equals(this.isSetDisplayName, applePaySessionRequest.isSetDisplayName) && Objects.equals(this.domainName, applePaySessionRequest.domainName) - && Objects.equals(this.merchantIdentifier, applePaySessionRequest.merchantIdentifier); + && Objects.equals(this.isSetDomainName, applePaySessionRequest.isSetDomainName) + && Objects.equals(this.merchantIdentifier, applePaySessionRequest.merchantIdentifier) + && Objects.equals( + this.isSetMerchantIdentifier, applePaySessionRequest.isSetMerchantIdentifier); } @Override public int hashCode() { - return Objects.hash(displayName, domainName, merchantIdentifier); + return Objects.hash( + displayName, + isSetDisplayName, + domainName, + isSetDomainName, + merchantIdentifier, + isSetMerchantIdentifier); } @Override @@ -217,6 +270,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDisplayName) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_NAME, this.displayName); + } + if (isSetDomainName) { + addIfNull(nulls, JSON_PROPERTY_DOMAIN_NAME, this.domainName); + } + if (isSetMerchantIdentifier) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_IDENTIFIER, this.merchantIdentifier); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApplePaySessionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java b/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java index 2befc8166..d68afac5b 100644 --- a/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/ApplePaySessionResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ApplePaySessionResponse { public static final String JSON_PROPERTY_DATA = "data"; private String data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplePaySessionResponse() {} /** @@ -35,6 +46,7 @@ public ApplePaySessionResponse() {} */ public ApplePaySessionResponse data(String data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -62,6 +74,27 @@ public String getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(String data) { this.data = data; + isSetData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplePaySessionResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApplePaySessionResponse object is equal to o. */ @@ -74,12 +107,13 @@ public boolean equals(Object o) { return false; } ApplePaySessionResponse applePaySessionResponse = (ApplePaySessionResponse) o; - return Objects.equals(this.data, applePaySessionResponse.data); + return Objects.equals(this.data, applePaySessionResponse.data) + && Objects.equals(this.isSetData, applePaySessionResponse.isSetData); } @Override public int hashCode() { - return Objects.hash(data); + return Objects.hash(data, isSetData); } @Override @@ -101,6 +135,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApplePaySessionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ApplicationInfo.java b/src/main/java/com/adyen/model/checkout/ApplicationInfo.java index 973a8bdf4..ddc0b9364 100644 --- a/src/main/java/com/adyen/model/checkout/ApplicationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ApplicationInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class ApplicationInfo { public static final String JSON_PROPERTY_ADYEN_LIBRARY = "adyenLibrary"; private CommonField adyenLibrary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdyenLibrary = false; + public static final String JSON_PROPERTY_ADYEN_PAYMENT_SOURCE = "adyenPaymentSource"; private CommonField adyenPaymentSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdyenPaymentSource = false; + public static final String JSON_PROPERTY_EXTERNAL_PLATFORM = "externalPlatform"; private ExternalPlatform externalPlatform; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalPlatform = false; + public static final String JSON_PROPERTY_MERCHANT_APPLICATION = "merchantApplication"; private CommonField merchantApplication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantApplication = false; + public static final String JSON_PROPERTY_MERCHANT_DEVICE = "merchantDevice"; private MerchantDevice merchantDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantDevice = false; + public static final String JSON_PROPERTY_SHOPPER_INTERACTION_DEVICE = "shopperInteractionDevice"; private ShopperInteractionDevice shopperInteractionDevice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteractionDevice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ApplicationInfo() {} /** @@ -55,6 +81,7 @@ public ApplicationInfo() {} */ public ApplicationInfo adyenLibrary(CommonField adyenLibrary) { this.adyenLibrary = adyenLibrary; + isSetAdyenLibrary = true; // mark as set return this; } @@ -78,6 +105,7 @@ public CommonField getAdyenLibrary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdyenLibrary(CommonField adyenLibrary) { this.adyenLibrary = adyenLibrary; + isSetAdyenLibrary = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAdyenLibrary(CommonField adyenLibrary) { */ public ApplicationInfo adyenPaymentSource(CommonField adyenPaymentSource) { this.adyenPaymentSource = adyenPaymentSource; + isSetAdyenPaymentSource = true; // mark as set return this; } @@ -111,6 +140,7 @@ public CommonField getAdyenPaymentSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdyenPaymentSource(CommonField adyenPaymentSource) { this.adyenPaymentSource = adyenPaymentSource; + isSetAdyenPaymentSource = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setAdyenPaymentSource(CommonField adyenPaymentSource) { */ public ApplicationInfo externalPlatform(ExternalPlatform externalPlatform) { this.externalPlatform = externalPlatform; + isSetExternalPlatform = true; // mark as set return this; } @@ -144,6 +175,7 @@ public ExternalPlatform getExternalPlatform() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalPlatform(ExternalPlatform externalPlatform) { this.externalPlatform = externalPlatform; + isSetExternalPlatform = true; // mark as set } /** @@ -154,6 +186,7 @@ public void setExternalPlatform(ExternalPlatform externalPlatform) { */ public ApplicationInfo merchantApplication(CommonField merchantApplication) { this.merchantApplication = merchantApplication; + isSetMerchantApplication = true; // mark as set return this; } @@ -177,6 +210,7 @@ public CommonField getMerchantApplication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantApplication(CommonField merchantApplication) { this.merchantApplication = merchantApplication; + isSetMerchantApplication = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setMerchantApplication(CommonField merchantApplication) { */ public ApplicationInfo merchantDevice(MerchantDevice merchantDevice) { this.merchantDevice = merchantDevice; + isSetMerchantDevice = true; // mark as set return this; } @@ -210,6 +245,7 @@ public MerchantDevice getMerchantDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantDevice(MerchantDevice merchantDevice) { this.merchantDevice = merchantDevice; + isSetMerchantDevice = true; // mark as set } /** @@ -221,6 +257,7 @@ public void setMerchantDevice(MerchantDevice merchantDevice) { public ApplicationInfo shopperInteractionDevice( ShopperInteractionDevice shopperInteractionDevice) { this.shopperInteractionDevice = shopperInteractionDevice; + isSetShopperInteractionDevice = true; // mark as set return this; } @@ -244,6 +281,27 @@ public ShopperInteractionDevice getShopperInteractionDevice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteractionDevice(ShopperInteractionDevice shopperInteractionDevice) { this.shopperInteractionDevice = shopperInteractionDevice; + isSetShopperInteractionDevice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ApplicationInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ApplicationInfo object is equal to o. */ @@ -257,22 +315,35 @@ public boolean equals(Object o) { } ApplicationInfo applicationInfo = (ApplicationInfo) o; return Objects.equals(this.adyenLibrary, applicationInfo.adyenLibrary) + && Objects.equals(this.isSetAdyenLibrary, applicationInfo.isSetAdyenLibrary) && Objects.equals(this.adyenPaymentSource, applicationInfo.adyenPaymentSource) + && Objects.equals(this.isSetAdyenPaymentSource, applicationInfo.isSetAdyenPaymentSource) && Objects.equals(this.externalPlatform, applicationInfo.externalPlatform) + && Objects.equals(this.isSetExternalPlatform, applicationInfo.isSetExternalPlatform) && Objects.equals(this.merchantApplication, applicationInfo.merchantApplication) + && Objects.equals(this.isSetMerchantApplication, applicationInfo.isSetMerchantApplication) && Objects.equals(this.merchantDevice, applicationInfo.merchantDevice) - && Objects.equals(this.shopperInteractionDevice, applicationInfo.shopperInteractionDevice); + && Objects.equals(this.isSetMerchantDevice, applicationInfo.isSetMerchantDevice) + && Objects.equals(this.shopperInteractionDevice, applicationInfo.shopperInteractionDevice) + && Objects.equals( + this.isSetShopperInteractionDevice, applicationInfo.isSetShopperInteractionDevice); } @Override public int hashCode() { return Objects.hash( adyenLibrary, + isSetAdyenLibrary, adyenPaymentSource, + isSetAdyenPaymentSource, externalPlatform, + isSetExternalPlatform, merchantApplication, + isSetMerchantApplication, merchantDevice, - shopperInteractionDevice); + isSetMerchantDevice, + shopperInteractionDevice, + isSetShopperInteractionDevice); } @Override @@ -303,6 +374,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdyenLibrary) { + addIfNull(nulls, JSON_PROPERTY_ADYEN_LIBRARY, this.adyenLibrary); + } + if (isSetAdyenPaymentSource) { + addIfNull(nulls, JSON_PROPERTY_ADYEN_PAYMENT_SOURCE, this.adyenPaymentSource); + } + if (isSetExternalPlatform) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_PLATFORM, this.externalPlatform); + } + if (isSetMerchantApplication) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_APPLICATION, this.merchantApplication); + } + if (isSetMerchantDevice) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_DEVICE, this.merchantDevice); + } + if (isSetShopperInteractionDevice) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION_DEVICE, this.shopperInteractionDevice); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ApplicationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/AuthenticationData.java b/src/main/java/com/adyen/model/checkout/AuthenticationData.java index 912b2ba23..b0aac0d0e 100644 --- a/src/main/java/com/adyen/model/checkout/AuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/AuthenticationData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -79,12 +81,27 @@ public static AttemptAuthenticationEnum fromValue(String value) { public static final String JSON_PROPERTY_ATTEMPT_AUTHENTICATION = "attemptAuthentication"; private AttemptAuthenticationEnum attemptAuthentication; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAttemptAuthentication = false; + public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUEST_DATA = "threeDSRequestData"; private ThreeDSRequestData threeDSRequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public AuthenticationData() {} /** @@ -105,6 +122,7 @@ public AuthenticationData() {} */ public AuthenticationData attemptAuthentication(AttemptAuthenticationEnum attemptAuthentication) { this.attemptAuthentication = attemptAuthentication; + isSetAttemptAuthentication = true; // mark as set return this; } @@ -148,6 +166,7 @@ public AttemptAuthenticationEnum getAttemptAuthentication() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAttemptAuthentication(AttemptAuthenticationEnum attemptAuthentication) { this.attemptAuthentication = attemptAuthentication; + isSetAttemptAuthentication = true; // mark as set } /** @@ -164,6 +183,7 @@ public void setAttemptAuthentication(AttemptAuthenticationEnum attemptAuthentica */ public AuthenticationData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -199,6 +219,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -209,6 +230,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { */ public AuthenticationData threeDSRequestData(ThreeDSRequestData threeDSRequestData) { this.threeDSRequestData = threeDSRequestData; + isSetThreeDSRequestData = true; // mark as set return this; } @@ -232,6 +254,27 @@ public ThreeDSRequestData getThreeDSRequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestData(ThreeDSRequestData threeDSRequestData) { this.threeDSRequestData = threeDSRequestData; + isSetThreeDSRequestData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public AuthenticationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this AuthenticationData object is equal to o. */ @@ -245,13 +288,23 @@ public boolean equals(Object o) { } AuthenticationData authenticationData = (AuthenticationData) o; return Objects.equals(this.attemptAuthentication, authenticationData.attemptAuthentication) + && Objects.equals( + this.isSetAttemptAuthentication, authenticationData.isSetAttemptAuthentication) && Objects.equals(this.authenticationOnly, authenticationData.authenticationOnly) - && Objects.equals(this.threeDSRequestData, authenticationData.threeDSRequestData); + && Objects.equals(this.isSetAuthenticationOnly, authenticationData.isSetAuthenticationOnly) + && Objects.equals(this.threeDSRequestData, authenticationData.threeDSRequestData) + && Objects.equals(this.isSetThreeDSRequestData, authenticationData.isSetThreeDSRequestData); } @Override public int hashCode() { - return Objects.hash(attemptAuthentication, authenticationOnly, threeDSRequestData); + return Objects.hash( + attemptAuthentication, + isSetAttemptAuthentication, + authenticationOnly, + isSetAuthenticationOnly, + threeDSRequestData, + isSetThreeDSRequestData); } @Override @@ -277,6 +330,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAttemptAuthentication) { + addIfNull(nulls, JSON_PROPERTY_ATTEMPT_AUTHENTICATION, this.attemptAuthentication); + } + if (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + if (isSetThreeDSRequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUEST_DATA, this.threeDSRequestData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of AuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java index 831246a56..3aa9f9695 100644 --- a/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/BacsDirectDebitDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,28 +39,52 @@ public class BacsDirectDebitDetails { public static final String JSON_PROPERTY_BANK_ACCOUNT_NUMBER = "bankAccountNumber"; private String bankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountNumber = false; + public static final String JSON_PROPERTY_BANK_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + /** **directdebit_GB** */ public enum TypeEnum { DIRECTDEBIT_GB(String.valueOf("directdebit_GB")); @@ -101,6 +127,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BacsDirectDebitDetails() {} /** @@ -111,6 +146,7 @@ public BacsDirectDebitDetails() {} */ public BacsDirectDebitDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -134,6 +170,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -144,6 +181,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public BacsDirectDebitDetails bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -167,6 +205,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -177,6 +216,7 @@ public void setBankLocationId(String bankLocationId) { */ public BacsDirectDebitDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -200,6 +240,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -210,6 +251,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public BacsDirectDebitDetails holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -233,6 +275,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -247,6 +290,7 @@ public void setHolderName(String holderName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public BacsDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -278,6 +322,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -288,6 +333,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public BacsDirectDebitDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -312,6 +358,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -324,6 +371,7 @@ public void setSdkData(String sdkData) { */ public BacsDirectDebitDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -351,6 +399,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -363,6 +412,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public BacsDirectDebitDetails transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -390,6 +440,7 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set } /** @@ -400,6 +451,7 @@ public void setTransferInstrumentId(String transferInstrumentId) { */ public BacsDirectDebitDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -423,6 +475,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BacsDirectDebitDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BacsDirectDebitDetails object is equal to o. */ @@ -436,29 +509,53 @@ public boolean equals(Object o) { } BacsDirectDebitDetails bacsDirectDebitDetails = (BacsDirectDebitDetails) o; return Objects.equals(this.bankAccountNumber, bacsDirectDebitDetails.bankAccountNumber) + && Objects.equals( + this.isSetBankAccountNumber, bacsDirectDebitDetails.isSetBankAccountNumber) && Objects.equals(this.bankLocationId, bacsDirectDebitDetails.bankLocationId) + && Objects.equals(this.isSetBankLocationId, bacsDirectDebitDetails.isSetBankLocationId) && Objects.equals(this.checkoutAttemptId, bacsDirectDebitDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, bacsDirectDebitDetails.isSetCheckoutAttemptId) && Objects.equals(this.holderName, bacsDirectDebitDetails.holderName) + && Objects.equals(this.isSetHolderName, bacsDirectDebitDetails.isSetHolderName) && Objects.equals( this.recurringDetailReference, bacsDirectDebitDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + bacsDirectDebitDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, bacsDirectDebitDetails.sdkData) + && Objects.equals(this.isSetSdkData, bacsDirectDebitDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, bacsDirectDebitDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, bacsDirectDebitDetails.isSetStoredPaymentMethodId) && Objects.equals(this.transferInstrumentId, bacsDirectDebitDetails.transferInstrumentId) - && Objects.equals(this.type, bacsDirectDebitDetails.type); + && Objects.equals( + this.isSetTransferInstrumentId, bacsDirectDebitDetails.isSetTransferInstrumentId) + && Objects.equals(this.type, bacsDirectDebitDetails.type) + && Objects.equals(this.isSetType, bacsDirectDebitDetails.isSetType); } @Override public int hashCode() { return Objects.hash( bankAccountNumber, + isSetBankAccountNumber, bankLocationId, + isSetBankLocationId, checkoutAttemptId, + isSetCheckoutAttemptId, holderName, + isSetHolderName, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, transferInstrumentId, - type); + isSetTransferInstrumentId, + type, + isSetType); } @Override @@ -494,6 +591,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BacsDirectDebitDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java b/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java index 445ece698..fe8b026d2 100644 --- a/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java +++ b/src/main/java/com/adyen/model/checkout/BalanceCheckRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -78,76 +80,148 @@ public class BalanceCheckRequest { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DCC_QUOTE = "dccQuote"; private ForexQuote dccQuote; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccQuote = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private Address deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DELIVERY_DATE = "deliveryDate"; private OffsetDateTime deliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryDate = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + public static final String JSON_PROPERTY_FRAUD_OFFSET = "fraudOffset"; private Integer fraudOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudOffset = false; + public static final String JSON_PROPERTY_INSTALLMENTS = "installments"; private Installments installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + public static final String JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT = "localizedShopperStatement"; private Map localizedShopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocalizedShopperStatement = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_MERCHANT_RISK_INDICATOR = "merchantRiskIndicator"; private MerchantRiskIndicator merchantRiskIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRiskIndicator = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_ORDER_REFERENCE = "orderReference"; private String orderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderReference = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private Map paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_RECURRING = "recurring"; private Recurring recurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurring = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details or * using stored payment details. Allowed values: * `Subscription` – A transaction for a @@ -205,25 +279,46 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELECTED_BRAND = "selectedBrand"; private String selectedBrand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedBrand = false; + public static final String JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE = "selectedRecurringDetailReference"; private String selectedRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelectedRecurringDetailReference = false; + public static final String JSON_PROPERTY_SESSION_ID = "sessionId"; private String sessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionId = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -284,45 +379,90 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private ThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TOTALS_GROUP = "totalsGroup"; private String totalsGroup; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalsGroup = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceCheckRequest() {} /** @@ -333,6 +473,7 @@ public BalanceCheckRequest() {} */ public BalanceCheckRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -356,6 +497,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -366,6 +508,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public BalanceCheckRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -389,6 +532,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -403,6 +547,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public BalanceCheckRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -442,6 +587,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -452,6 +598,7 @@ public void setAdditionalData(Map additionalData) { */ public BalanceCheckRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -475,6 +622,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -485,6 +633,7 @@ public void setAmount(Amount amount) { */ public BalanceCheckRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -508,6 +657,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -518,6 +668,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public BalanceCheckRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -541,6 +692,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -551,6 +703,7 @@ public void setBillingAddress(Address billingAddress) { */ public BalanceCheckRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -574,6 +727,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -585,6 +739,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public BalanceCheckRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -610,6 +765,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -622,6 +778,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public BalanceCheckRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -649,6 +806,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -659,6 +817,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public BalanceCheckRequest dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -682,6 +841,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -692,6 +852,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public BalanceCheckRequest deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -715,6 +876,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -729,6 +891,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public BalanceCheckRequest deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -760,6 +923,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -773,6 +937,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public BalanceCheckRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -802,6 +967,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -814,6 +980,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public BalanceCheckRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -841,6 +1008,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -851,6 +1019,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public BalanceCheckRequest installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -874,6 +1043,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -895,6 +1065,7 @@ public void setInstallments(Installments installments) { public BalanceCheckRequest localizedShopperStatement( Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -947,6 +1118,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -961,6 +1133,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public BalanceCheckRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -992,6 +1165,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1003,6 +1177,7 @@ public void setMcc(String mcc) { */ public BalanceCheckRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1028,6 +1203,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1052,6 +1228,7 @@ public void setMerchantAccount(String merchantAccount) { */ public BalanceCheckRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1104,6 +1281,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1114,6 +1292,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public BalanceCheckRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1137,6 +1316,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1153,6 +1333,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public BalanceCheckRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1196,6 +1377,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1211,6 +1393,7 @@ public void setMetadata(Map metadata) { */ public BalanceCheckRequest orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -1244,6 +1427,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -1255,6 +1439,7 @@ public void setOrderReference(String orderReference) { */ public BalanceCheckRequest paymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -1288,6 +1473,7 @@ public Map getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(Map paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -1298,6 +1484,7 @@ public void setPaymentMethod(Map paymentMethod) { */ public BalanceCheckRequest recurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set return this; } @@ -1321,6 +1508,7 @@ public Recurring getRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurring(Recurring recurring) { this.recurring = recurring; + isSetRecurring = true; // mark as set } /** @@ -1349,6 +1537,7 @@ public void setRecurring(Recurring recurring) { public BalanceCheckRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1406,6 +1595,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1422,6 +1612,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public BalanceCheckRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1457,6 +1648,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1473,6 +1665,7 @@ public void setReference(String reference) { */ public BalanceCheckRequest selectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set return this; } @@ -1508,6 +1701,7 @@ public String getSelectedBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedBrand(String selectedBrand) { this.selectedBrand = selectedBrand; + isSetSelectedBrand = true; // mark as set } /** @@ -1522,6 +1716,7 @@ public void setSelectedBrand(String selectedBrand) { public BalanceCheckRequest selectedRecurringDetailReference( String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set return this; } @@ -1551,6 +1746,7 @@ public String getSelectedRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelectedRecurringDetailReference(String selectedRecurringDetailReference) { this.selectedRecurringDetailReference = selectedRecurringDetailReference; + isSetSelectedRecurringDetailReference = true; // mark as set } /** @@ -1561,6 +1757,7 @@ public void setSelectedRecurringDetailReference(String selectedRecurringDetailRe */ public BalanceCheckRequest sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -1584,6 +1781,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -1598,6 +1796,7 @@ public void setSessionId(String sessionId) { */ public BalanceCheckRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1629,6 +1828,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1652,6 +1852,7 @@ public void setShopperEmail(String shopperEmail) { */ public BalanceCheckRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -1701,6 +1902,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -1732,6 +1934,7 @@ public void setShopperIP(String shopperIP) { */ public BalanceCheckRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -1797,6 +2000,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -1809,6 +2013,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public BalanceCheckRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1836,6 +2041,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1846,6 +2052,7 @@ public void setShopperLocale(String shopperLocale) { */ public BalanceCheckRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1869,6 +2076,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1885,6 +2093,7 @@ public void setShopperName(Name shopperName) { */ public BalanceCheckRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1920,6 +2129,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1935,6 +2145,7 @@ public void setShopperReference(String shopperReference) { */ public BalanceCheckRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1968,6 +2179,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1978,6 +2190,7 @@ public void setShopperStatement(String shopperStatement) { */ public BalanceCheckRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2001,6 +2214,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2017,6 +2231,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public BalanceCheckRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2060,6 +2275,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2083,6 +2299,7 @@ public void setSplits(List splits) { */ public BalanceCheckRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2132,6 +2349,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2150,6 +2368,7 @@ public void setStore(String store) { */ public BalanceCheckRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2189,6 +2408,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2199,6 +2419,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public BalanceCheckRequest threeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2222,6 +2443,7 @@ public ThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2242,6 +2464,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestData threeDS2RequestData) { // `authenticationData.authenticationOnly` instead. public BalanceCheckRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2285,6 +2508,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -2297,6 +2521,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public BalanceCheckRequest totalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set return this; } @@ -2324,6 +2549,7 @@ public String getTotalsGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalsGroup(String totalsGroup) { this.totalsGroup = totalsGroup; + isSetTotalsGroup = true; // mark as set } /** @@ -2334,6 +2560,7 @@ public void setTotalsGroup(String totalsGroup) { */ public BalanceCheckRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -2357,6 +2584,27 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceCheckRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceCheckRequest object is equal to o. */ @@ -2370,103 +2618,200 @@ public boolean equals(Object o) { } BalanceCheckRequest balanceCheckRequest = (BalanceCheckRequest) o; return Objects.equals(this.accountInfo, balanceCheckRequest.accountInfo) + && Objects.equals(this.isSetAccountInfo, balanceCheckRequest.isSetAccountInfo) && Objects.equals(this.additionalAmount, balanceCheckRequest.additionalAmount) + && Objects.equals(this.isSetAdditionalAmount, balanceCheckRequest.isSetAdditionalAmount) && Objects.equals(this.additionalData, balanceCheckRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, balanceCheckRequest.isSetAdditionalData) && Objects.equals(this.amount, balanceCheckRequest.amount) + && Objects.equals(this.isSetAmount, balanceCheckRequest.isSetAmount) && Objects.equals(this.applicationInfo, balanceCheckRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, balanceCheckRequest.isSetApplicationInfo) && Objects.equals(this.billingAddress, balanceCheckRequest.billingAddress) + && Objects.equals(this.isSetBillingAddress, balanceCheckRequest.isSetBillingAddress) && Objects.equals(this.browserInfo, balanceCheckRequest.browserInfo) + && Objects.equals(this.isSetBrowserInfo, balanceCheckRequest.isSetBrowserInfo) && Objects.equals(this.captureDelayHours, balanceCheckRequest.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, balanceCheckRequest.isSetCaptureDelayHours) && Objects.equals(this.dateOfBirth, balanceCheckRequest.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, balanceCheckRequest.isSetDateOfBirth) && Objects.equals(this.dccQuote, balanceCheckRequest.dccQuote) + && Objects.equals(this.isSetDccQuote, balanceCheckRequest.isSetDccQuote) && Objects.equals(this.deliveryAddress, balanceCheckRequest.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, balanceCheckRequest.isSetDeliveryAddress) && Objects.equals(this.deliveryDate, balanceCheckRequest.deliveryDate) + && Objects.equals(this.isSetDeliveryDate, balanceCheckRequest.isSetDeliveryDate) && Objects.equals(this.deviceFingerprint, balanceCheckRequest.deviceFingerprint) + && Objects.equals(this.isSetDeviceFingerprint, balanceCheckRequest.isSetDeviceFingerprint) && Objects.equals(this.fraudOffset, balanceCheckRequest.fraudOffset) + && Objects.equals(this.isSetFraudOffset, balanceCheckRequest.isSetFraudOffset) && Objects.equals(this.installments, balanceCheckRequest.installments) + && Objects.equals(this.isSetInstallments, balanceCheckRequest.isSetInstallments) && Objects.equals( this.localizedShopperStatement, balanceCheckRequest.localizedShopperStatement) + && Objects.equals( + this.isSetLocalizedShopperStatement, balanceCheckRequest.isSetLocalizedShopperStatement) && Objects.equals(this.mcc, balanceCheckRequest.mcc) + && Objects.equals(this.isSetMcc, balanceCheckRequest.isSetMcc) && Objects.equals(this.merchantAccount, balanceCheckRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, balanceCheckRequest.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, balanceCheckRequest.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, balanceCheckRequest.isSetMerchantOrderReference) && Objects.equals(this.merchantRiskIndicator, balanceCheckRequest.merchantRiskIndicator) + && Objects.equals( + this.isSetMerchantRiskIndicator, balanceCheckRequest.isSetMerchantRiskIndicator) && Objects.equals(this.metadata, balanceCheckRequest.metadata) + && Objects.equals(this.isSetMetadata, balanceCheckRequest.isSetMetadata) && Objects.equals(this.orderReference, balanceCheckRequest.orderReference) + && Objects.equals(this.isSetOrderReference, balanceCheckRequest.isSetOrderReference) && Objects.equals(this.paymentMethod, balanceCheckRequest.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, balanceCheckRequest.isSetPaymentMethod) && Objects.equals(this.recurring, balanceCheckRequest.recurring) + && Objects.equals(this.isSetRecurring, balanceCheckRequest.isSetRecurring) && Objects.equals( this.recurringProcessingModel, balanceCheckRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, balanceCheckRequest.isSetRecurringProcessingModel) && Objects.equals(this.reference, balanceCheckRequest.reference) + && Objects.equals(this.isSetReference, balanceCheckRequest.isSetReference) && Objects.equals(this.selectedBrand, balanceCheckRequest.selectedBrand) + && Objects.equals(this.isSetSelectedBrand, balanceCheckRequest.isSetSelectedBrand) && Objects.equals( this.selectedRecurringDetailReference, balanceCheckRequest.selectedRecurringDetailReference) + && Objects.equals( + this.isSetSelectedRecurringDetailReference, + balanceCheckRequest.isSetSelectedRecurringDetailReference) && Objects.equals(this.sessionId, balanceCheckRequest.sessionId) + && Objects.equals(this.isSetSessionId, balanceCheckRequest.isSetSessionId) && Objects.equals(this.shopperEmail, balanceCheckRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, balanceCheckRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, balanceCheckRequest.shopperIP) + && Objects.equals(this.isSetShopperIP, balanceCheckRequest.isSetShopperIP) && Objects.equals(this.shopperInteraction, balanceCheckRequest.shopperInteraction) + && Objects.equals(this.isSetShopperInteraction, balanceCheckRequest.isSetShopperInteraction) && Objects.equals(this.shopperLocale, balanceCheckRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, balanceCheckRequest.isSetShopperLocale) && Objects.equals(this.shopperName, balanceCheckRequest.shopperName) + && Objects.equals(this.isSetShopperName, balanceCheckRequest.isSetShopperName) && Objects.equals(this.shopperReference, balanceCheckRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, balanceCheckRequest.isSetShopperReference) && Objects.equals(this.shopperStatement, balanceCheckRequest.shopperStatement) + && Objects.equals(this.isSetShopperStatement, balanceCheckRequest.isSetShopperStatement) && Objects.equals(this.socialSecurityNumber, balanceCheckRequest.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, balanceCheckRequest.isSetSocialSecurityNumber) && Objects.equals(this.splits, balanceCheckRequest.splits) + && Objects.equals(this.isSetSplits, balanceCheckRequest.isSetSplits) && Objects.equals(this.store, balanceCheckRequest.store) + && Objects.equals(this.isSetStore, balanceCheckRequest.isSetStore) && Objects.equals(this.telephoneNumber, balanceCheckRequest.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, balanceCheckRequest.isSetTelephoneNumber) && Objects.equals(this.threeDS2RequestData, balanceCheckRequest.threeDS2RequestData) + && Objects.equals( + this.isSetThreeDS2RequestData, balanceCheckRequest.isSetThreeDS2RequestData) && Objects.equals( this.threeDSAuthenticationOnly, balanceCheckRequest.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, balanceCheckRequest.isSetThreeDSAuthenticationOnly) && Objects.equals(this.totalsGroup, balanceCheckRequest.totalsGroup) - && Objects.equals(this.trustedShopper, balanceCheckRequest.trustedShopper); + && Objects.equals(this.isSetTotalsGroup, balanceCheckRequest.isSetTotalsGroup) + && Objects.equals(this.trustedShopper, balanceCheckRequest.trustedShopper) + && Objects.equals(this.isSetTrustedShopper, balanceCheckRequest.isSetTrustedShopper); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, billingAddress, + isSetBillingAddress, browserInfo, + isSetBrowserInfo, captureDelayHours, + isSetCaptureDelayHours, dateOfBirth, + isSetDateOfBirth, dccQuote, + isSetDccQuote, deliveryAddress, + isSetDeliveryAddress, deliveryDate, + isSetDeliveryDate, deviceFingerprint, + isSetDeviceFingerprint, fraudOffset, + isSetFraudOffset, installments, + isSetInstallments, localizedShopperStatement, + isSetLocalizedShopperStatement, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, merchantRiskIndicator, + isSetMerchantRiskIndicator, metadata, + isSetMetadata, orderReference, + isSetOrderReference, paymentMethod, + isSetPaymentMethod, recurring, + isSetRecurring, recurringProcessingModel, + isSetRecurringProcessingModel, reference, + isSetReference, selectedBrand, + isSetSelectedBrand, selectedRecurringDetailReference, + isSetSelectedRecurringDetailReference, sessionId, + isSetSessionId, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, socialSecurityNumber, + isSetSocialSecurityNumber, splits, + isSetSplits, store, + isSetStore, telephoneNumber, + isSetTelephoneNumber, threeDS2RequestData, + isSetThreeDS2RequestData, threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly, totalsGroup, - trustedShopper); + isSetTotalsGroup, + trustedShopper, + isSetTrustedShopper); } @Override @@ -2547,6 +2892,162 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDccQuote) { + addIfNull(nulls, JSON_PROPERTY_DCC_QUOTE, this.dccQuote); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_DATE, this.deliveryDate); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + if (isSetLocalizedShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT, this.localizedShopperStatement); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMerchantRiskIndicator) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_RISK_INDICATOR, this.merchantRiskIndicator); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetOrderReference) { + addIfNull(nulls, JSON_PROPERTY_ORDER_REFERENCE, this.orderReference); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurring) { + addIfNull(nulls, JSON_PROPERTY_RECURRING, this.recurring); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelectedBrand) { + addIfNull(nulls, JSON_PROPERTY_SELECTED_BRAND, this.selectedBrand); + } + if (isSetSelectedRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_SELECTED_RECURRING_DETAIL_REFERENCE, + this.selectedRecurringDetailReference); + } + if (isSetSessionId) { + addIfNull(nulls, JSON_PROPERTY_SESSION_ID, this.sessionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTotalsGroup) { + addIfNull(nulls, JSON_PROPERTY_TOTALS_GROUP, this.totalsGroup); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceCheckRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java b/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java index fd894eac9..8f3b3f9f4 100644 --- a/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java +++ b/src/main/java/com/adyen/model/checkout/BalanceCheckResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,18 +39,33 @@ public class BalanceCheckResponse { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_BALANCE = "balance"; private Amount balance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBalance = false; + public static final String JSON_PROPERTY_FRAUD_RESULT = "fraudResult"; private FraudResult fraudResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResult = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + /** * The result of the cancellation request. Possible values: * **Success** – Indicates that the * balance check was successful. * **NotEnoughBalance** – Commonly indicates that the card did not @@ -101,9 +118,21 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + public static final String JSON_PROPERTY_TRANSACTION_LIMIT = "transactionLimit"; private Amount transactionLimit; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionLimit = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BalanceCheckResponse() {} /** @@ -117,6 +146,7 @@ public BalanceCheckResponse() {} */ public BalanceCheckResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -154,6 +184,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -164,6 +195,7 @@ public void setAdditionalData(Map additionalData) { */ public BalanceCheckResponse balance(Amount balance) { this.balance = balance; + isSetBalance = true; // mark as set return this; } @@ -187,6 +219,7 @@ public Amount getBalance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBalance(Amount balance) { this.balance = balance; + isSetBalance = true; // mark as set } /** @@ -197,6 +230,7 @@ public void setBalance(Amount balance) { */ public BalanceCheckResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -220,6 +254,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -232,6 +267,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public BalanceCheckResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -260,6 +296,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -278,6 +315,7 @@ public void setPspReference(String pspReference) { */ public BalanceCheckResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -317,6 +355,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -335,6 +374,7 @@ public void setRefusalReason(String refusalReason) { */ public BalanceCheckResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -374,6 +414,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -384,6 +425,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public BalanceCheckResponse transactionLimit(Amount transactionLimit) { this.transactionLimit = transactionLimit; + isSetTransactionLimit = true; // mark as set return this; } @@ -407,6 +449,27 @@ public Amount getTransactionLimit() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionLimit(Amount transactionLimit) { this.transactionLimit = transactionLimit; + isSetTransactionLimit = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BalanceCheckResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BalanceCheckResponse object is equal to o. */ @@ -420,24 +483,38 @@ public boolean equals(Object o) { } BalanceCheckResponse balanceCheckResponse = (BalanceCheckResponse) o; return Objects.equals(this.additionalData, balanceCheckResponse.additionalData) + && Objects.equals(this.isSetAdditionalData, balanceCheckResponse.isSetAdditionalData) && Objects.equals(this.balance, balanceCheckResponse.balance) + && Objects.equals(this.isSetBalance, balanceCheckResponse.isSetBalance) && Objects.equals(this.fraudResult, balanceCheckResponse.fraudResult) + && Objects.equals(this.isSetFraudResult, balanceCheckResponse.isSetFraudResult) && Objects.equals(this.pspReference, balanceCheckResponse.pspReference) + && Objects.equals(this.isSetPspReference, balanceCheckResponse.isSetPspReference) && Objects.equals(this.refusalReason, balanceCheckResponse.refusalReason) + && Objects.equals(this.isSetRefusalReason, balanceCheckResponse.isSetRefusalReason) && Objects.equals(this.resultCode, balanceCheckResponse.resultCode) - && Objects.equals(this.transactionLimit, balanceCheckResponse.transactionLimit); + && Objects.equals(this.isSetResultCode, balanceCheckResponse.isSetResultCode) + && Objects.equals(this.transactionLimit, balanceCheckResponse.transactionLimit) + && Objects.equals(this.isSetTransactionLimit, balanceCheckResponse.isSetTransactionLimit); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, balance, + isSetBalance, fraudResult, + isSetFraudResult, pspReference, + isSetPspReference, refusalReason, + isSetRefusalReason, resultCode, - transactionLimit); + isSetResultCode, + transactionLimit, + isSetTransactionLimit); } @Override @@ -465,6 +542,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetBalance) { + addIfNull(nulls, JSON_PROPERTY_BALANCE, this.balance); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetTransactionLimit) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_LIMIT, this.transactionLimit); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BalanceCheckResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BillDeskDetails.java b/src/main/java/com/adyen/model/checkout/BillDeskDetails.java index a07cafae7..d3c624abc 100644 --- a/src/main/java/com/adyen/model/checkout/BillDeskDetails.java +++ b/src/main/java/com/adyen/model/checkout/BillDeskDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class BillDeskDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **billdesk** */ public enum TypeEnum { BILLDESK_ONLINE(String.valueOf("billdesk_online")), @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BillDeskDetails() {} /** @@ -92,6 +112,7 @@ public BillDeskDetails() {} */ public BillDeskDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -125,6 +147,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public BillDeskDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -148,6 +171,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -158,6 +182,7 @@ public void setIssuer(String issuer) { */ public BillDeskDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -182,6 +207,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -192,6 +218,7 @@ public void setSdkData(String sdkData) { */ public BillDeskDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -215,6 +242,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BillDeskDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BillDeskDetails object is equal to o. */ @@ -228,14 +276,26 @@ public boolean equals(Object o) { } BillDeskDetails billDeskDetails = (BillDeskDetails) o; return Objects.equals(this.checkoutAttemptId, billDeskDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, billDeskDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, billDeskDetails.issuer) + && Objects.equals(this.isSetIssuer, billDeskDetails.isSetIssuer) && Objects.equals(this.sdkData, billDeskDetails.sdkData) - && Objects.equals(this.type, billDeskDetails.type); + && Objects.equals(this.isSetSdkData, billDeskDetails.isSetSdkData) + && Objects.equals(this.type, billDeskDetails.type) + && Objects.equals(this.isSetType, billDeskDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, issuer, sdkData, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -260,6 +320,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BillDeskDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BillingAddress.java b/src/main/java/com/adyen/model/checkout/BillingAddress.java index 8dfacc2a5..10b9bf642 100644 --- a/src/main/java/com/adyen/model/checkout/BillingAddress.java +++ b/src/main/java/com/adyen/model/checkout/BillingAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class BillingAddress { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; private String houseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHouseNumberOrName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + public static final String JSON_PROPERTY_STREET = "street"; private String street; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BillingAddress() {} /** @@ -55,6 +81,7 @@ public BillingAddress() {} */ public BillingAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -92,6 +120,7 @@ public void setCity(String city) { */ public BillingAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -123,6 +152,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setCountry(String country) { */ public BillingAddress houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -156,6 +187,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -168,6 +200,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public BillingAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -207,6 +241,7 @@ public void setPostalCode(String postalCode) { */ public BillingAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -234,6 +269,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -247,6 +283,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public BillingAddress street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -276,6 +313,27 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BillingAddress includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BillingAddress object is equal to o. */ @@ -289,16 +347,34 @@ public boolean equals(Object o) { } BillingAddress billingAddress = (BillingAddress) o; return Objects.equals(this.city, billingAddress.city) + && Objects.equals(this.isSetCity, billingAddress.isSetCity) && Objects.equals(this.country, billingAddress.country) + && Objects.equals(this.isSetCountry, billingAddress.isSetCountry) && Objects.equals(this.houseNumberOrName, billingAddress.houseNumberOrName) + && Objects.equals(this.isSetHouseNumberOrName, billingAddress.isSetHouseNumberOrName) && Objects.equals(this.postalCode, billingAddress.postalCode) + && Objects.equals(this.isSetPostalCode, billingAddress.isSetPostalCode) && Objects.equals(this.stateOrProvince, billingAddress.stateOrProvince) - && Objects.equals(this.street, billingAddress.street); + && Objects.equals(this.isSetStateOrProvince, billingAddress.isSetStateOrProvince) + && Objects.equals(this.street, billingAddress.street) + && Objects.equals(this.isSetStreet, billingAddress.isSetStreet); } @Override public int hashCode() { - return Objects.hash(city, country, houseNumberOrName, postalCode, stateOrProvince, street); + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + houseNumberOrName, + isSetHouseNumberOrName, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince, + street, + isSetStreet); } @Override @@ -325,6 +401,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BillingAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BlikDetails.java b/src/main/java/com/adyen/model/checkout/BlikDetails.java index e95f78c0e..7b0c69667 100644 --- a/src/main/java/com/adyen/model/checkout/BlikDetails.java +++ b/src/main/java/com/adyen/model/checkout/BlikDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class BlikDetails { public static final String JSON_PROPERTY_BLIK_CODE = "blikCode"; private String blikCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlikCode = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **blik** */ public enum TypeEnum { BLIK(String.valueOf("blik")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BlikDetails() {} /** @@ -99,6 +125,7 @@ public BlikDetails() {} */ public BlikDetails blikCode(String blikCode) { this.blikCode = blikCode; + isSetBlikCode = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getBlikCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlikCode(String blikCode) { this.blikCode = blikCode; + isSetBlikCode = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setBlikCode(String blikCode) { */ public BlikDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -155,6 +184,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public BlikDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public BlikDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public BlikDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public BlikDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BlikDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BlikDetails object is equal to o. */ @@ -319,22 +377,35 @@ public boolean equals(Object o) { } BlikDetails blikDetails = (BlikDetails) o; return Objects.equals(this.blikCode, blikDetails.blikCode) + && Objects.equals(this.isSetBlikCode, blikDetails.isSetBlikCode) && Objects.equals(this.checkoutAttemptId, blikDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, blikDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, blikDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, blikDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, blikDetails.sdkData) + && Objects.equals(this.isSetSdkData, blikDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, blikDetails.storedPaymentMethodId) - && Objects.equals(this.type, blikDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, blikDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, blikDetails.type) + && Objects.equals(this.isSetType, blikDetails.isSetType); } @Override public int hashCode() { return Objects.hash( blikCode, + isSetBlikCode, checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -365,6 +436,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBlikCode) { + addIfNull(nulls, JSON_PROPERTY_BLIK_CODE, this.blikCode); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BlikDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/BrowserInfo.java b/src/main/java/com/adyen/model/checkout/BrowserInfo.java index c2d1d508c..bcf968682 100644 --- a/src/main/java/com/adyen/model/checkout/BrowserInfo.java +++ b/src/main/java/com/adyen/model/checkout/BrowserInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,30 +35,63 @@ public class BrowserInfo { public static final String JSON_PROPERTY_ACCEPT_HEADER = "acceptHeader"; private String acceptHeader; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcceptHeader = false; + public static final String JSON_PROPERTY_COLOR_DEPTH = "colorDepth"; private Integer colorDepth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetColorDepth = false; + public static final String JSON_PROPERTY_JAVA_ENABLED = "javaEnabled"; private Boolean javaEnabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetJavaEnabled = false; + public static final String JSON_PROPERTY_JAVA_SCRIPT_ENABLED = "javaScriptEnabled"; private Boolean javaScriptEnabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetJavaScriptEnabled = false; + public static final String JSON_PROPERTY_LANGUAGE = "language"; private String language; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLanguage = false; + public static final String JSON_PROPERTY_SCREEN_HEIGHT = "screenHeight"; private Integer screenHeight; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScreenHeight = false; + public static final String JSON_PROPERTY_SCREEN_WIDTH = "screenWidth"; private Integer screenWidth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScreenWidth = false; + public static final String JSON_PROPERTY_TIME_ZONE_OFFSET = "timeZoneOffset"; private Integer timeZoneOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimeZoneOffset = false; + public static final String JSON_PROPERTY_USER_AGENT = "userAgent"; private String userAgent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUserAgent = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public BrowserInfo() {} /** @@ -67,6 +102,7 @@ public BrowserInfo() {} */ public BrowserInfo acceptHeader(String acceptHeader) { this.acceptHeader = acceptHeader; + isSetAcceptHeader = true; // mark as set return this; } @@ -90,6 +126,7 @@ public String getAcceptHeader() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcceptHeader(String acceptHeader) { this.acceptHeader = acceptHeader; + isSetAcceptHeader = true; // mark as set } /** @@ -104,6 +141,7 @@ public void setAcceptHeader(String acceptHeader) { */ public BrowserInfo colorDepth(Integer colorDepth) { this.colorDepth = colorDepth; + isSetColorDepth = true; // mark as set return this; } @@ -135,6 +173,7 @@ public Integer getColorDepth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setColorDepth(Integer colorDepth) { this.colorDepth = colorDepth; + isSetColorDepth = true; // mark as set } /** @@ -146,6 +185,7 @@ public void setColorDepth(Integer colorDepth) { */ public BrowserInfo javaEnabled(Boolean javaEnabled) { this.javaEnabled = javaEnabled; + isSetJavaEnabled = true; // mark as set return this; } @@ -171,6 +211,7 @@ public Boolean getJavaEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setJavaEnabled(Boolean javaEnabled) { this.javaEnabled = javaEnabled; + isSetJavaEnabled = true; // mark as set } /** @@ -183,6 +224,7 @@ public void setJavaEnabled(Boolean javaEnabled) { */ public BrowserInfo javaScriptEnabled(Boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; + isSetJavaScriptEnabled = true; // mark as set return this; } @@ -210,6 +252,7 @@ public Boolean getJavaScriptEnabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setJavaScriptEnabled(Boolean javaScriptEnabled) { this.javaScriptEnabled = javaScriptEnabled; + isSetJavaScriptEnabled = true; // mark as set } /** @@ -222,6 +265,7 @@ public void setJavaScriptEnabled(Boolean javaScriptEnabled) { */ public BrowserInfo language(String language) { this.language = language; + isSetLanguage = true; // mark as set return this; } @@ -249,6 +293,7 @@ public String getLanguage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguage(String language) { this.language = language; + isSetLanguage = true; // mark as set } /** @@ -259,6 +304,7 @@ public void setLanguage(String language) { */ public BrowserInfo screenHeight(Integer screenHeight) { this.screenHeight = screenHeight; + isSetScreenHeight = true; // mark as set return this; } @@ -282,6 +328,7 @@ public Integer getScreenHeight() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScreenHeight(Integer screenHeight) { this.screenHeight = screenHeight; + isSetScreenHeight = true; // mark as set } /** @@ -292,6 +339,7 @@ public void setScreenHeight(Integer screenHeight) { */ public BrowserInfo screenWidth(Integer screenWidth) { this.screenWidth = screenWidth; + isSetScreenWidth = true; // mark as set return this; } @@ -315,6 +363,7 @@ public Integer getScreenWidth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScreenWidth(Integer screenWidth) { this.screenWidth = screenWidth; + isSetScreenWidth = true; // mark as set } /** @@ -326,6 +375,7 @@ public void setScreenWidth(Integer screenWidth) { */ public BrowserInfo timeZoneOffset(Integer timeZoneOffset) { this.timeZoneOffset = timeZoneOffset; + isSetTimeZoneOffset = true; // mark as set return this; } @@ -351,6 +401,7 @@ public Integer getTimeZoneOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimeZoneOffset(Integer timeZoneOffset) { this.timeZoneOffset = timeZoneOffset; + isSetTimeZoneOffset = true; // mark as set } /** @@ -361,6 +412,7 @@ public void setTimeZoneOffset(Integer timeZoneOffset) { */ public BrowserInfo userAgent(String userAgent) { this.userAgent = userAgent; + isSetUserAgent = true; // mark as set return this; } @@ -384,6 +436,27 @@ public String getUserAgent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUserAgent(String userAgent) { this.userAgent = userAgent; + isSetUserAgent = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public BrowserInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this BrowserInfo object is equal to o. */ @@ -397,28 +470,46 @@ public boolean equals(Object o) { } BrowserInfo browserInfo = (BrowserInfo) o; return Objects.equals(this.acceptHeader, browserInfo.acceptHeader) + && Objects.equals(this.isSetAcceptHeader, browserInfo.isSetAcceptHeader) && Objects.equals(this.colorDepth, browserInfo.colorDepth) + && Objects.equals(this.isSetColorDepth, browserInfo.isSetColorDepth) && Objects.equals(this.javaEnabled, browserInfo.javaEnabled) + && Objects.equals(this.isSetJavaEnabled, browserInfo.isSetJavaEnabled) && Objects.equals(this.javaScriptEnabled, browserInfo.javaScriptEnabled) + && Objects.equals(this.isSetJavaScriptEnabled, browserInfo.isSetJavaScriptEnabled) && Objects.equals(this.language, browserInfo.language) + && Objects.equals(this.isSetLanguage, browserInfo.isSetLanguage) && Objects.equals(this.screenHeight, browserInfo.screenHeight) + && Objects.equals(this.isSetScreenHeight, browserInfo.isSetScreenHeight) && Objects.equals(this.screenWidth, browserInfo.screenWidth) + && Objects.equals(this.isSetScreenWidth, browserInfo.isSetScreenWidth) && Objects.equals(this.timeZoneOffset, browserInfo.timeZoneOffset) - && Objects.equals(this.userAgent, browserInfo.userAgent); + && Objects.equals(this.isSetTimeZoneOffset, browserInfo.isSetTimeZoneOffset) + && Objects.equals(this.userAgent, browserInfo.userAgent) + && Objects.equals(this.isSetUserAgent, browserInfo.isSetUserAgent); } @Override public int hashCode() { return Objects.hash( acceptHeader, + isSetAcceptHeader, colorDepth, + isSetColorDepth, javaEnabled, + isSetJavaEnabled, javaScriptEnabled, + isSetJavaScriptEnabled, language, + isSetLanguage, screenHeight, + isSetScreenHeight, screenWidth, + isSetScreenWidth, timeZoneOffset, - userAgent); + isSetTimeZoneOffset, + userAgent, + isSetUserAgent); } @Override @@ -448,6 +539,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcceptHeader) { + addIfNull(nulls, JSON_PROPERTY_ACCEPT_HEADER, this.acceptHeader); + } + if (isSetColorDepth) { + addIfNull(nulls, JSON_PROPERTY_COLOR_DEPTH, this.colorDepth); + } + if (isSetJavaEnabled) { + addIfNull(nulls, JSON_PROPERTY_JAVA_ENABLED, this.javaEnabled); + } + if (isSetJavaScriptEnabled) { + addIfNull(nulls, JSON_PROPERTY_JAVA_SCRIPT_ENABLED, this.javaScriptEnabled); + } + if (isSetLanguage) { + addIfNull(nulls, JSON_PROPERTY_LANGUAGE, this.language); + } + if (isSetScreenHeight) { + addIfNull(nulls, JSON_PROPERTY_SCREEN_HEIGHT, this.screenHeight); + } + if (isSetScreenWidth) { + addIfNull(nulls, JSON_PROPERTY_SCREEN_WIDTH, this.screenWidth); + } + if (isSetTimeZoneOffset) { + addIfNull(nulls, JSON_PROPERTY_TIME_ZONE_OFFSET, this.timeZoneOffset); + } + if (isSetUserAgent) { + addIfNull(nulls, JSON_PROPERTY_USER_AGENT, this.userAgent); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of BrowserInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java b/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java index b146581d3..bd6d6c544 100644 --- a/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CancelOrderRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class CancelOrderRequest { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_ORDER = "order"; private EncryptedOrderData order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelOrderRequest() {} /** @@ -39,6 +53,7 @@ public CancelOrderRequest() {} */ public CancelOrderRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CancelOrderRequest order(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -95,6 +112,27 @@ public EncryptedOrderData getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelOrderRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CancelOrderRequest object is equal to o. */ @@ -108,12 +146,14 @@ public boolean equals(Object o) { } CancelOrderRequest cancelOrderRequest = (CancelOrderRequest) o; return Objects.equals(this.merchantAccount, cancelOrderRequest.merchantAccount) - && Objects.equals(this.order, cancelOrderRequest.order); + && Objects.equals(this.isSetMerchantAccount, cancelOrderRequest.isSetMerchantAccount) + && Objects.equals(this.order, cancelOrderRequest.order) + && Objects.equals(this.isSetOrder, cancelOrderRequest.isSetOrder); } @Override public int hashCode() { - return Objects.hash(merchantAccount, order); + return Objects.hash(merchantAccount, isSetMerchantAccount, order, isSetOrder); } @Override @@ -136,6 +176,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CancelOrderRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java b/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java index d38e65f49..e33ce5ee0 100644 --- a/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CancelOrderResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class CancelOrderResponse { public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + /** * The result of the cancellation request. Possible values: * **Received** – Indicates the * cancellation has successfully been received by Adyen, and will be processed. @@ -75,6 +80,15 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CancelOrderResponse() {} /** @@ -85,6 +99,7 @@ public CancelOrderResponse() {} */ public CancelOrderResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -108,6 +123,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -120,6 +136,7 @@ public void setPspReference(String pspReference) { */ public CancelOrderResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -147,6 +164,27 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CancelOrderResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CancelOrderResponse object is equal to o. */ @@ -160,12 +198,14 @@ public boolean equals(Object o) { } CancelOrderResponse cancelOrderResponse = (CancelOrderResponse) o; return Objects.equals(this.pspReference, cancelOrderResponse.pspReference) - && Objects.equals(this.resultCode, cancelOrderResponse.resultCode); + && Objects.equals(this.isSetPspReference, cancelOrderResponse.isSetPspReference) + && Objects.equals(this.resultCode, cancelOrderResponse.resultCode) + && Objects.equals(this.isSetResultCode, cancelOrderResponse.isSetResultCode); } @Override public int hashCode() { - return Objects.hash(pspReference, resultCode); + return Objects.hash(pspReference, isSetPspReference, resultCode, isSetResultCode); } @Override @@ -188,6 +228,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CancelOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardBrandDetails.java b/src/main/java/com/adyen/model/checkout/CardBrandDetails.java index 10d8876cc..f4b59db5f 100644 --- a/src/main/java/com/adyen/model/checkout/CardBrandDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardBrandDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class CardBrandDetails { public static final String JSON_PROPERTY_SUPPORTED = "supported"; private Boolean supported; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupported = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardBrandDetails() {} /** @@ -36,6 +50,7 @@ public CardBrandDetails() {} */ public CardBrandDetails supported(Boolean supported) { this.supported = supported; + isSetSupported = true; // mark as set return this; } @@ -59,6 +74,7 @@ public Boolean getSupported() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupported(Boolean supported) { this.supported = supported; + isSetSupported = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setSupported(Boolean supported) { */ public CardBrandDetails type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardBrandDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardBrandDetails object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } CardBrandDetails cardBrandDetails = (CardBrandDetails) o; return Objects.equals(this.supported, cardBrandDetails.supported) - && Objects.equals(this.type, cardBrandDetails.type); + && Objects.equals(this.isSetSupported, cardBrandDetails.isSetSupported) + && Objects.equals(this.type, cardBrandDetails.type) + && Objects.equals(this.isSetType, cardBrandDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(supported, type); + return Objects.hash(supported, isSetSupported, type, isSetType); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSupported) { + addIfNull(nulls, JSON_PROPERTY_SUPPORTED, this.supported); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardBrandDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDetails.java b/src/main/java/com/adyen/model/checkout/CardDetails.java index 7ed5d2647..44005ff96 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetails.java +++ b/src/main/java/com/adyen/model/checkout/CardDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -56,46 +58,88 @@ public class CardDetails { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; @Deprecated // deprecated private String cupsecureplusSmscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCupsecureplusSmscode = false; + public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD = "encryptedCard"; private String encryptedCard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCard = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; private String encryptedExpiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; private String encryptedExpiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + public static final String JSON_PROPERTY_ENCRYPTED_PASSWORD = "encryptedPassword"; private String encryptedPassword; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPassword = false; + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; private String encryptedSecurityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = false; + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_FASTLANE_DATA = "fastlaneData"; private String fastlaneData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFastlaneData = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -103,7 +147,9 @@ public class CardDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -143,44 +189,83 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE = "networkPaymentReference"; private String networkPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkPaymentReference = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_SRC_CORRELATION_ID = "srcCorrelationId"; private String srcCorrelationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcCorrelationId = false; + public static final String JSON_PROPERTY_SRC_DIGITAL_CARD_ID = "srcDigitalCardId"; private String srcDigitalCardId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcDigitalCardId = false; + public static final String JSON_PROPERTY_SRC_SCHEME = "srcScheme"; private String srcScheme; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcScheme = false; + public static final String JSON_PROPERTY_SRC_TOKEN_REFERENCE = "srcTokenReference"; private String srcTokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcTokenReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** * Default payment method details. Common for scheme payment methods, and for simple payment * method details. @@ -236,6 +321,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardDetails() {} /** @@ -249,6 +343,7 @@ public CardDetails() {} */ public CardDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -278,6 +373,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -288,6 +384,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public CardDetails brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -311,6 +408,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -321,6 +419,7 @@ public void setBrand(String brand) { */ public CardDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -344,6 +443,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -356,6 +456,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated public CardDetails cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set return this; } @@ -383,6 +484,7 @@ public String getCupsecureplusSmscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set } /** @@ -395,6 +497,7 @@ public void setCupsecureplusSmscode(String cupsecureplusSmscode) { */ public CardDetails cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -422,6 +525,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -434,6 +538,7 @@ public void setCvc(String cvc) { */ public CardDetails encryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set return this; } @@ -461,6 +566,7 @@ public String getEncryptedCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set } /** @@ -471,6 +577,7 @@ public void setEncryptedCard(String encryptedCard) { */ public CardDetails encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -494,6 +601,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -504,6 +612,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CardDetails encryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set return this; } @@ -527,6 +636,7 @@ public String getEncryptedExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set } /** @@ -537,6 +647,7 @@ public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { */ public CardDetails encryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set return this; } @@ -560,6 +671,7 @@ public String getEncryptedExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set } /** @@ -572,6 +684,7 @@ public void setEncryptedExpiryYear(String encryptedExpiryYear) { */ public CardDetails encryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set return this; } @@ -599,6 +712,7 @@ public String getEncryptedPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set } /** @@ -609,6 +723,7 @@ public void setEncryptedPassword(String encryptedPassword) { */ public CardDetails encryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set return this; } @@ -632,6 +747,7 @@ public String getEncryptedSecurityCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set } /** @@ -644,6 +760,7 @@ public void setEncryptedSecurityCode(String encryptedSecurityCode) { */ public CardDetails expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -671,6 +788,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -683,6 +801,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardDetails expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -710,6 +829,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -720,6 +840,7 @@ public void setExpiryYear(String expiryYear) { */ public CardDetails fastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set return this; } @@ -743,6 +864,7 @@ public String getFastlaneData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set } /** @@ -756,6 +878,7 @@ public void setFastlaneData(String fastlaneData) { */ public CardDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -785,6 +908,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -795,6 +919,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public CardDetails holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -818,6 +943,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -832,6 +958,7 @@ public void setHolderName(String holderName) { */ public CardDetails networkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set return this; } @@ -863,6 +990,7 @@ public String getNetworkPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set } /** @@ -875,6 +1003,7 @@ public void setNetworkPaymentReference(String networkPaymentReference) { */ public CardDetails number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -902,6 +1031,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -916,6 +1046,7 @@ public void setNumber(String number) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public CardDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -947,6 +1078,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -957,6 +1089,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CardDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -981,6 +1114,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -994,6 +1128,7 @@ public void setSdkData(String sdkData) { */ public CardDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -1023,6 +1158,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -1033,6 +1169,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public CardDetails srcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set return this; } @@ -1056,6 +1193,7 @@ public String getSrcCorrelationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set } /** @@ -1066,6 +1204,7 @@ public void setSrcCorrelationId(String srcCorrelationId) { */ public CardDetails srcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set return this; } @@ -1089,6 +1228,7 @@ public String getSrcDigitalCardId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set } /** @@ -1099,6 +1239,7 @@ public void setSrcDigitalCardId(String srcDigitalCardId) { */ public CardDetails srcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set return this; } @@ -1122,6 +1263,7 @@ public String getSrcScheme() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set } /** @@ -1132,6 +1274,7 @@ public void setSrcScheme(String srcScheme) { */ public CardDetails srcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set return this; } @@ -1155,6 +1298,7 @@ public String getSrcTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set } /** @@ -1167,6 +1311,7 @@ public void setSrcTokenReference(String srcTokenReference) { */ public CardDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -1194,6 +1339,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -1205,6 +1351,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public CardDetails threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -1230,6 +1377,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -1242,6 +1390,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public CardDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1269,6 +1418,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardDetails object is equal to o. */ @@ -1282,67 +1452,126 @@ public boolean equals(Object o) { } CardDetails cardDetails = (CardDetails) o; return Objects.equals(this.billingSequenceNumber, cardDetails.billingSequenceNumber) + && Objects.equals(this.isSetBillingSequenceNumber, cardDetails.isSetBillingSequenceNumber) && Objects.equals(this.brand, cardDetails.brand) + && Objects.equals(this.isSetBrand, cardDetails.isSetBrand) && Objects.equals(this.checkoutAttemptId, cardDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, cardDetails.isSetCheckoutAttemptId) && Objects.equals(this.cupsecureplusSmscode, cardDetails.cupsecureplusSmscode) + && Objects.equals(this.isSetCupsecureplusSmscode, cardDetails.isSetCupsecureplusSmscode) && Objects.equals(this.cvc, cardDetails.cvc) + && Objects.equals(this.isSetCvc, cardDetails.isSetCvc) && Objects.equals(this.encryptedCard, cardDetails.encryptedCard) + && Objects.equals(this.isSetEncryptedCard, cardDetails.isSetEncryptedCard) && Objects.equals(this.encryptedCardNumber, cardDetails.encryptedCardNumber) + && Objects.equals(this.isSetEncryptedCardNumber, cardDetails.isSetEncryptedCardNumber) && Objects.equals(this.encryptedExpiryMonth, cardDetails.encryptedExpiryMonth) + && Objects.equals(this.isSetEncryptedExpiryMonth, cardDetails.isSetEncryptedExpiryMonth) && Objects.equals(this.encryptedExpiryYear, cardDetails.encryptedExpiryYear) + && Objects.equals(this.isSetEncryptedExpiryYear, cardDetails.isSetEncryptedExpiryYear) && Objects.equals(this.encryptedPassword, cardDetails.encryptedPassword) + && Objects.equals(this.isSetEncryptedPassword, cardDetails.isSetEncryptedPassword) && Objects.equals(this.encryptedSecurityCode, cardDetails.encryptedSecurityCode) + && Objects.equals(this.isSetEncryptedSecurityCode, cardDetails.isSetEncryptedSecurityCode) && Objects.equals(this.expiryMonth, cardDetails.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, cardDetails.isSetExpiryMonth) && Objects.equals(this.expiryYear, cardDetails.expiryYear) + && Objects.equals(this.isSetExpiryYear, cardDetails.isSetExpiryYear) && Objects.equals(this.fastlaneData, cardDetails.fastlaneData) + && Objects.equals(this.isSetFastlaneData, cardDetails.isSetFastlaneData) && Objects.equals(this.fundingSource, cardDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, cardDetails.isSetFundingSource) && Objects.equals(this.holderName, cardDetails.holderName) + && Objects.equals(this.isSetHolderName, cardDetails.isSetHolderName) && Objects.equals(this.networkPaymentReference, cardDetails.networkPaymentReference) + && Objects.equals( + this.isSetNetworkPaymentReference, cardDetails.isSetNetworkPaymentReference) && Objects.equals(this.number, cardDetails.number) + && Objects.equals(this.isSetNumber, cardDetails.isSetNumber) && Objects.equals(this.recurringDetailReference, cardDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, cardDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, cardDetails.sdkData) + && Objects.equals(this.isSetSdkData, cardDetails.isSetSdkData) && Objects.equals( this.shopperNotificationReference, cardDetails.shopperNotificationReference) + && Objects.equals( + this.isSetShopperNotificationReference, cardDetails.isSetShopperNotificationReference) && Objects.equals(this.srcCorrelationId, cardDetails.srcCorrelationId) + && Objects.equals(this.isSetSrcCorrelationId, cardDetails.isSetSrcCorrelationId) && Objects.equals(this.srcDigitalCardId, cardDetails.srcDigitalCardId) + && Objects.equals(this.isSetSrcDigitalCardId, cardDetails.isSetSrcDigitalCardId) && Objects.equals(this.srcScheme, cardDetails.srcScheme) + && Objects.equals(this.isSetSrcScheme, cardDetails.isSetSrcScheme) && Objects.equals(this.srcTokenReference, cardDetails.srcTokenReference) + && Objects.equals(this.isSetSrcTokenReference, cardDetails.isSetSrcTokenReference) && Objects.equals(this.storedPaymentMethodId, cardDetails.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, cardDetails.isSetStoredPaymentMethodId) && Objects.equals(this.threeDS2SdkVersion, cardDetails.threeDS2SdkVersion) - && Objects.equals(this.type, cardDetails.type); + && Objects.equals(this.isSetThreeDS2SdkVersion, cardDetails.isSetThreeDS2SdkVersion) + && Objects.equals(this.type, cardDetails.type) + && Objects.equals(this.isSetType, cardDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingSequenceNumber, + isSetBillingSequenceNumber, brand, + isSetBrand, checkoutAttemptId, + isSetCheckoutAttemptId, cupsecureplusSmscode, + isSetCupsecureplusSmscode, cvc, + isSetCvc, encryptedCard, + isSetEncryptedCard, encryptedCardNumber, + isSetEncryptedCardNumber, encryptedExpiryMonth, + isSetEncryptedExpiryMonth, encryptedExpiryYear, + isSetEncryptedExpiryYear, encryptedPassword, + isSetEncryptedPassword, encryptedSecurityCode, + isSetEncryptedSecurityCode, expiryMonth, + isSetExpiryMonth, expiryYear, + isSetExpiryYear, fastlaneData, + isSetFastlaneData, fundingSource, + isSetFundingSource, holderName, + isSetHolderName, networkPaymentReference, + isSetNetworkPaymentReference, number, + isSetNumber, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperNotificationReference, + isSetShopperNotificationReference, srcCorrelationId, + isSetSrcCorrelationId, srcDigitalCardId, + isSetSrcDigitalCardId, srcScheme, + isSetSrcScheme, srcTokenReference, + isSetSrcTokenReference, storedPaymentMethodId, + isSetStoredPaymentMethodId, threeDS2SdkVersion, - type); + isSetThreeDS2SdkVersion, + type, + isSetType); } @Override @@ -1411,6 +1640,112 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCupsecureplusSmscode) { + addIfNull(nulls, JSON_PROPERTY_CUPSECUREPLUS_SMSCODE, this.cupsecureplusSmscode); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCard) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD, this.encryptedCard); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedPassword) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PASSWORD, this.encryptedPassword); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetFastlaneData) { + addIfNull(nulls, JSON_PROPERTY_FASTLANE_DATA, this.fastlaneData); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNetworkPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, this.networkPaymentReference); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetSrcCorrelationId) { + addIfNull(nulls, JSON_PROPERTY_SRC_CORRELATION_ID, this.srcCorrelationId); + } + if (isSetSrcDigitalCardId) { + addIfNull(nulls, JSON_PROPERTY_SRC_DIGITAL_CARD_ID, this.srcDigitalCardId); + } + if (isSetSrcScheme) { + addIfNull(nulls, JSON_PROPERTY_SRC_SCHEME, this.srcScheme); + } + if (isSetSrcTokenReference) { + addIfNull(nulls, JSON_PROPERTY_SRC_TOKEN_REFERENCE, this.srcTokenReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java b/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java index 1019c69f2..c1f364fe7 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,18 +33,39 @@ public class CardDetailsRequest { public static final String JSON_PROPERTY_CARD_NUMBER = "cardNumber"; private String cardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardNumber = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_SUPPORTED_BRANDS = "supportedBrands"; private List supportedBrands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedBrands = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardDetailsRequest() {} /** @@ -60,6 +83,7 @@ public CardDetailsRequest() {} */ public CardDetailsRequest cardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set return this; } @@ -97,6 +121,7 @@ public String getCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardNumber(String cardNumber) { this.cardNumber = cardNumber; + isSetCardNumber = true; // mark as set } /** @@ -109,6 +134,7 @@ public void setCardNumber(String cardNumber) { */ public CardDetailsRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -136,6 +162,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -146,6 +173,7 @@ public void setCountryCode(String countryCode) { */ public CardDetailsRequest encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -169,6 +197,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -180,6 +209,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CardDetailsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -205,6 +235,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -225,6 +256,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CardDetailsRequest supportedBrands(List supportedBrands) { this.supportedBrands = supportedBrands; + isSetSupportedBrands = true; // mark as set return this; } @@ -276,6 +308,27 @@ public List getSupportedBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupportedBrands(List supportedBrands) { this.supportedBrands = supportedBrands; + isSetSupportedBrands = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardDetailsRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardDetailsRequest object is equal to o. */ @@ -289,16 +342,31 @@ public boolean equals(Object o) { } CardDetailsRequest cardDetailsRequest = (CardDetailsRequest) o; return Objects.equals(this.cardNumber, cardDetailsRequest.cardNumber) + && Objects.equals(this.isSetCardNumber, cardDetailsRequest.isSetCardNumber) && Objects.equals(this.countryCode, cardDetailsRequest.countryCode) + && Objects.equals(this.isSetCountryCode, cardDetailsRequest.isSetCountryCode) && Objects.equals(this.encryptedCardNumber, cardDetailsRequest.encryptedCardNumber) + && Objects.equals( + this.isSetEncryptedCardNumber, cardDetailsRequest.isSetEncryptedCardNumber) && Objects.equals(this.merchantAccount, cardDetailsRequest.merchantAccount) - && Objects.equals(this.supportedBrands, cardDetailsRequest.supportedBrands); + && Objects.equals(this.isSetMerchantAccount, cardDetailsRequest.isSetMerchantAccount) + && Objects.equals(this.supportedBrands, cardDetailsRequest.supportedBrands) + && Objects.equals(this.isSetSupportedBrands, cardDetailsRequest.isSetSupportedBrands); } @Override public int hashCode() { return Objects.hash( - cardNumber, countryCode, encryptedCardNumber, merchantAccount, supportedBrands); + cardNumber, + isSetCardNumber, + countryCode, + isSetCountryCode, + encryptedCardNumber, + isSetEncryptedCardNumber, + merchantAccount, + isSetMerchantAccount, + supportedBrands, + isSetSupportedBrands); } @Override @@ -326,6 +394,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardNumber) { + addIfNull(nulls, JSON_PROPERTY_CARD_NUMBER, this.cardNumber); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetSupportedBrands) { + addIfNull(nulls, JSON_PROPERTY_SUPPORTED_BRANDS, this.supportedBrands); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardDetailsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java index 5575fa6af..01d312d1c 100644 --- a/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/CardDetailsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class CardDetailsResponse { public static final String JSON_PROPERTY_BRANDS = "brands"; private List brands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrands = false; + public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private String fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_IS_CARD_COMMERCIAL = "isCardCommercial"; private Boolean isCardCommercial; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIsCardCommercial = false; + public static final String JSON_PROPERTY_ISSUING_COUNTRY_CODE = "issuingCountryCode"; private String issuingCountryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuingCountryCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardDetailsResponse() {} /** @@ -49,6 +69,7 @@ public CardDetailsResponse() {} */ public CardDetailsResponse brands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set return this; } @@ -80,6 +101,7 @@ public List getBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set } /** @@ -91,6 +113,7 @@ public void setBrands(List brands) { */ public CardDetailsResponse fundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -116,6 +139,7 @@ public String getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -128,6 +152,7 @@ public void setFundingSource(String fundingSource) { */ public CardDetailsResponse isCardCommercial(Boolean isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set return this; } @@ -155,6 +180,7 @@ public Boolean getIsCardCommercial() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsCardCommercial(Boolean isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set } /** @@ -165,6 +191,7 @@ public void setIsCardCommercial(Boolean isCardCommercial) { */ public CardDetailsResponse issuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set return this; } @@ -189,6 +216,27 @@ public String getIssuingCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuingCountryCode(String issuingCountryCode) { this.issuingCountryCode = issuingCountryCode; + isSetIssuingCountryCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardDetailsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardDetailsResponse object is equal to o. */ @@ -202,14 +250,27 @@ public boolean equals(Object o) { } CardDetailsResponse cardDetailsResponse = (CardDetailsResponse) o; return Objects.equals(this.brands, cardDetailsResponse.brands) + && Objects.equals(this.isSetBrands, cardDetailsResponse.isSetBrands) && Objects.equals(this.fundingSource, cardDetailsResponse.fundingSource) + && Objects.equals(this.isSetFundingSource, cardDetailsResponse.isSetFundingSource) && Objects.equals(this.isCardCommercial, cardDetailsResponse.isCardCommercial) - && Objects.equals(this.issuingCountryCode, cardDetailsResponse.issuingCountryCode); + && Objects.equals(this.isSetIsCardCommercial, cardDetailsResponse.isSetIsCardCommercial) + && Objects.equals(this.issuingCountryCode, cardDetailsResponse.issuingCountryCode) + && Objects.equals( + this.isSetIssuingCountryCode, cardDetailsResponse.isSetIssuingCountryCode); } @Override public int hashCode() { - return Objects.hash(brands, fundingSource, isCardCommercial, issuingCountryCode); + return Objects.hash( + brands, + isSetBrands, + fundingSource, + isSetFundingSource, + isCardCommercial, + isSetIsCardCommercial, + issuingCountryCode, + isSetIssuingCountryCode); } @Override @@ -234,6 +295,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBrands) { + addIfNull(nulls, JSON_PROPERTY_BRANDS, this.brands); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetIsCardCommercial) { + addIfNull(nulls, JSON_PROPERTY_IS_CARD_COMMERCIAL, this.isCardCommercial); + } + if (isSetIssuingCountryCode) { + addIfNull(nulls, JSON_PROPERTY_ISSUING_COUNTRY_CODE, this.issuingCountryCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardDetailsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CardDonations.java b/src/main/java/com/adyen/model/checkout/CardDonations.java index 3682b6618..a44c86099 100644 --- a/src/main/java/com/adyen/model/checkout/CardDonations.java +++ b/src/main/java/com/adyen/model/checkout/CardDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -56,46 +58,88 @@ public class CardDonations { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; @Deprecated // deprecated private String cupsecureplusSmscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCupsecureplusSmscode = false; + public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD = "encryptedCard"; private String encryptedCard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCard = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; private String encryptedExpiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; private String encryptedExpiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + public static final String JSON_PROPERTY_ENCRYPTED_PASSWORD = "encryptedPassword"; private String encryptedPassword; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedPassword = false; + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; private String encryptedSecurityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = false; + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_FASTLANE_DATA = "fastlaneData"; private String fastlaneData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFastlaneData = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -103,7 +147,9 @@ public class CardDonations { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -143,44 +189,83 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE = "networkPaymentReference"; private String networkPaymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkPaymentReference = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_SRC_CORRELATION_ID = "srcCorrelationId"; private String srcCorrelationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcCorrelationId = false; + public static final String JSON_PROPERTY_SRC_DIGITAL_CARD_ID = "srcDigitalCardId"; private String srcDigitalCardId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcDigitalCardId = false; + public static final String JSON_PROPERTY_SRC_SCHEME = "srcScheme"; private String srcScheme; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcScheme = false; + public static final String JSON_PROPERTY_SRC_TOKEN_REFERENCE = "srcTokenReference"; private String srcTokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSrcTokenReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** * Default payment method details. Common for scheme payment methods, and for simple payment * method details. @@ -236,6 +321,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CardDonations() {} /** @@ -249,6 +343,7 @@ public CardDonations() {} */ public CardDonations billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -278,6 +373,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -288,6 +384,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public CardDonations brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -311,6 +408,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -321,6 +419,7 @@ public void setBrand(String brand) { */ public CardDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -344,6 +443,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -356,6 +456,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated public CardDonations cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set return this; } @@ -383,6 +484,7 @@ public String getCupsecureplusSmscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set } /** @@ -395,6 +497,7 @@ public void setCupsecureplusSmscode(String cupsecureplusSmscode) { */ public CardDonations cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -422,6 +525,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -434,6 +538,7 @@ public void setCvc(String cvc) { */ public CardDonations encryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set return this; } @@ -461,6 +566,7 @@ public String getEncryptedCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set } /** @@ -471,6 +577,7 @@ public void setEncryptedCard(String encryptedCard) { */ public CardDonations encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -494,6 +601,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -504,6 +612,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public CardDonations encryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set return this; } @@ -527,6 +636,7 @@ public String getEncryptedExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set } /** @@ -537,6 +647,7 @@ public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { */ public CardDonations encryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set return this; } @@ -560,6 +671,7 @@ public String getEncryptedExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set } /** @@ -572,6 +684,7 @@ public void setEncryptedExpiryYear(String encryptedExpiryYear) { */ public CardDonations encryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set return this; } @@ -599,6 +712,7 @@ public String getEncryptedPassword() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedPassword(String encryptedPassword) { this.encryptedPassword = encryptedPassword; + isSetEncryptedPassword = true; // mark as set } /** @@ -609,6 +723,7 @@ public void setEncryptedPassword(String encryptedPassword) { */ public CardDonations encryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set return this; } @@ -632,6 +747,7 @@ public String getEncryptedSecurityCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set } /** @@ -644,6 +760,7 @@ public void setEncryptedSecurityCode(String encryptedSecurityCode) { */ public CardDonations expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -671,6 +788,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -683,6 +801,7 @@ public void setExpiryMonth(String expiryMonth) { */ public CardDonations expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -710,6 +829,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -720,6 +840,7 @@ public void setExpiryYear(String expiryYear) { */ public CardDonations fastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set return this; } @@ -743,6 +864,7 @@ public String getFastlaneData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set } /** @@ -756,6 +878,7 @@ public void setFastlaneData(String fastlaneData) { */ public CardDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -785,6 +908,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -795,6 +919,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public CardDonations holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -818,6 +943,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -832,6 +958,7 @@ public void setHolderName(String holderName) { */ public CardDonations networkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set return this; } @@ -863,6 +990,7 @@ public String getNetworkPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkPaymentReference(String networkPaymentReference) { this.networkPaymentReference = networkPaymentReference; + isSetNetworkPaymentReference = true; // mark as set } /** @@ -875,6 +1003,7 @@ public void setNetworkPaymentReference(String networkPaymentReference) { */ public CardDonations number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -902,6 +1031,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -916,6 +1046,7 @@ public void setNumber(String number) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public CardDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -947,6 +1078,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -957,6 +1089,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CardDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -981,6 +1114,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -994,6 +1128,7 @@ public void setSdkData(String sdkData) { */ public CardDonations shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -1023,6 +1158,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -1033,6 +1169,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public CardDonations srcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set return this; } @@ -1056,6 +1193,7 @@ public String getSrcCorrelationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcCorrelationId(String srcCorrelationId) { this.srcCorrelationId = srcCorrelationId; + isSetSrcCorrelationId = true; // mark as set } /** @@ -1066,6 +1204,7 @@ public void setSrcCorrelationId(String srcCorrelationId) { */ public CardDonations srcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set return this; } @@ -1089,6 +1228,7 @@ public String getSrcDigitalCardId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcDigitalCardId(String srcDigitalCardId) { this.srcDigitalCardId = srcDigitalCardId; + isSetSrcDigitalCardId = true; // mark as set } /** @@ -1099,6 +1239,7 @@ public void setSrcDigitalCardId(String srcDigitalCardId) { */ public CardDonations srcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set return this; } @@ -1122,6 +1263,7 @@ public String getSrcScheme() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcScheme(String srcScheme) { this.srcScheme = srcScheme; + isSetSrcScheme = true; // mark as set } /** @@ -1132,6 +1274,7 @@ public void setSrcScheme(String srcScheme) { */ public CardDonations srcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set return this; } @@ -1155,6 +1298,7 @@ public String getSrcTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSrcTokenReference(String srcTokenReference) { this.srcTokenReference = srcTokenReference; + isSetSrcTokenReference = true; // mark as set } /** @@ -1167,6 +1311,7 @@ public void setSrcTokenReference(String srcTokenReference) { */ public CardDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -1194,6 +1339,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -1205,6 +1351,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public CardDonations threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -1230,6 +1377,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -1242,6 +1390,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public CardDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -1269,6 +1418,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CardDonations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CardDonations object is equal to o. */ @@ -1282,67 +1452,126 @@ public boolean equals(Object o) { } CardDonations cardDonations = (CardDonations) o; return Objects.equals(this.billingSequenceNumber, cardDonations.billingSequenceNumber) + && Objects.equals(this.isSetBillingSequenceNumber, cardDonations.isSetBillingSequenceNumber) && Objects.equals(this.brand, cardDonations.brand) + && Objects.equals(this.isSetBrand, cardDonations.isSetBrand) && Objects.equals(this.checkoutAttemptId, cardDonations.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, cardDonations.isSetCheckoutAttemptId) && Objects.equals(this.cupsecureplusSmscode, cardDonations.cupsecureplusSmscode) + && Objects.equals(this.isSetCupsecureplusSmscode, cardDonations.isSetCupsecureplusSmscode) && Objects.equals(this.cvc, cardDonations.cvc) + && Objects.equals(this.isSetCvc, cardDonations.isSetCvc) && Objects.equals(this.encryptedCard, cardDonations.encryptedCard) + && Objects.equals(this.isSetEncryptedCard, cardDonations.isSetEncryptedCard) && Objects.equals(this.encryptedCardNumber, cardDonations.encryptedCardNumber) + && Objects.equals(this.isSetEncryptedCardNumber, cardDonations.isSetEncryptedCardNumber) && Objects.equals(this.encryptedExpiryMonth, cardDonations.encryptedExpiryMonth) + && Objects.equals(this.isSetEncryptedExpiryMonth, cardDonations.isSetEncryptedExpiryMonth) && Objects.equals(this.encryptedExpiryYear, cardDonations.encryptedExpiryYear) + && Objects.equals(this.isSetEncryptedExpiryYear, cardDonations.isSetEncryptedExpiryYear) && Objects.equals(this.encryptedPassword, cardDonations.encryptedPassword) + && Objects.equals(this.isSetEncryptedPassword, cardDonations.isSetEncryptedPassword) && Objects.equals(this.encryptedSecurityCode, cardDonations.encryptedSecurityCode) + && Objects.equals(this.isSetEncryptedSecurityCode, cardDonations.isSetEncryptedSecurityCode) && Objects.equals(this.expiryMonth, cardDonations.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, cardDonations.isSetExpiryMonth) && Objects.equals(this.expiryYear, cardDonations.expiryYear) + && Objects.equals(this.isSetExpiryYear, cardDonations.isSetExpiryYear) && Objects.equals(this.fastlaneData, cardDonations.fastlaneData) + && Objects.equals(this.isSetFastlaneData, cardDonations.isSetFastlaneData) && Objects.equals(this.fundingSource, cardDonations.fundingSource) + && Objects.equals(this.isSetFundingSource, cardDonations.isSetFundingSource) && Objects.equals(this.holderName, cardDonations.holderName) + && Objects.equals(this.isSetHolderName, cardDonations.isSetHolderName) && Objects.equals(this.networkPaymentReference, cardDonations.networkPaymentReference) + && Objects.equals( + this.isSetNetworkPaymentReference, cardDonations.isSetNetworkPaymentReference) && Objects.equals(this.number, cardDonations.number) + && Objects.equals(this.isSetNumber, cardDonations.isSetNumber) && Objects.equals(this.recurringDetailReference, cardDonations.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, cardDonations.isSetRecurringDetailReference) && Objects.equals(this.sdkData, cardDonations.sdkData) + && Objects.equals(this.isSetSdkData, cardDonations.isSetSdkData) && Objects.equals( this.shopperNotificationReference, cardDonations.shopperNotificationReference) + && Objects.equals( + this.isSetShopperNotificationReference, cardDonations.isSetShopperNotificationReference) && Objects.equals(this.srcCorrelationId, cardDonations.srcCorrelationId) + && Objects.equals(this.isSetSrcCorrelationId, cardDonations.isSetSrcCorrelationId) && Objects.equals(this.srcDigitalCardId, cardDonations.srcDigitalCardId) + && Objects.equals(this.isSetSrcDigitalCardId, cardDonations.isSetSrcDigitalCardId) && Objects.equals(this.srcScheme, cardDonations.srcScheme) + && Objects.equals(this.isSetSrcScheme, cardDonations.isSetSrcScheme) && Objects.equals(this.srcTokenReference, cardDonations.srcTokenReference) + && Objects.equals(this.isSetSrcTokenReference, cardDonations.isSetSrcTokenReference) && Objects.equals(this.storedPaymentMethodId, cardDonations.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, cardDonations.isSetStoredPaymentMethodId) && Objects.equals(this.threeDS2SdkVersion, cardDonations.threeDS2SdkVersion) - && Objects.equals(this.type, cardDonations.type); + && Objects.equals(this.isSetThreeDS2SdkVersion, cardDonations.isSetThreeDS2SdkVersion) + && Objects.equals(this.type, cardDonations.type) + && Objects.equals(this.isSetType, cardDonations.isSetType); } @Override public int hashCode() { return Objects.hash( billingSequenceNumber, + isSetBillingSequenceNumber, brand, + isSetBrand, checkoutAttemptId, + isSetCheckoutAttemptId, cupsecureplusSmscode, + isSetCupsecureplusSmscode, cvc, + isSetCvc, encryptedCard, + isSetEncryptedCard, encryptedCardNumber, + isSetEncryptedCardNumber, encryptedExpiryMonth, + isSetEncryptedExpiryMonth, encryptedExpiryYear, + isSetEncryptedExpiryYear, encryptedPassword, + isSetEncryptedPassword, encryptedSecurityCode, + isSetEncryptedSecurityCode, expiryMonth, + isSetExpiryMonth, expiryYear, + isSetExpiryYear, fastlaneData, + isSetFastlaneData, fundingSource, + isSetFundingSource, holderName, + isSetHolderName, networkPaymentReference, + isSetNetworkPaymentReference, number, + isSetNumber, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperNotificationReference, + isSetShopperNotificationReference, srcCorrelationId, + isSetSrcCorrelationId, srcDigitalCardId, + isSetSrcDigitalCardId, srcScheme, + isSetSrcScheme, srcTokenReference, + isSetSrcTokenReference, storedPaymentMethodId, + isSetStoredPaymentMethodId, threeDS2SdkVersion, - type); + isSetThreeDS2SdkVersion, + type, + isSetType); } @Override @@ -1411,6 +1640,112 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCupsecureplusSmscode) { + addIfNull(nulls, JSON_PROPERTY_CUPSECUREPLUS_SMSCODE, this.cupsecureplusSmscode); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCard) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD, this.encryptedCard); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedPassword) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_PASSWORD, this.encryptedPassword); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetFastlaneData) { + addIfNull(nulls, JSON_PROPERTY_FASTLANE_DATA, this.fastlaneData); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNetworkPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_PAYMENT_REFERENCE, this.networkPaymentReference); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetSrcCorrelationId) { + addIfNull(nulls, JSON_PROPERTY_SRC_CORRELATION_ID, this.srcCorrelationId); + } + if (isSetSrcDigitalCardId) { + addIfNull(nulls, JSON_PROPERTY_SRC_DIGITAL_CARD_ID, this.srcDigitalCardId); + } + if (isSetSrcScheme) { + addIfNull(nulls, JSON_PROPERTY_SRC_SCHEME, this.srcScheme); + } + if (isSetSrcTokenReference) { + addIfNull(nulls, JSON_PROPERTY_SRC_TOKEN_REFERENCE, this.srcTokenReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CardDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CashAppDetails.java b/src/main/java/com/adyen/model/checkout/CashAppDetails.java index c1ab53394..4895a9ddb 100644 --- a/src/main/java/com/adyen/model/checkout/CashAppDetails.java +++ b/src/main/java/com/adyen/model/checkout/CashAppDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,34 +41,64 @@ public class CashAppDetails { public static final String JSON_PROPERTY_CASHTAG = "cashtag"; private String cashtag; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCashtag = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CUSTOMER_ID = "customerId"; private String customerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerId = false; + public static final String JSON_PROPERTY_GRANT_ID = "grantId"; private String grantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGrantId = false; + public static final String JSON_PROPERTY_ON_FILE_GRANT_ID = "onFileGrantId"; private String onFileGrantId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOnFileGrantId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** cashapp */ public enum TypeEnum { CASHAPP(String.valueOf("cashapp")); @@ -109,6 +141,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CashAppDetails() {} /** @@ -119,6 +160,7 @@ public CashAppDetails() {} */ public CashAppDetails cashtag(String cashtag) { this.cashtag = cashtag; + isSetCashtag = true; // mark as set return this; } @@ -142,6 +184,7 @@ public String getCashtag() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCashtag(String cashtag) { this.cashtag = cashtag; + isSetCashtag = true; // mark as set } /** @@ -152,6 +195,7 @@ public void setCashtag(String cashtag) { */ public CashAppDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -175,6 +219,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -185,6 +230,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public CashAppDetails customerId(String customerId) { this.customerId = customerId; + isSetCustomerId = true; // mark as set return this; } @@ -208,6 +254,7 @@ public String getCustomerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomerId(String customerId) { this.customerId = customerId; + isSetCustomerId = true; // mark as set } /** @@ -218,6 +265,7 @@ public void setCustomerId(String customerId) { */ public CashAppDetails grantId(String grantId) { this.grantId = grantId; + isSetGrantId = true; // mark as set return this; } @@ -241,6 +289,7 @@ public String getGrantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGrantId(String grantId) { this.grantId = grantId; + isSetGrantId = true; // mark as set } /** @@ -251,6 +300,7 @@ public void setGrantId(String grantId) { */ public CashAppDetails onFileGrantId(String onFileGrantId) { this.onFileGrantId = onFileGrantId; + isSetOnFileGrantId = true; // mark as set return this; } @@ -274,6 +324,7 @@ public String getOnFileGrantId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOnFileGrantId(String onFileGrantId) { this.onFileGrantId = onFileGrantId; + isSetOnFileGrantId = true; // mark as set } /** @@ -288,6 +339,7 @@ public void setOnFileGrantId(String onFileGrantId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public CashAppDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -319,6 +371,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -329,6 +382,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public CashAppDetails requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -352,6 +406,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -362,6 +417,7 @@ public void setRequestId(String requestId) { */ public CashAppDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -386,6 +442,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -398,6 +455,7 @@ public void setSdkData(String sdkData) { */ public CashAppDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -425,6 +483,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -435,6 +494,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public CashAppDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -458,6 +518,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -468,6 +529,7 @@ public void setSubtype(String subtype) { */ public CashAppDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -491,6 +553,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CashAppDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CashAppDetails object is equal to o. */ @@ -504,32 +587,56 @@ public boolean equals(Object o) { } CashAppDetails cashAppDetails = (CashAppDetails) o; return Objects.equals(this.cashtag, cashAppDetails.cashtag) + && Objects.equals(this.isSetCashtag, cashAppDetails.isSetCashtag) && Objects.equals(this.checkoutAttemptId, cashAppDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, cashAppDetails.isSetCheckoutAttemptId) && Objects.equals(this.customerId, cashAppDetails.customerId) + && Objects.equals(this.isSetCustomerId, cashAppDetails.isSetCustomerId) && Objects.equals(this.grantId, cashAppDetails.grantId) + && Objects.equals(this.isSetGrantId, cashAppDetails.isSetGrantId) && Objects.equals(this.onFileGrantId, cashAppDetails.onFileGrantId) + && Objects.equals(this.isSetOnFileGrantId, cashAppDetails.isSetOnFileGrantId) && Objects.equals(this.recurringDetailReference, cashAppDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, cashAppDetails.isSetRecurringDetailReference) && Objects.equals(this.requestId, cashAppDetails.requestId) + && Objects.equals(this.isSetRequestId, cashAppDetails.isSetRequestId) && Objects.equals(this.sdkData, cashAppDetails.sdkData) + && Objects.equals(this.isSetSdkData, cashAppDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, cashAppDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, cashAppDetails.isSetStoredPaymentMethodId) && Objects.equals(this.subtype, cashAppDetails.subtype) - && Objects.equals(this.type, cashAppDetails.type); + && Objects.equals(this.isSetSubtype, cashAppDetails.isSetSubtype) + && Objects.equals(this.type, cashAppDetails.type) + && Objects.equals(this.isSetType, cashAppDetails.isSetType); } @Override public int hashCode() { return Objects.hash( cashtag, + isSetCashtag, checkoutAttemptId, + isSetCheckoutAttemptId, customerId, + isSetCustomerId, grantId, + isSetGrantId, onFileGrantId, + isSetOnFileGrantId, recurringDetailReference, + isSetRecurringDetailReference, requestId, + isSetRequestId, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, subtype, - type); + isSetSubtype, + type, + isSetType); } @Override @@ -565,6 +672,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCashtag) { + addIfNull(nulls, JSON_PROPERTY_CASHTAG, this.cashtag); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCustomerId) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_ID, this.customerId); + } + if (isSetGrantId) { + addIfNull(nulls, JSON_PROPERTY_GRANT_ID, this.grantId); + } + if (isSetOnFileGrantId) { + addIfNull(nulls, JSON_PROPERTY_ON_FILE_GRANT_ID, this.onFileGrantId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CashAppDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CellulantDetails.java b/src/main/java/com/adyen/model/checkout/CellulantDetails.java index 2857742df..b88fabfcd 100644 --- a/src/main/java/com/adyen/model/checkout/CellulantDetails.java +++ b/src/main/java/com/adyen/model/checkout/CellulantDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class CellulantDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **Cellulant** */ public enum TypeEnum { CELLULANT(String.valueOf("cellulant")); @@ -80,6 +91,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CellulantDetails() {} /** @@ -90,6 +110,7 @@ public CellulantDetails() {} */ public CellulantDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public CellulantDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setIssuer(String issuer) { */ public CellulantDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -180,6 +205,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setSdkData(String sdkData) { */ public CellulantDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -213,6 +240,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CellulantDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CellulantDetails object is equal to o. */ @@ -226,14 +274,26 @@ public boolean equals(Object o) { } CellulantDetails cellulantDetails = (CellulantDetails) o; return Objects.equals(this.checkoutAttemptId, cellulantDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, cellulantDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, cellulantDetails.issuer) + && Objects.equals(this.isSetIssuer, cellulantDetails.isSetIssuer) && Objects.equals(this.sdkData, cellulantDetails.sdkData) - && Objects.equals(this.type, cellulantDetails.type); + && Objects.equals(this.isSetSdkData, cellulantDetails.isSetSdkData) + && Objects.equals(this.type, cellulantDetails.type) + && Objects.equals(this.isSetType, cellulantDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, issuer, sdkData, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -258,6 +318,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CellulantDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java b/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java index 7844abc1d..c11047b73 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutAwaitAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +34,15 @@ public class CheckoutAwaitAction { public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + /** **await** */ public enum TypeEnum { AWAIT(String.valueOf("await")); @@ -77,9 +85,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutAwaitAction() {} /** @@ -90,6 +110,7 @@ public CheckoutAwaitAction() {} */ public CheckoutAwaitAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutAwaitAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutAwaitAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -179,6 +204,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -189,6 +215,7 @@ public void setType(TypeEnum type) { */ public CheckoutAwaitAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -212,6 +239,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutAwaitAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutAwaitAction object is equal to o. */ @@ -225,14 +273,26 @@ public boolean equals(Object o) { } CheckoutAwaitAction checkoutAwaitAction = (CheckoutAwaitAction) o; return Objects.equals(this.paymentData, checkoutAwaitAction.paymentData) + && Objects.equals(this.isSetPaymentData, checkoutAwaitAction.isSetPaymentData) && Objects.equals(this.paymentMethodType, checkoutAwaitAction.paymentMethodType) + && Objects.equals(this.isSetPaymentMethodType, checkoutAwaitAction.isSetPaymentMethodType) && Objects.equals(this.type, checkoutAwaitAction.type) - && Objects.equals(this.url, checkoutAwaitAction.url); + && Objects.equals(this.isSetType, checkoutAwaitAction.isSetType) + && Objects.equals(this.url, checkoutAwaitAction.url) + && Objects.equals(this.isSetUrl, checkoutAwaitAction.isSetUrl); } @Override public int hashCode() { - return Objects.hash(paymentData, paymentMethodType, type, url); + return Objects.hash( + paymentData, + isSetPaymentData, + paymentMethodType, + isSetPaymentMethodType, + type, + isSetType, + url, + isSetUrl); } @Override @@ -257,6 +317,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutAwaitAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java b/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java index 35ecb5bde..4a6c2159e 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBankAccount.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -89,33 +91,69 @@ public static AccountTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private AccountTypeEnum accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT_NUMBER = "bankAccountNumber"; private String bankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CITY = "bankCity"; private String bankCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCity = false; + public static final String JSON_PROPERTY_BANK_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_BANK_NAME = "bankName"; private String bankName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankName = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_TAX_ID = "taxId"; private String taxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutBankAccount() {} /** @@ -126,6 +164,7 @@ public CheckoutBankAccount() {} */ public CheckoutBankAccount accountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -149,6 +188,7 @@ public AccountTypeEnum getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(AccountTypeEnum accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -159,6 +199,7 @@ public void setAccountType(AccountTypeEnum accountType) { */ public CheckoutBankAccount bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -182,6 +223,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -192,6 +234,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public CheckoutBankAccount bankCity(String bankCity) { this.bankCity = bankCity; + isSetBankCity = true; // mark as set return this; } @@ -215,6 +258,7 @@ public String getBankCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCity(String bankCity) { this.bankCity = bankCity; + isSetBankCity = true; // mark as set } /** @@ -226,6 +270,7 @@ public void setBankCity(String bankCity) { */ public CheckoutBankAccount bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -251,6 +296,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -261,6 +307,7 @@ public void setBankLocationId(String bankLocationId) { */ public CheckoutBankAccount bankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set return this; } @@ -284,6 +331,7 @@ public String getBankName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankName(String bankName) { this.bankName = bankName; + isSetBankName = true; // mark as set } /** @@ -296,6 +344,7 @@ public void setBankName(String bankName) { */ public CheckoutBankAccount bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -323,6 +372,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -335,6 +385,7 @@ public void setBic(String bic) { */ public CheckoutBankAccount countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -362,6 +413,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -374,6 +426,7 @@ public void setCountryCode(String countryCode) { */ public CheckoutBankAccount iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -401,6 +454,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -427,6 +481,7 @@ public void setIban(String iban) { */ public CheckoutBankAccount ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -482,6 +537,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -492,6 +548,7 @@ public void setOwnerName(String ownerName) { */ public CheckoutBankAccount taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -515,6 +572,27 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutBankAccount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutBankAccount object is equal to o. */ @@ -528,30 +606,50 @@ public boolean equals(Object o) { } CheckoutBankAccount checkoutBankAccount = (CheckoutBankAccount) o; return Objects.equals(this.accountType, checkoutBankAccount.accountType) + && Objects.equals(this.isSetAccountType, checkoutBankAccount.isSetAccountType) && Objects.equals(this.bankAccountNumber, checkoutBankAccount.bankAccountNumber) + && Objects.equals(this.isSetBankAccountNumber, checkoutBankAccount.isSetBankAccountNumber) && Objects.equals(this.bankCity, checkoutBankAccount.bankCity) + && Objects.equals(this.isSetBankCity, checkoutBankAccount.isSetBankCity) && Objects.equals(this.bankLocationId, checkoutBankAccount.bankLocationId) + && Objects.equals(this.isSetBankLocationId, checkoutBankAccount.isSetBankLocationId) && Objects.equals(this.bankName, checkoutBankAccount.bankName) + && Objects.equals(this.isSetBankName, checkoutBankAccount.isSetBankName) && Objects.equals(this.bic, checkoutBankAccount.bic) + && Objects.equals(this.isSetBic, checkoutBankAccount.isSetBic) && Objects.equals(this.countryCode, checkoutBankAccount.countryCode) + && Objects.equals(this.isSetCountryCode, checkoutBankAccount.isSetCountryCode) && Objects.equals(this.iban, checkoutBankAccount.iban) + && Objects.equals(this.isSetIban, checkoutBankAccount.isSetIban) && Objects.equals(this.ownerName, checkoutBankAccount.ownerName) - && Objects.equals(this.taxId, checkoutBankAccount.taxId); + && Objects.equals(this.isSetOwnerName, checkoutBankAccount.isSetOwnerName) + && Objects.equals(this.taxId, checkoutBankAccount.taxId) + && Objects.equals(this.isSetTaxId, checkoutBankAccount.isSetTaxId); } @Override public int hashCode() { return Objects.hash( accountType, + isSetAccountType, bankAccountNumber, + isSetBankAccountNumber, bankCity, + isSetBankCity, bankLocationId, + isSetBankLocationId, bankName, + isSetBankName, bic, + isSetBic, countryCode, + isSetCountryCode, iban, + isSetIban, ownerName, - taxId); + isSetOwnerName, + taxId, + isSetTaxId); } @Override @@ -582,6 +680,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankCity) { + addIfNull(nulls, JSON_PROPERTY_BANK_CITY, this.bankCity); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetBankName) { + addIfNull(nulls, JSON_PROPERTY_BANK_NAME, this.bankName); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutBankAccount given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java b/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java index 4cf158477..9980df2db 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutBankTransferAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,42 +45,81 @@ public class CheckoutBankTransferAction { public static final String JSON_PROPERTY_ACCOUNT_NUMBER = "accountNumber"; private String accountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BENEFICIARY = "beneficiary"; private String beneficiary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBeneficiary = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + public static final String JSON_PROPERTY_BRANCH_CODE = "branchCode"; private String branchCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBranchCode = false; + public static final String JSON_PROPERTY_DOWNLOAD_URL = "downloadUrl"; private String downloadUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDownloadUrl = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_ROUTING_NUMBER = "routingNumber"; private String routingNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRoutingNumber = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SORT_CODE = "sortCode"; private String sortCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSortCode = false; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; private Amount totalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + /** The type of the action. */ public enum TypeEnum { BANKTRANSFER(String.valueOf("bankTransfer")); @@ -121,9 +162,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutBankTransferAction() {} /** @@ -134,6 +187,7 @@ public CheckoutBankTransferAction() {} */ public CheckoutBankTransferAction accountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set return this; } @@ -157,6 +211,7 @@ public String getAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountNumber(String accountNumber) { this.accountNumber = accountNumber; + isSetAccountNumber = true; // mark as set } /** @@ -167,6 +222,7 @@ public void setAccountNumber(String accountNumber) { */ public CheckoutBankTransferAction bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -190,6 +246,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -200,6 +257,7 @@ public void setBankCode(String bankCode) { */ public CheckoutBankTransferAction beneficiary(String beneficiary) { this.beneficiary = beneficiary; + isSetBeneficiary = true; // mark as set return this; } @@ -223,6 +281,7 @@ public String getBeneficiary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBeneficiary(String beneficiary) { this.beneficiary = beneficiary; + isSetBeneficiary = true; // mark as set } /** @@ -233,6 +292,7 @@ public void setBeneficiary(String beneficiary) { */ public CheckoutBankTransferAction bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -256,6 +316,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -266,6 +327,7 @@ public void setBic(String bic) { */ public CheckoutBankTransferAction branchCode(String branchCode) { this.branchCode = branchCode; + isSetBranchCode = true; // mark as set return this; } @@ -289,6 +351,7 @@ public String getBranchCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBranchCode(String branchCode) { this.branchCode = branchCode; + isSetBranchCode = true; // mark as set } /** @@ -299,6 +362,7 @@ public void setBranchCode(String branchCode) { */ public CheckoutBankTransferAction downloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set return this; } @@ -322,6 +386,7 @@ public String getDownloadUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDownloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set } /** @@ -332,6 +397,7 @@ public void setDownloadUrl(String downloadUrl) { */ public CheckoutBankTransferAction iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -355,6 +421,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -365,6 +432,7 @@ public void setIban(String iban) { */ public CheckoutBankTransferAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -388,6 +456,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -398,6 +467,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutBankTransferAction reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -421,6 +491,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -431,6 +502,7 @@ public void setReference(String reference) { */ public CheckoutBankTransferAction routingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set return this; } @@ -454,6 +526,7 @@ public String getRoutingNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRoutingNumber(String routingNumber) { this.routingNumber = routingNumber; + isSetRoutingNumber = true; // mark as set } /** @@ -464,6 +537,7 @@ public void setRoutingNumber(String routingNumber) { */ public CheckoutBankTransferAction shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -487,6 +561,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -497,6 +572,7 @@ public void setShopperEmail(String shopperEmail) { */ public CheckoutBankTransferAction sortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set return this; } @@ -520,6 +596,7 @@ public String getSortCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSortCode(String sortCode) { this.sortCode = sortCode; + isSetSortCode = true; // mark as set } /** @@ -530,6 +607,7 @@ public void setSortCode(String sortCode) { */ public CheckoutBankTransferAction totalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set return this; } @@ -553,6 +631,7 @@ public Amount getTotalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set } /** @@ -563,6 +642,7 @@ public void setTotalAmount(Amount totalAmount) { */ public CheckoutBankTransferAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -586,6 +666,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -596,6 +677,7 @@ public void setType(TypeEnum type) { */ public CheckoutBankTransferAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -619,6 +701,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutBankTransferAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutBankTransferAction object is equal to o. */ @@ -632,40 +735,71 @@ public boolean equals(Object o) { } CheckoutBankTransferAction checkoutBankTransferAction = (CheckoutBankTransferAction) o; return Objects.equals(this.accountNumber, checkoutBankTransferAction.accountNumber) + && Objects.equals(this.isSetAccountNumber, checkoutBankTransferAction.isSetAccountNumber) && Objects.equals(this.bankCode, checkoutBankTransferAction.bankCode) + && Objects.equals(this.isSetBankCode, checkoutBankTransferAction.isSetBankCode) && Objects.equals(this.beneficiary, checkoutBankTransferAction.beneficiary) + && Objects.equals(this.isSetBeneficiary, checkoutBankTransferAction.isSetBeneficiary) && Objects.equals(this.bic, checkoutBankTransferAction.bic) + && Objects.equals(this.isSetBic, checkoutBankTransferAction.isSetBic) && Objects.equals(this.branchCode, checkoutBankTransferAction.branchCode) + && Objects.equals(this.isSetBranchCode, checkoutBankTransferAction.isSetBranchCode) && Objects.equals(this.downloadUrl, checkoutBankTransferAction.downloadUrl) + && Objects.equals(this.isSetDownloadUrl, checkoutBankTransferAction.isSetDownloadUrl) && Objects.equals(this.iban, checkoutBankTransferAction.iban) + && Objects.equals(this.isSetIban, checkoutBankTransferAction.isSetIban) && Objects.equals(this.paymentMethodType, checkoutBankTransferAction.paymentMethodType) + && Objects.equals( + this.isSetPaymentMethodType, checkoutBankTransferAction.isSetPaymentMethodType) && Objects.equals(this.reference, checkoutBankTransferAction.reference) + && Objects.equals(this.isSetReference, checkoutBankTransferAction.isSetReference) && Objects.equals(this.routingNumber, checkoutBankTransferAction.routingNumber) + && Objects.equals(this.isSetRoutingNumber, checkoutBankTransferAction.isSetRoutingNumber) && Objects.equals(this.shopperEmail, checkoutBankTransferAction.shopperEmail) + && Objects.equals(this.isSetShopperEmail, checkoutBankTransferAction.isSetShopperEmail) && Objects.equals(this.sortCode, checkoutBankTransferAction.sortCode) + && Objects.equals(this.isSetSortCode, checkoutBankTransferAction.isSetSortCode) && Objects.equals(this.totalAmount, checkoutBankTransferAction.totalAmount) + && Objects.equals(this.isSetTotalAmount, checkoutBankTransferAction.isSetTotalAmount) && Objects.equals(this.type, checkoutBankTransferAction.type) - && Objects.equals(this.url, checkoutBankTransferAction.url); + && Objects.equals(this.isSetType, checkoutBankTransferAction.isSetType) + && Objects.equals(this.url, checkoutBankTransferAction.url) + && Objects.equals(this.isSetUrl, checkoutBankTransferAction.isSetUrl); } @Override public int hashCode() { return Objects.hash( accountNumber, + isSetAccountNumber, bankCode, + isSetBankCode, beneficiary, + isSetBeneficiary, bic, + isSetBic, branchCode, + isSetBranchCode, downloadUrl, + isSetDownloadUrl, iban, + isSetIban, paymentMethodType, + isSetPaymentMethodType, reference, + isSetReference, routingNumber, + isSetRoutingNumber, shopperEmail, + isSetShopperEmail, sortCode, + isSetSortCode, totalAmount, + isSetTotalAmount, type, - url); + isSetType, + url, + isSetUrl); } @Override @@ -701,6 +835,72 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_NUMBER, this.accountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBeneficiary) { + addIfNull(nulls, JSON_PROPERTY_BENEFICIARY, this.beneficiary); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetBranchCode) { + addIfNull(nulls, JSON_PROPERTY_BRANCH_CODE, this.branchCode); + } + if (isSetDownloadUrl) { + addIfNull(nulls, JSON_PROPERTY_DOWNLOAD_URL, this.downloadUrl); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRoutingNumber) { + addIfNull(nulls, JSON_PROPERTY_ROUTING_NUMBER, this.routingNumber); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetSortCode) { + addIfNull(nulls, JSON_PROPERTY_SORT_CODE, this.sortCode); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutBankTransferAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java b/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java index 3ac65b281..f43416532 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutDelegatedAuthenticationAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,15 +36,27 @@ public class CheckoutDelegatedAuthenticationAction { public static final String JSON_PROPERTY_AUTHORISATION_TOKEN = "authorisationToken"; private String authorisationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationToken = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + /** **delegatedAuthentication** */ public enum TypeEnum { DELEGATEDAUTHENTICATION(String.valueOf("delegatedAuthentication")); @@ -85,9 +99,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutDelegatedAuthenticationAction() {} /** @@ -99,6 +125,7 @@ public CheckoutDelegatedAuthenticationAction() {} */ public CheckoutDelegatedAuthenticationAction authorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getAuthorisationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set } /** @@ -133,6 +161,7 @@ public void setAuthorisationToken(String authorisationToken) { */ public CheckoutDelegatedAuthenticationAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -156,6 +185,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -167,6 +197,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutDelegatedAuthenticationAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -190,6 +221,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -201,6 +233,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutDelegatedAuthenticationAction token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -224,6 +257,7 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set } /** @@ -235,6 +269,7 @@ public void setToken(String token) { */ public CheckoutDelegatedAuthenticationAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -258,6 +293,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -269,6 +305,7 @@ public void setType(TypeEnum type) { */ public CheckoutDelegatedAuthenticationAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -292,6 +329,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutDelegatedAuthenticationAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutDelegatedAuthenticationAction object is equal to o. */ @@ -307,17 +365,40 @@ public boolean equals(Object o) { (CheckoutDelegatedAuthenticationAction) o; return Objects.equals( this.authorisationToken, checkoutDelegatedAuthenticationAction.authorisationToken) + && Objects.equals( + this.isSetAuthorisationToken, + checkoutDelegatedAuthenticationAction.isSetAuthorisationToken) && Objects.equals(this.paymentData, checkoutDelegatedAuthenticationAction.paymentData) + && Objects.equals( + this.isSetPaymentData, checkoutDelegatedAuthenticationAction.isSetPaymentData) && Objects.equals( this.paymentMethodType, checkoutDelegatedAuthenticationAction.paymentMethodType) + && Objects.equals( + this.isSetPaymentMethodType, + checkoutDelegatedAuthenticationAction.isSetPaymentMethodType) && Objects.equals(this.token, checkoutDelegatedAuthenticationAction.token) + && Objects.equals(this.isSetToken, checkoutDelegatedAuthenticationAction.isSetToken) && Objects.equals(this.type, checkoutDelegatedAuthenticationAction.type) - && Objects.equals(this.url, checkoutDelegatedAuthenticationAction.url); + && Objects.equals(this.isSetType, checkoutDelegatedAuthenticationAction.isSetType) + && Objects.equals(this.url, checkoutDelegatedAuthenticationAction.url) + && Objects.equals(this.isSetUrl, checkoutDelegatedAuthenticationAction.isSetUrl); } @Override public int hashCode() { - return Objects.hash(authorisationToken, paymentData, paymentMethodType, token, type, url); + return Objects.hash( + authorisationToken, + isSetAuthorisationToken, + paymentData, + isSetPaymentData, + paymentMethodType, + isSetPaymentMethodType, + token, + isSetToken, + type, + isSetType, + url, + isSetUrl); } @Override @@ -344,6 +425,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthorisationToken) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TOKEN, this.authorisationToken); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutDelegatedAuthenticationAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java new file mode 100644 index 000000000..8e2c0da30 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java @@ -0,0 +1,463 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CheckoutForwardRequest */ +@JsonPropertyOrder({ + CheckoutForwardRequest.JSON_PROPERTY_BASE_URL, + CheckoutForwardRequest.JSON_PROPERTY_MERCHANT_ACCOUNT, + CheckoutForwardRequest.JSON_PROPERTY_OPTIONS, + CheckoutForwardRequest.JSON_PROPERTY_REQUEST, + CheckoutForwardRequest.JSON_PROPERTY_SHOPPER_REFERENCE, + CheckoutForwardRequest.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID +}) +public class CheckoutForwardRequest { + public static final String JSON_PROPERTY_BASE_URL = "baseUrl"; + private String baseUrl; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBaseUrl = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; + private String merchantAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private CheckoutForwardRequestOptions options; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOptions = false; + + public static final String JSON_PROPERTY_REQUEST = "request"; + private CheckoutOutgoingForwardRequest request; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequest = false; + + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; + private String shopperReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardRequest() {} + + /** + * The base URL of the third party API, where Adyen will send the request to forward the payment + * details. + * + * @param baseUrl The base URL of the third party API, where Adyen will send the request to + * forward the payment details. + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest baseUrl(String baseUrl) { + this.baseUrl = baseUrl; + isSetBaseUrl = true; // mark as set + return this; + } + + /** + * The base URL of the third party API, where Adyen will send the request to forward the payment + * details. + * + * @return baseUrl The base URL of the third party API, where Adyen will send the request to + * forward the payment details. + */ + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaseUrl() { + return baseUrl; + } + + /** + * The base URL of the third party API, where Adyen will send the request to forward the payment + * details. + * + * @param baseUrl The base URL of the third party API, where Adyen will send the request to + * forward the payment details. + */ + @JsonProperty(JSON_PROPERTY_BASE_URL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaseUrl(String baseUrl) { + this.baseUrl = baseUrl; + isSetBaseUrl = true; // mark as set + } + + /** + * Your merchant account. + * + * @param merchantAccount Your merchant account. + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest merchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + return this; + } + + /** + * Your merchant account. + * + * @return merchantAccount Your merchant account. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantAccount() { + return merchantAccount; + } + + /** + * Your merchant account. + * + * @param merchantAccount Your merchant account. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + } + + /** + * options + * + * @param options + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest options(CheckoutForwardRequestOptions options) { + this.options = options; + isSetOptions = true; // mark as set + return this; + } + + /** + * Get options + * + * @return options + */ + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutForwardRequestOptions getOptions() { + return options; + } + + /** + * options + * + * @param options + */ + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOptions(CheckoutForwardRequestOptions options) { + this.options = options; + isSetOptions = true; // mark as set + } + + /** + * request + * + * @param request + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest request(CheckoutOutgoingForwardRequest request) { + this.request = request; + isSetRequest = true; // mark as set + return this; + } + + /** + * Get request + * + * @return request + */ + @JsonProperty(JSON_PROPERTY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutOutgoingForwardRequest getRequest() { + return request; + } + + /** + * request + * + * @param request + */ + @JsonProperty(JSON_PROPERTY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequest(CheckoutOutgoingForwardRequest request) { + this.request = request; + isSetRequest = true; // mark as set + } + + /** + * Your reference to uniquely identify this shopper, for example user ID or account ID. The value + * is case-sensitive and must be at least three characters. > Your reference must not include + * personally identifiable information (PII) such as name or email address. + * + * @param shopperReference Your reference to uniquely identify this shopper, for example user ID + * or account ID. The value is case-sensitive and must be at least three characters. > Your + * reference must not include personally identifiable information (PII) such as name or email + * address. + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest shopperReference(String shopperReference) { + this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + return this; + } + + /** + * Your reference to uniquely identify this shopper, for example user ID or account ID. The value + * is case-sensitive and must be at least three characters. > Your reference must not include + * personally identifiable information (PII) such as name or email address. + * + * @return shopperReference Your reference to uniquely identify this shopper, for example user ID + * or account ID. The value is case-sensitive and must be at least three characters. > Your + * reference must not include personally identifiable information (PII) such as name or email + * address. + */ + @JsonProperty(JSON_PROPERTY_SHOPPER_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShopperReference() { + return shopperReference; + } + + /** + * Your reference to uniquely identify this shopper, for example user ID or account ID. The value + * is case-sensitive and must be at least three characters. > Your reference must not include + * personally identifiable information (PII) such as name or email address. + * + * @param shopperReference Your reference to uniquely identify this shopper, for example user ID + * or account ID. The value is case-sensitive and must be at least three characters. > Your + * reference must not include personally identifiable information (PII) such as name or email + * address. + */ + @JsonProperty(JSON_PROPERTY_SHOPPER_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShopperReference(String shopperReference) { + this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * The unique identifier of the token that you want to forward to the third party. This is the + * `storedPaymentMethodId` you received in the webhook after you created the token. + * + * @param storedPaymentMethodId The unique identifier of the token that you want to forward to the + * third party. This is the `storedPaymentMethodId` you received in the webhook + * after you created the token. + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * The unique identifier of the token that you want to forward to the third party. This is the + * `storedPaymentMethodId` you received in the webhook after you created the token. + * + * @return storedPaymentMethodId The unique identifier of the token that you want to forward to + * the third party. This is the `storedPaymentMethodId` you received in the webhook + * after you created the token. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * The unique identifier of the token that you want to forward to the third party. This is the + * `storedPaymentMethodId` you received in the webhook after you created the token. + * + * @param storedPaymentMethodId The unique identifier of the token that you want to forward to the + * third party. This is the `storedPaymentMethodId` you received in the webhook + * after you created the token. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutForwardRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardRequest checkoutForwardRequest = (CheckoutForwardRequest) o; + return Objects.equals(this.baseUrl, checkoutForwardRequest.baseUrl) + && Objects.equals(this.isSetBaseUrl, checkoutForwardRequest.isSetBaseUrl) + && Objects.equals(this.merchantAccount, checkoutForwardRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, checkoutForwardRequest.isSetMerchantAccount) + && Objects.equals(this.options, checkoutForwardRequest.options) + && Objects.equals(this.isSetOptions, checkoutForwardRequest.isSetOptions) + && Objects.equals(this.request, checkoutForwardRequest.request) + && Objects.equals(this.isSetRequest, checkoutForwardRequest.isSetRequest) + && Objects.equals(this.shopperReference, checkoutForwardRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, checkoutForwardRequest.isSetShopperReference) + && Objects.equals(this.storedPaymentMethodId, checkoutForwardRequest.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, checkoutForwardRequest.isSetStoredPaymentMethodId); + } + + @Override + public int hashCode() { + return Objects.hash( + baseUrl, + isSetBaseUrl, + merchantAccount, + isSetMerchantAccount, + options, + isSetOptions, + request, + isSetRequest, + shopperReference, + isSetShopperReference, + storedPaymentMethodId, + isSetStoredPaymentMethodId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardRequest {\n"); + sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).append("\n"); + sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBaseUrl) { + addIfNull(nulls, JSON_PROPERTY_BASE_URL, this.baseUrl); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOptions) { + addIfNull(nulls, JSON_PROPERTY_OPTIONS, this.options); + } + if (isSetRequest) { + addIfNull(nulls, JSON_PROPERTY_REQUEST, this.request); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutForwardRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardRequest + */ + public static CheckoutForwardRequest fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardRequest.class); + } + + /** + * Convert an instance of CheckoutForwardRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java new file mode 100644 index 000000000..3f6c471d2 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java @@ -0,0 +1,353 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CheckoutForwardRequestOptions */ +@JsonPropertyOrder({ + CheckoutForwardRequestOptions.JSON_PROPERTY_ACCOUNT_UPDATE, + CheckoutForwardRequestOptions.JSON_PROPERTY_DRY_RUN, + CheckoutForwardRequestOptions.JSON_PROPERTY_NETWORK_TOKEN, + CheckoutForwardRequestOptions.JSON_PROPERTY_TOKENIZE +}) +public class CheckoutForwardRequestOptions { + public static final String JSON_PROPERTY_ACCOUNT_UPDATE = "accountUpdate"; + private Boolean accountUpdate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountUpdate = false; + + public static final String JSON_PROPERTY_DRY_RUN = "dryRun"; + private Boolean dryRun; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDryRun = false; + + public static final String JSON_PROPERTY_NETWORK_TOKEN = "networkToken"; + private CheckoutNetworkTokenOption networkToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkToken = false; + + public static final String JSON_PROPERTY_TOKENIZE = "tokenize"; + private Boolean tokenize; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenize = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardRequestOptions() {} + + /** + * Whether to check for a card account update (true) or not (false) + * + * @param accountUpdate Whether to check for a card account update (true) or not (false) + * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method + * chaining + */ + public CheckoutForwardRequestOptions accountUpdate(Boolean accountUpdate) { + this.accountUpdate = accountUpdate; + isSetAccountUpdate = true; // mark as set + return this; + } + + /** + * Whether to check for a card account update (true) or not (false) + * + * @return accountUpdate Whether to check for a card account update (true) or not (false) + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAccountUpdate() { + return accountUpdate; + } + + /** + * Whether to check for a card account update (true) or not (false) + * + * @param accountUpdate Whether to check for a card account update (true) or not (false) + */ + @JsonProperty(JSON_PROPERTY_ACCOUNT_UPDATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAccountUpdate(Boolean accountUpdate) { + this.accountUpdate = accountUpdate; + isSetAccountUpdate = true; // mark as set + } + + /** + * Set to **true** to receive a copy of the request Adyen is making to the third party in the + * response. Any sensitive information will be masked in the response you receive. This + * functionality is only available in the test environment. + * + * @param dryRun Set to **true** to receive a copy of the request Adyen is making to the third + * party in the response. Any sensitive information will be masked in the response you + * receive. This functionality is only available in the test environment. + * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method + * chaining + */ + public CheckoutForwardRequestOptions dryRun(Boolean dryRun) { + this.dryRun = dryRun; + isSetDryRun = true; // mark as set + return this; + } + + /** + * Set to **true** to receive a copy of the request Adyen is making to the third party in the + * response. Any sensitive information will be masked in the response you receive. This + * functionality is only available in the test environment. + * + * @return dryRun Set to **true** to receive a copy of the request Adyen is making to the third + * party in the response. Any sensitive information will be masked in the response you + * receive. This functionality is only available in the test environment. + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDryRun() { + return dryRun; + } + + /** + * Set to **true** to receive a copy of the request Adyen is making to the third party in the + * response. Any sensitive information will be masked in the response you receive. This + * functionality is only available in the test environment. + * + * @param dryRun Set to **true** to receive a copy of the request Adyen is making to the third + * party in the response. Any sensitive information will be masked in the response you + * receive. This functionality is only available in the test environment. + */ + @JsonProperty(JSON_PROPERTY_DRY_RUN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDryRun(Boolean dryRun) { + this.dryRun = dryRun; + isSetDryRun = true; // mark as set + } + + /** + * networkToken + * + * @param networkToken + * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method + * chaining + */ + public CheckoutForwardRequestOptions networkToken(CheckoutNetworkTokenOption networkToken) { + this.networkToken = networkToken; + isSetNetworkToken = true; // mark as set + return this; + } + + /** + * Get networkToken + * + * @return networkToken + */ + @JsonProperty(JSON_PROPERTY_NETWORK_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutNetworkTokenOption getNetworkToken() { + return networkToken; + } + + /** + * networkToken + * + * @param networkToken + */ + @JsonProperty(JSON_PROPERTY_NETWORK_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkToken(CheckoutNetworkTokenOption networkToken) { + this.networkToken = networkToken; + isSetNetworkToken = true; // mark as set + } + + /** + * Set to **true**, the payment details are + * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * + * @param tokenize Set to **true**, the payment details are + * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method + * chaining + */ + public CheckoutForwardRequestOptions tokenize(Boolean tokenize) { + this.tokenize = tokenize; + isSetTokenize = true; // mark as set + return this; + } + + /** + * Set to **true**, the payment details are + * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * + * @return tokenize Set to **true**, the payment details are + * [tokenized](https://docs.adyen.com/online-payments/tokenization). + */ + @JsonProperty(JSON_PROPERTY_TOKENIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getTokenize() { + return tokenize; + } + + /** + * Set to **true**, the payment details are + * [tokenized](https://docs.adyen.com/online-payments/tokenization). + * + * @param tokenize Set to **true**, the payment details are + * [tokenized](https://docs.adyen.com/online-payments/tokenization). + */ + @JsonProperty(JSON_PROPERTY_TOKENIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTokenize(Boolean tokenize) { + this.tokenize = tokenize; + isSetTokenize = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardRequestOptions includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutForwardRequestOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardRequestOptions checkoutForwardRequestOptions = (CheckoutForwardRequestOptions) o; + return Objects.equals(this.accountUpdate, checkoutForwardRequestOptions.accountUpdate) + && Objects.equals(this.isSetAccountUpdate, checkoutForwardRequestOptions.isSetAccountUpdate) + && Objects.equals(this.dryRun, checkoutForwardRequestOptions.dryRun) + && Objects.equals(this.isSetDryRun, checkoutForwardRequestOptions.isSetDryRun) + && Objects.equals(this.networkToken, checkoutForwardRequestOptions.networkToken) + && Objects.equals(this.isSetNetworkToken, checkoutForwardRequestOptions.isSetNetworkToken) + && Objects.equals(this.tokenize, checkoutForwardRequestOptions.tokenize) + && Objects.equals(this.isSetTokenize, checkoutForwardRequestOptions.isSetTokenize); + } + + @Override + public int hashCode() { + return Objects.hash( + accountUpdate, + isSetAccountUpdate, + dryRun, + isSetDryRun, + networkToken, + isSetNetworkToken, + tokenize, + isSetTokenize); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardRequestOptions {\n"); + sb.append(" accountUpdate: ").append(toIndentedString(accountUpdate)).append("\n"); + sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); + sb.append(" networkToken: ").append(toIndentedString(networkToken)).append("\n"); + sb.append(" tokenize: ").append(toIndentedString(tokenize)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountUpdate) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_UPDATE, this.accountUpdate); + } + if (isSetDryRun) { + addIfNull(nulls, JSON_PROPERTY_DRY_RUN, this.dryRun); + } + if (isSetNetworkToken) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN, this.networkToken); + } + if (isSetTokenize) { + addIfNull(nulls, JSON_PROPERTY_TOKENIZE, this.tokenize); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutForwardRequestOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardRequestOptions + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardRequestOptions + */ + public static CheckoutForwardRequestOptions fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardRequestOptions.class); + } + + /** + * Convert an instance of CheckoutForwardRequestOptions to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java new file mode 100644 index 000000000..59161dc8f --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardResponse.java @@ -0,0 +1,292 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CheckoutForwardResponse */ +@JsonPropertyOrder({ + CheckoutForwardResponse.JSON_PROPERTY_PSP_REFERENCE, + CheckoutForwardResponse.JSON_PROPERTY_RESPONSE, + CheckoutForwardResponse.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID +}) +public class CheckoutForwardResponse { + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; + private String pspReference; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + + public static final String JSON_PROPERTY_RESPONSE = "response"; + private CheckoutForwardResponseFromUrl response; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResponse = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardResponse() {} + + /** + * Adyen's 16-character reference associated with the transaction/request. This value is + * globally unique. Use this reference when you communicate with us about this request. + * + * @param pspReference Adyen's 16-character reference associated with the transaction/request. + * This value is globally unique. Use this reference when you communicate with us about this + * request. + * @return the current {@code CheckoutForwardResponse} instance, allowing for method chaining + */ + public CheckoutForwardResponse pspReference(String pspReference) { + this.pspReference = pspReference; + isSetPspReference = true; // mark as set + return this; + } + + /** + * Adyen's 16-character reference associated with the transaction/request. This value is + * globally unique. Use this reference when you communicate with us about this request. + * + * @return pspReference Adyen's 16-character reference associated with the + * transaction/request. This value is globally unique. Use this reference when you communicate + * with us about this request. + */ + @JsonProperty(JSON_PROPERTY_PSP_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPspReference() { + return pspReference; + } + + /** + * Adyen's 16-character reference associated with the transaction/request. This value is + * globally unique. Use this reference when you communicate with us about this request. + * + * @param pspReference Adyen's 16-character reference associated with the transaction/request. + * This value is globally unique. Use this reference when you communicate with us about this + * request. + */ + @JsonProperty(JSON_PROPERTY_PSP_REFERENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPspReference(String pspReference) { + this.pspReference = pspReference; + isSetPspReference = true; // mark as set + } + + /** + * response + * + * @param response + * @return the current {@code CheckoutForwardResponse} instance, allowing for method chaining + */ + public CheckoutForwardResponse response(CheckoutForwardResponseFromUrl response) { + this.response = response; + isSetResponse = true; // mark as set + return this; + } + + /** + * Get response + * + * @return response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutForwardResponseFromUrl getResponse() { + return response; + } + + /** + * response + * + * @param response + */ + @JsonProperty(JSON_PROPERTY_RESPONSE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setResponse(CheckoutForwardResponseFromUrl response) { + this.response = response; + isSetResponse = true; // mark as set + } + + /** + * The unique identifier of the token. + * + * @param storedPaymentMethodId The unique identifier of the token. + * @return the current {@code CheckoutForwardResponse} instance, allowing for method chaining + */ + public CheckoutForwardResponse storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * The unique identifier of the token. + * + * @return storedPaymentMethodId The unique identifier of the token. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * The unique identifier of the token. + * + * @param storedPaymentMethodId The unique identifier of the token. + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutForwardResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardResponse checkoutForwardResponse = (CheckoutForwardResponse) o; + return Objects.equals(this.pspReference, checkoutForwardResponse.pspReference) + && Objects.equals(this.isSetPspReference, checkoutForwardResponse.isSetPspReference) + && Objects.equals(this.response, checkoutForwardResponse.response) + && Objects.equals(this.isSetResponse, checkoutForwardResponse.isSetResponse) + && Objects.equals(this.storedPaymentMethodId, checkoutForwardResponse.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, checkoutForwardResponse.isSetStoredPaymentMethodId); + } + + @Override + public int hashCode() { + return Objects.hash( + pspReference, + isSetPspReference, + response, + isSetResponse, + storedPaymentMethodId, + isSetStoredPaymentMethodId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardResponse {\n"); + sb.append(" pspReference: ").append(toIndentedString(pspReference)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetResponse) { + addIfNull(nulls, JSON_PROPERTY_RESPONSE, this.response); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutForwardResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardResponse + */ + public static CheckoutForwardResponse fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardResponse.class); + } + + /** + * Convert an instance of CheckoutForwardResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardResponseFromUrl.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardResponseFromUrl.java new file mode 100644 index 000000000..443f05064 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardResponseFromUrl.java @@ -0,0 +1,289 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.HashMap; +import java.util.Map; + +/** CheckoutForwardResponseFromUrl */ +@JsonPropertyOrder({ + CheckoutForwardResponseFromUrl.JSON_PROPERTY_BODY, + CheckoutForwardResponseFromUrl.JSON_PROPERTY_HEADERS, + CheckoutForwardResponseFromUrl.JSON_PROPERTY_STATUS +}) +public class CheckoutForwardResponseFromUrl { + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBody = false; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private Map headers; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHeaders = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Integer status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardResponseFromUrl() {} + + /** + * The body of the response Adyen received from the third party, in string format. + * + * @param body The body of the response Adyen received from the third party, in string format. + * @return the current {@code CheckoutForwardResponseFromUrl} instance, allowing for method + * chaining + */ + public CheckoutForwardResponseFromUrl body(String body) { + this.body = body; + isSetBody = true; // mark as set + return this; + } + + /** + * The body of the response Adyen received from the third party, in string format. + * + * @return body The body of the response Adyen received from the third party, in string format. + */ + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBody() { + return body; + } + + /** + * The body of the response Adyen received from the third party, in string format. + * + * @param body The body of the response Adyen received from the third party, in string format. + */ + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(String body) { + this.body = body; + isSetBody = true; // mark as set + } + + /** + * The HTTP headers of the response Adyen received from the third party. + * + * @param headers The HTTP headers of the response Adyen received from the third party. + * @return the current {@code CheckoutForwardResponseFromUrl} instance, allowing for method + * chaining + */ + public CheckoutForwardResponseFromUrl headers(Map headers) { + this.headers = headers; + isSetHeaders = true; // mark as set + return this; + } + + public CheckoutForwardResponseFromUrl putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The HTTP headers of the response Adyen received from the third party. + * + * @return headers The HTTP headers of the response Adyen received from the third party. + */ + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + /** + * The HTTP headers of the response Adyen received from the third party. + * + * @param headers The HTTP headers of the response Adyen received from the third party. + */ + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(Map headers) { + this.headers = headers; + isSetHeaders = true; // mark as set + } + + /** + * The HTTP status of the response Adyen received from the third party. + * + * @param status The HTTP status of the response Adyen received from the third party. + * @return the current {@code CheckoutForwardResponseFromUrl} instance, allowing for method + * chaining + */ + public CheckoutForwardResponseFromUrl status(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The HTTP status of the response Adyen received from the third party. + * + * @return status The HTTP status of the response Adyen received from the third party. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + /** + * The HTTP status of the response Adyen received from the third party. + * + * @param status The HTTP status of the response Adyen received from the third party. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardResponseFromUrl includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutForwardResponseFromUrl object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardResponseFromUrl checkoutForwardResponseFromUrl = + (CheckoutForwardResponseFromUrl) o; + return Objects.equals(this.body, checkoutForwardResponseFromUrl.body) + && Objects.equals(this.isSetBody, checkoutForwardResponseFromUrl.isSetBody) + && Objects.equals(this.headers, checkoutForwardResponseFromUrl.headers) + && Objects.equals(this.isSetHeaders, checkoutForwardResponseFromUrl.isSetHeaders) + && Objects.equals(this.status, checkoutForwardResponseFromUrl.status) + && Objects.equals(this.isSetStatus, checkoutForwardResponseFromUrl.isSetStatus); + } + + @Override + public int hashCode() { + return Objects.hash(body, isSetBody, headers, isSetHeaders, status, isSetStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardResponseFromUrl {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBody) { + addIfNull(nulls, JSON_PROPERTY_BODY, this.body); + } + if (isSetHeaders) { + addIfNull(nulls, JSON_PROPERTY_HEADERS, this.headers); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutForwardResponseFromUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardResponseFromUrl + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardResponseFromUrl + */ + public static CheckoutForwardResponseFromUrl fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardResponseFromUrl.class); + } + + /** + * Convert an instance of CheckoutForwardResponseFromUrl to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java b/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java index 5d4a6b3c1..a1bd9c127 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutNativeRedirectAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,15 +38,27 @@ public class CheckoutNativeRedirectAction { public static final String JSON_PROPERTY_DATA = "data"; private Map data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_METHOD = "method"; private String method; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMethod = false; + public static final String JSON_PROPERTY_NATIVE_REDIRECT_DATA = "nativeRedirectData"; private String nativeRedirectData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNativeRedirectData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + /** **nativeRedirect** */ public enum TypeEnum { NATIVEREDIRECT(String.valueOf("nativeRedirect")); @@ -87,9 +101,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutNativeRedirectAction() {} /** @@ -101,6 +127,7 @@ public CheckoutNativeRedirectAction() {} */ public CheckoutNativeRedirectAction data(Map data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -134,6 +161,7 @@ public Map getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(Map data) { this.data = data; + isSetData = true; // mark as set } /** @@ -144,6 +172,7 @@ public void setData(Map data) { */ public CheckoutNativeRedirectAction method(String method) { this.method = method; + isSetMethod = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMethod(String method) { this.method = method; + isSetMethod = true; // mark as set } /** @@ -179,6 +209,7 @@ public void setMethod(String method) { */ public CheckoutNativeRedirectAction nativeRedirectData(String nativeRedirectData) { this.nativeRedirectData = nativeRedirectData; + isSetNativeRedirectData = true; // mark as set return this; } @@ -206,6 +237,7 @@ public String getNativeRedirectData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNativeRedirectData(String nativeRedirectData) { this.nativeRedirectData = nativeRedirectData; + isSetNativeRedirectData = true; // mark as set } /** @@ -216,6 +248,7 @@ public void setNativeRedirectData(String nativeRedirectData) { */ public CheckoutNativeRedirectAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -239,6 +272,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -249,6 +283,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutNativeRedirectAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -272,6 +307,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -282,6 +318,7 @@ public void setType(TypeEnum type) { */ public CheckoutNativeRedirectAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -305,6 +342,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutNativeRedirectAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutNativeRedirectAction object is equal to o. */ @@ -318,16 +376,36 @@ public boolean equals(Object o) { } CheckoutNativeRedirectAction checkoutNativeRedirectAction = (CheckoutNativeRedirectAction) o; return Objects.equals(this.data, checkoutNativeRedirectAction.data) + && Objects.equals(this.isSetData, checkoutNativeRedirectAction.isSetData) && Objects.equals(this.method, checkoutNativeRedirectAction.method) + && Objects.equals(this.isSetMethod, checkoutNativeRedirectAction.isSetMethod) && Objects.equals(this.nativeRedirectData, checkoutNativeRedirectAction.nativeRedirectData) + && Objects.equals( + this.isSetNativeRedirectData, checkoutNativeRedirectAction.isSetNativeRedirectData) && Objects.equals(this.paymentMethodType, checkoutNativeRedirectAction.paymentMethodType) + && Objects.equals( + this.isSetPaymentMethodType, checkoutNativeRedirectAction.isSetPaymentMethodType) && Objects.equals(this.type, checkoutNativeRedirectAction.type) - && Objects.equals(this.url, checkoutNativeRedirectAction.url); + && Objects.equals(this.isSetType, checkoutNativeRedirectAction.isSetType) + && Objects.equals(this.url, checkoutNativeRedirectAction.url) + && Objects.equals(this.isSetUrl, checkoutNativeRedirectAction.isSetUrl); } @Override public int hashCode() { - return Objects.hash(data, method, nativeRedirectData, paymentMethodType, type, url); + return Objects.hash( + data, + isSetData, + method, + isSetMethod, + nativeRedirectData, + isSetNativeRedirectData, + paymentMethodType, + isSetPaymentMethodType, + type, + isSetType, + url, + isSetUrl); } @Override @@ -354,6 +432,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetMethod) { + addIfNull(nulls, JSON_PROPERTY_METHOD, this.method); + } + if (isSetNativeRedirectData) { + addIfNull(nulls, JSON_PROPERTY_NATIVE_REDIRECT_DATA, this.nativeRedirectData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutNativeRedirectAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutNetworkTokenOption.java b/src/main/java/com/adyen/model/checkout/CheckoutNetworkTokenOption.java new file mode 100644 index 000000000..c31c96dd7 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutNetworkTokenOption.java @@ -0,0 +1,230 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CheckoutNetworkTokenOption */ +@JsonPropertyOrder({ + CheckoutNetworkTokenOption.JSON_PROPERTY_INCLUDE_CRYPTOGRAM, + CheckoutNetworkTokenOption.JSON_PROPERTY_USE_NETWORK_TOKEN +}) +public class CheckoutNetworkTokenOption { + public static final String JSON_PROPERTY_INCLUDE_CRYPTOGRAM = "includeCryptogram"; + private Boolean includeCryptogram; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIncludeCryptogram = false; + + public static final String JSON_PROPERTY_USE_NETWORK_TOKEN = "useNetworkToken"; + private Boolean useNetworkToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUseNetworkToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutNetworkTokenOption() {} + + /** + * Set to **true** to enable forwarding network token cryptograms. + * + * @param includeCryptogram Set to **true** to enable forwarding network token cryptograms. + * @return the current {@code CheckoutNetworkTokenOption} instance, allowing for method chaining + */ + public CheckoutNetworkTokenOption includeCryptogram(Boolean includeCryptogram) { + this.includeCryptogram = includeCryptogram; + isSetIncludeCryptogram = true; // mark as set + return this; + } + + /** + * Set to **true** to enable forwarding network token cryptograms. + * + * @return includeCryptogram Set to **true** to enable forwarding network token cryptograms. + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_CRYPTOGRAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getIncludeCryptogram() { + return includeCryptogram; + } + + /** + * Set to **true** to enable forwarding network token cryptograms. + * + * @param includeCryptogram Set to **true** to enable forwarding network token cryptograms. + */ + @JsonProperty(JSON_PROPERTY_INCLUDE_CRYPTOGRAM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIncludeCryptogram(Boolean includeCryptogram) { + this.includeCryptogram = includeCryptogram; + isSetIncludeCryptogram = true; // mark as set + } + + /** + * Set to **true** to forward the network token for a card. + * + * @param useNetworkToken Set to **true** to forward the network token for a card. + * @return the current {@code CheckoutNetworkTokenOption} instance, allowing for method chaining + */ + public CheckoutNetworkTokenOption useNetworkToken(Boolean useNetworkToken) { + this.useNetworkToken = useNetworkToken; + isSetUseNetworkToken = true; // mark as set + return this; + } + + /** + * Set to **true** to forward the network token for a card. + * + * @return useNetworkToken Set to **true** to forward the network token for a card. + */ + @JsonProperty(JSON_PROPERTY_USE_NETWORK_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getUseNetworkToken() { + return useNetworkToken; + } + + /** + * Set to **true** to forward the network token for a card. + * + * @param useNetworkToken Set to **true** to forward the network token for a card. + */ + @JsonProperty(JSON_PROPERTY_USE_NETWORK_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUseNetworkToken(Boolean useNetworkToken) { + this.useNetworkToken = useNetworkToken; + isSetUseNetworkToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutNetworkTokenOption includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutNetworkTokenOption object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutNetworkTokenOption checkoutNetworkTokenOption = (CheckoutNetworkTokenOption) o; + return Objects.equals(this.includeCryptogram, checkoutNetworkTokenOption.includeCryptogram) + && Objects.equals( + this.isSetIncludeCryptogram, checkoutNetworkTokenOption.isSetIncludeCryptogram) + && Objects.equals(this.useNetworkToken, checkoutNetworkTokenOption.useNetworkToken) + && Objects.equals( + this.isSetUseNetworkToken, checkoutNetworkTokenOption.isSetUseNetworkToken); + } + + @Override + public int hashCode() { + return Objects.hash( + includeCryptogram, isSetIncludeCryptogram, useNetworkToken, isSetUseNetworkToken); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutNetworkTokenOption {\n"); + sb.append(" includeCryptogram: ").append(toIndentedString(includeCryptogram)).append("\n"); + sb.append(" useNetworkToken: ").append(toIndentedString(useNetworkToken)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIncludeCryptogram) { + addIfNull(nulls, JSON_PROPERTY_INCLUDE_CRYPTOGRAM, this.includeCryptogram); + } + if (isSetUseNetworkToken) { + addIfNull(nulls, JSON_PROPERTY_USE_NETWORK_TOKEN, this.useNetworkToken); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutNetworkTokenOption given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutNetworkTokenOption + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutNetworkTokenOption + */ + public static CheckoutNetworkTokenOption fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutNetworkTokenOption.class); + } + + /** + * Convert an instance of CheckoutNetworkTokenOption to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java b/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java index 8d75c9cf3..7f159cd64 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutOrderResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class CheckoutOrderResponse { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_ORDER_DATA = "orderData"; private String orderData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderData = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REMAINING_AMOUNT = "remainingAmount"; private Amount remainingAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemainingAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutOrderResponse() {} /** @@ -55,6 +81,7 @@ public CheckoutOrderResponse() {} */ public CheckoutOrderResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -78,6 +105,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setAmount(Amount amount) { */ public CheckoutOrderResponse expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -111,6 +140,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setExpiresAt(String expiresAt) { */ public CheckoutOrderResponse orderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set return this; } @@ -144,6 +175,7 @@ public String getOrderData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set } /** @@ -154,6 +186,7 @@ public void setOrderData(String orderData) { */ public CheckoutOrderResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -177,6 +210,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setPspReference(String pspReference) { */ public CheckoutOrderResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -210,6 +245,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -220,6 +256,7 @@ public void setReference(String reference) { */ public CheckoutOrderResponse remainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set return this; } @@ -243,6 +280,27 @@ public Amount getRemainingAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutOrderResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutOrderResponse object is equal to o. */ @@ -256,16 +314,34 @@ public boolean equals(Object o) { } CheckoutOrderResponse checkoutOrderResponse = (CheckoutOrderResponse) o; return Objects.equals(this.amount, checkoutOrderResponse.amount) + && Objects.equals(this.isSetAmount, checkoutOrderResponse.isSetAmount) && Objects.equals(this.expiresAt, checkoutOrderResponse.expiresAt) + && Objects.equals(this.isSetExpiresAt, checkoutOrderResponse.isSetExpiresAt) && Objects.equals(this.orderData, checkoutOrderResponse.orderData) + && Objects.equals(this.isSetOrderData, checkoutOrderResponse.isSetOrderData) && Objects.equals(this.pspReference, checkoutOrderResponse.pspReference) + && Objects.equals(this.isSetPspReference, checkoutOrderResponse.isSetPspReference) && Objects.equals(this.reference, checkoutOrderResponse.reference) - && Objects.equals(this.remainingAmount, checkoutOrderResponse.remainingAmount); + && Objects.equals(this.isSetReference, checkoutOrderResponse.isSetReference) + && Objects.equals(this.remainingAmount, checkoutOrderResponse.remainingAmount) + && Objects.equals(this.isSetRemainingAmount, checkoutOrderResponse.isSetRemainingAmount); } @Override public int hashCode() { - return Objects.hash(amount, expiresAt, orderData, pspReference, reference, remainingAmount); + return Objects.hash( + amount, + isSetAmount, + expiresAt, + isSetExpiresAt, + orderData, + isSetOrderData, + pspReference, + isSetPspReference, + reference, + isSetReference, + remainingAmount, + isSetRemainingAmount); } @Override @@ -292,6 +368,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetOrderData) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATA, this.orderData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRemainingAmount) { + addIfNull(nulls, JSON_PROPERTY_REMAINING_AMOUNT, this.remainingAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutOutgoingForwardRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutOutgoingForwardRequest.java new file mode 100644 index 000000000..40b7ee0fd --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutOutgoingForwardRequest.java @@ -0,0 +1,513 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; + +/** CheckoutOutgoingForwardRequest */ +@JsonPropertyOrder({ + CheckoutOutgoingForwardRequest.JSON_PROPERTY_BODY, + CheckoutOutgoingForwardRequest.JSON_PROPERTY_CREDENTIALS, + CheckoutOutgoingForwardRequest.JSON_PROPERTY_HEADERS, + CheckoutOutgoingForwardRequest.JSON_PROPERTY_HTTP_METHOD, + CheckoutOutgoingForwardRequest.JSON_PROPERTY_URL_SUFFIX +}) +public class CheckoutOutgoingForwardRequest { + public static final String JSON_PROPERTY_BODY = "body"; + private String body; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBody = false; + + public static final String JSON_PROPERTY_CREDENTIALS = "credentials"; + private String credentials; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCredentials = false; + + public static final String JSON_PROPERTY_HEADERS = "headers"; + private Map headers; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHeaders = false; + + /** The HTTP method to use for the request Adyen makes on your behalf to the third party. */ + public enum HttpMethodEnum { + POST(String.valueOf("post")), + + PUT(String.valueOf("put")), + + PATCH(String.valueOf("patch")); + + private static final Logger LOG = Logger.getLogger(HttpMethodEnum.class.getName()); + + private String value; + + HttpMethodEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static HttpMethodEnum fromValue(String value) { + for (HttpMethodEnum b : HttpMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "HttpMethodEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(HttpMethodEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_HTTP_METHOD = "httpMethod"; + private HttpMethodEnum httpMethod; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHttpMethod = false; + + public static final String JSON_PROPERTY_URL_SUFFIX = "urlSuffix"; + private String urlSuffix; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrlSuffix = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutOutgoingForwardRequest() {} + + /** + * The request body that you want Adyen to forward to the third party on your behalf, in string + * format. Include key value pairs to specify the payment details, and use + * [placeholders](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders) + * for the values. Adyen replaces the placeholders with the payment details when making the + * request to the third party. When forwarding a network token, include a + * [condition](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#conditional-placeholders) + * that checks if the network token exists, and informs Adyen of which fields to send depending on + * the outcome. + * + * @param body The request body that you want Adyen to forward to the third party on your behalf, + * in string format. Include key value pairs to specify the payment details, and use + * [placeholders](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders) + * for the values. Adyen replaces the placeholders with the payment details when making the + * request to the third party. When forwarding a network token, include a + * [condition](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#conditional-placeholders) + * that checks if the network token exists, and informs Adyen of which fields to send + * depending on the outcome. + * @return the current {@code CheckoutOutgoingForwardRequest} instance, allowing for method + * chaining + */ + public CheckoutOutgoingForwardRequest body(String body) { + this.body = body; + isSetBody = true; // mark as set + return this; + } + + /** + * The request body that you want Adyen to forward to the third party on your behalf, in string + * format. Include key value pairs to specify the payment details, and use + * [placeholders](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders) + * for the values. Adyen replaces the placeholders with the payment details when making the + * request to the third party. When forwarding a network token, include a + * [condition](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#conditional-placeholders) + * that checks if the network token exists, and informs Adyen of which fields to send depending on + * the outcome. + * + * @return body The request body that you want Adyen to forward to the third party on your behalf, + * in string format. Include key value pairs to specify the payment details, and use + * [placeholders](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders) + * for the values. Adyen replaces the placeholders with the payment details when making the + * request to the third party. When forwarding a network token, include a + * [condition](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#conditional-placeholders) + * that checks if the network token exists, and informs Adyen of which fields to send + * depending on the outcome. + */ + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBody() { + return body; + } + + /** + * The request body that you want Adyen to forward to the third party on your behalf, in string + * format. Include key value pairs to specify the payment details, and use + * [placeholders](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders) + * for the values. Adyen replaces the placeholders with the payment details when making the + * request to the third party. When forwarding a network token, include a + * [condition](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#conditional-placeholders) + * that checks if the network token exists, and informs Adyen of which fields to send depending on + * the outcome. + * + * @param body The request body that you want Adyen to forward to the third party on your behalf, + * in string format. Include key value pairs to specify the payment details, and use + * [placeholders](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders) + * for the values. Adyen replaces the placeholders with the payment details when making the + * request to the third party. When forwarding a network token, include a + * [condition](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#conditional-placeholders) + * that checks if the network token exists, and informs Adyen of which fields to send + * depending on the outcome. + */ + @JsonProperty(JSON_PROPERTY_BODY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBody(String body) { + this.body = body; + isSetBody = true; // mark as set + } + + /** + * Your credentials that are needed to authenticate with the third party. + * + * @param credentials Your credentials that are needed to authenticate with the third party. + * @return the current {@code CheckoutOutgoingForwardRequest} instance, allowing for method + * chaining + */ + public CheckoutOutgoingForwardRequest credentials(String credentials) { + this.credentials = credentials; + isSetCredentials = true; // mark as set + return this; + } + + /** + * Your credentials that are needed to authenticate with the third party. + * + * @return credentials Your credentials that are needed to authenticate with the third party. + */ + @JsonProperty(JSON_PROPERTY_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCredentials() { + return credentials; + } + + /** + * Your credentials that are needed to authenticate with the third party. + * + * @param credentials Your credentials that are needed to authenticate with the third party. + */ + @JsonProperty(JSON_PROPERTY_CREDENTIALS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCredentials(String credentials) { + this.credentials = credentials; + isSetCredentials = true; // mark as set + } + + /** + * The request headers that will be included in the request Adyen makes to the third party on your + * behalf. Supports the `{{credentials}}` + * [placeholder](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders). + * + * @param headers The request headers that will be included in the request Adyen makes to the + * third party on your behalf. Supports the `{{credentials}}` + * [placeholder](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders). + * @return the current {@code CheckoutOutgoingForwardRequest} instance, allowing for method + * chaining + */ + public CheckoutOutgoingForwardRequest headers(Map headers) { + this.headers = headers; + isSetHeaders = true; // mark as set + return this; + } + + public CheckoutOutgoingForwardRequest putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The request headers that will be included in the request Adyen makes to the third party on your + * behalf. Supports the `{{credentials}}` + * [placeholder](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders). + * + * @return headers The request headers that will be included in the request Adyen makes to the + * third party on your behalf. Supports the `{{credentials}}` + * [placeholder](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders). + */ + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getHeaders() { + return headers; + } + + /** + * The request headers that will be included in the request Adyen makes to the third party on your + * behalf. Supports the `{{credentials}}` + * [placeholder](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders). + * + * @param headers The request headers that will be included in the request Adyen makes to the + * third party on your behalf. Supports the `{{credentials}}` + * [placeholder](https://docs.adyen.com/online-payments/tokenization/forward-payment-details#placeholders). + */ + @JsonProperty(JSON_PROPERTY_HEADERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHeaders(Map headers) { + this.headers = headers; + isSetHeaders = true; // mark as set + } + + /** + * The HTTP method to use for the request Adyen makes on your behalf to the third party. + * + * @param httpMethod The HTTP method to use for the request Adyen makes on your behalf to the + * third party. + * @return the current {@code CheckoutOutgoingForwardRequest} instance, allowing for method + * chaining + */ + public CheckoutOutgoingForwardRequest httpMethod(HttpMethodEnum httpMethod) { + this.httpMethod = httpMethod; + isSetHttpMethod = true; // mark as set + return this; + } + + /** + * The HTTP method to use for the request Adyen makes on your behalf to the third party. + * + * @return httpMethod The HTTP method to use for the request Adyen makes on your behalf to the + * third party. + */ + @JsonProperty(JSON_PROPERTY_HTTP_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public HttpMethodEnum getHttpMethod() { + return httpMethod; + } + + /** + * The HTTP method to use for the request Adyen makes on your behalf to the third party. + * + * @param httpMethod The HTTP method to use for the request Adyen makes on your behalf to the + * third party. + */ + @JsonProperty(JSON_PROPERTY_HTTP_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHttpMethod(HttpMethodEnum httpMethod) { + this.httpMethod = httpMethod; + isSetHttpMethod = true; // mark as set + } + + /** + * The suffix that Adyen needs to append to the `baseUrl` to construct the destination + * URL that belongs to the third party. This is usually the endpoint name for the request, for + * example, **_/payments**. + * + * @param urlSuffix The suffix that Adyen needs to append to the `baseUrl` to construct + * the destination URL that belongs to the third party. This is usually the endpoint name for + * the request, for example, **_/payments**. + * @return the current {@code CheckoutOutgoingForwardRequest} instance, allowing for method + * chaining + */ + public CheckoutOutgoingForwardRequest urlSuffix(String urlSuffix) { + this.urlSuffix = urlSuffix; + isSetUrlSuffix = true; // mark as set + return this; + } + + /** + * The suffix that Adyen needs to append to the `baseUrl` to construct the destination + * URL that belongs to the third party. This is usually the endpoint name for the request, for + * example, **_/payments**. + * + * @return urlSuffix The suffix that Adyen needs to append to the `baseUrl` to construct + * the destination URL that belongs to the third party. This is usually the endpoint name for + * the request, for example, **_/payments**. + */ + @JsonProperty(JSON_PROPERTY_URL_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUrlSuffix() { + return urlSuffix; + } + + /** + * The suffix that Adyen needs to append to the `baseUrl` to construct the destination + * URL that belongs to the third party. This is usually the endpoint name for the request, for + * example, **_/payments**. + * + * @param urlSuffix The suffix that Adyen needs to append to the `baseUrl` to construct + * the destination URL that belongs to the third party. This is usually the endpoint name for + * the request, for example, **_/payments**. + */ + @JsonProperty(JSON_PROPERTY_URL_SUFFIX) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUrlSuffix(String urlSuffix) { + this.urlSuffix = urlSuffix; + isSetUrlSuffix = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutOutgoingForwardRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutOutgoingForwardRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutOutgoingForwardRequest checkoutOutgoingForwardRequest = + (CheckoutOutgoingForwardRequest) o; + return Objects.equals(this.body, checkoutOutgoingForwardRequest.body) + && Objects.equals(this.isSetBody, checkoutOutgoingForwardRequest.isSetBody) + && Objects.equals(this.credentials, checkoutOutgoingForwardRequest.credentials) + && Objects.equals(this.isSetCredentials, checkoutOutgoingForwardRequest.isSetCredentials) + && Objects.equals(this.headers, checkoutOutgoingForwardRequest.headers) + && Objects.equals(this.isSetHeaders, checkoutOutgoingForwardRequest.isSetHeaders) + && Objects.equals(this.httpMethod, checkoutOutgoingForwardRequest.httpMethod) + && Objects.equals(this.isSetHttpMethod, checkoutOutgoingForwardRequest.isSetHttpMethod) + && Objects.equals(this.urlSuffix, checkoutOutgoingForwardRequest.urlSuffix) + && Objects.equals(this.isSetUrlSuffix, checkoutOutgoingForwardRequest.isSetUrlSuffix); + } + + @Override + public int hashCode() { + return Objects.hash( + body, + isSetBody, + credentials, + isSetCredentials, + headers, + isSetHeaders, + httpMethod, + isSetHttpMethod, + urlSuffix, + isSetUrlSuffix); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutOutgoingForwardRequest {\n"); + sb.append(" body: ").append(toIndentedString(body)).append("\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" httpMethod: ").append(toIndentedString(httpMethod)).append("\n"); + sb.append(" urlSuffix: ").append(toIndentedString(urlSuffix)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBody) { + addIfNull(nulls, JSON_PROPERTY_BODY, this.body); + } + if (isSetCredentials) { + addIfNull(nulls, JSON_PROPERTY_CREDENTIALS, this.credentials); + } + if (isSetHeaders) { + addIfNull(nulls, JSON_PROPERTY_HEADERS, this.headers); + } + if (isSetHttpMethod) { + addIfNull(nulls, JSON_PROPERTY_HTTP_METHOD, this.httpMethod); + } + if (isSetUrlSuffix) { + addIfNull(nulls, JSON_PROPERTY_URL_SUFFIX, this.urlSuffix); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutOutgoingForwardRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutOutgoingForwardRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutOutgoingForwardRequest + */ + public static CheckoutOutgoingForwardRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutOutgoingForwardRequest.class); + } + + /** + * Convert an instance of CheckoutOutgoingForwardRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java index 6baa8adcc..02b5fd816 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java @@ -541,6 +541,32 @@ public CheckoutPaymentMethod deserialize(JsonParser jp, DeserializationContext c log.log(Level.FINER, "Input data does not match schema 'EftDetails'", e); } + // deserialize ExternalTokenDetails + try { + boolean attemptParsing = true; + if (attemptParsing) { + // Checks if the unique type of the oneOf json matches any of the object TypeEnum values + boolean typeMatch = false; + if (tree.findValue("type") != null) { + typeMatch = + Arrays.stream(ExternalTokenDetails.TypeEnum.values()) + .anyMatch((t) -> t.getValue().equals(tree.findValue("type").asText())); + } + + if (typeMatch) { + deserialized = tree.traverse(jp.getCodec()).readValueAs(ExternalTokenDetails.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + match++; + log.log(Level.FINER, "Input data matches schema 'ExternalTokenDetails'"); + } + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'ExternalTokenDetails'", e); + } + // deserialize FastlaneDetails try { boolean attemptParsing = true; @@ -1573,6 +1599,11 @@ public CheckoutPaymentMethod(EftDetails o) { setActualInstance(o); } + public CheckoutPaymentMethod(ExternalTokenDetails o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public CheckoutPaymentMethod(FastlaneDetails o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -1767,6 +1798,7 @@ public CheckoutPaymentMethod(ZipDetails o) { schemas.put("EBankingFinlandDetails", new GenericType() {}); schemas.put("EcontextVoucherDetails", new GenericType() {}); schemas.put("EftDetails", new GenericType() {}); + schemas.put("ExternalTokenDetails", new GenericType() {}); schemas.put("FastlaneDetails", new GenericType() {}); schemas.put( "GenericIssuerPaymentMethodDetails", @@ -1818,14 +1850,15 @@ public Map> getSchemas() { * against the oneOf child schemas: AchDetails, AffirmDetails, AfterpayDetails, AmazonPayDetails, * AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, * BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DragonpayDetails, - * EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, FastlaneDetails, - * GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, - * MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, - * PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, - * PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, - * RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, - * StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, - * VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails + * EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, + * FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, + * KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, + * OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, + * PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, + * PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, + * SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, + * UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, + * WeChatPayMiniProgramDetails, ZipDetails * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -1922,6 +1955,11 @@ public void setActualInstance(Object instance) { return; } + if (JSON.isInstanceOf(ExternalTokenDetails.class, instance, new HashSet<>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(FastlaneDetails.class, instance, new HashSet<>())) { super.setActualInstance(instance); return; @@ -2098,7 +2136,7 @@ public void setActualInstance(Object instance) { } throw new RuntimeException( - "Invalid instance type. Must be AchDetails, AffirmDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); + "Invalid instance type. Must be AchDetails, AffirmDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails"); } /** @@ -2106,27 +2144,27 @@ public void setActualInstance(Object instance) { * AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, * BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, * CellulantDetails, DokuDetails, DragonpayDetails, EBankingFinlandDetails, - * EcontextVoucherDetails, EftDetails, FastlaneDetails, GenericIssuerPaymentMethodDetails, - * GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, - * MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, - * PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, PayUUpiDetails, - * PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, RakutenPayDetails, - * RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, + * EcontextVoucherDetails, EftDetails, ExternalTokenDetails, FastlaneDetails, + * GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, + * MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, + * PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, PayToDetails, + * PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, + * RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, * StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, UpiQrDetails, * VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails * * @return The actual instance (AchDetails, AffirmDetails, AfterpayDetails, AmazonPayDetails, * AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, * BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DragonpayDetails, - * EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, FastlaneDetails, - * GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, KlarnaDetails, - * MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, - * PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayPayDetails, - * PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PixDetails, PseDetails, - * RakutenPayDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, - * SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, - * UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, - * WeChatPayMiniProgramDetails, ZipDetails) + * EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, ExternalTokenDetails, + * FastlaneDetails, GenericIssuerPaymentMethodDetails, GooglePayDetails, IdealDetails, + * KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, + * OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, + * PayPayDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, + * PixDetails, PseDetails, RakutenPayDetails, RatepayDetails, RivertyDetails, + * SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, + * UpiCollectDetails, UpiIntentDetails, UpiQrDetails, VippsDetails, VisaCheckoutDetails, + * WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails) */ @Override public Object getActualInstance() { @@ -2331,6 +2369,17 @@ public EftDetails getEftDetails() throws ClassCastException { return (EftDetails) super.getActualInstance(); } + /** + * Get the actual instance of `ExternalTokenDetails`. If the actual instance is not + * `ExternalTokenDetails`, the ClassCastException will be thrown. + * + * @return The actual instance of `ExternalTokenDetails` + * @throws ClassCastException if the instance is not `ExternalTokenDetails` + */ + public ExternalTokenDetails getExternalTokenDetails() throws ClassCastException { + return (ExternalTokenDetails) super.getActualInstance(); + } + /** * Get the actual instance of `FastlaneDetails`. If the actual instance is not `FastlaneDetails`, * the ClassCastException will be thrown. diff --git a/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java b/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java index fe798f762..4151c2020 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutQrCodeAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,15 +36,27 @@ public class CheckoutQrCodeAction { public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_QR_CODE_DATA = "qrCodeData"; private String qrCodeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetQrCodeData = false; + /** **qrCode** */ public enum TypeEnum { QRCODE(String.valueOf("qrCode")); @@ -85,9 +99,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutQrCodeAction() {} /** @@ -98,6 +124,7 @@ public CheckoutQrCodeAction() {} */ public CheckoutQrCodeAction expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -121,6 +148,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -131,6 +159,7 @@ public void setExpiresAt(String expiresAt) { */ public CheckoutQrCodeAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -154,6 +183,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -164,6 +194,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutQrCodeAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -187,6 +218,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -197,6 +229,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutQrCodeAction qrCodeData(String qrCodeData) { this.qrCodeData = qrCodeData; + isSetQrCodeData = true; // mark as set return this; } @@ -220,6 +253,7 @@ public String getQrCodeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setQrCodeData(String qrCodeData) { this.qrCodeData = qrCodeData; + isSetQrCodeData = true; // mark as set } /** @@ -230,6 +264,7 @@ public void setQrCodeData(String qrCodeData) { */ public CheckoutQrCodeAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -253,6 +288,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -263,6 +299,7 @@ public void setType(TypeEnum type) { */ public CheckoutQrCodeAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -286,6 +323,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutQrCodeAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutQrCodeAction object is equal to o. */ @@ -299,16 +357,34 @@ public boolean equals(Object o) { } CheckoutQrCodeAction checkoutQrCodeAction = (CheckoutQrCodeAction) o; return Objects.equals(this.expiresAt, checkoutQrCodeAction.expiresAt) + && Objects.equals(this.isSetExpiresAt, checkoutQrCodeAction.isSetExpiresAt) && Objects.equals(this.paymentData, checkoutQrCodeAction.paymentData) + && Objects.equals(this.isSetPaymentData, checkoutQrCodeAction.isSetPaymentData) && Objects.equals(this.paymentMethodType, checkoutQrCodeAction.paymentMethodType) + && Objects.equals(this.isSetPaymentMethodType, checkoutQrCodeAction.isSetPaymentMethodType) && Objects.equals(this.qrCodeData, checkoutQrCodeAction.qrCodeData) + && Objects.equals(this.isSetQrCodeData, checkoutQrCodeAction.isSetQrCodeData) && Objects.equals(this.type, checkoutQrCodeAction.type) - && Objects.equals(this.url, checkoutQrCodeAction.url); + && Objects.equals(this.isSetType, checkoutQrCodeAction.isSetType) + && Objects.equals(this.url, checkoutQrCodeAction.url) + && Objects.equals(this.isSetUrl, checkoutQrCodeAction.isSetUrl); } @Override public int hashCode() { - return Objects.hash(expiresAt, paymentData, paymentMethodType, qrCodeData, type, url); + return Objects.hash( + expiresAt, + isSetExpiresAt, + paymentData, + isSetPaymentData, + paymentMethodType, + isSetPaymentMethodType, + qrCodeData, + isSetQrCodeData, + type, + isSetType, + url, + isSetUrl); } @Override @@ -335,6 +411,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetQrCodeData) { + addIfNull(nulls, JSON_PROPERTY_QR_CODE_DATA, this.qrCodeData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutQrCodeAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java b/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java index 20acd4339..f2e17e059 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutRedirectAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,12 +37,21 @@ public class CheckoutRedirectAction { public static final String JSON_PROPERTY_DATA = "data"; private Map data; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetData = false; + public static final String JSON_PROPERTY_METHOD = "method"; private String method; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMethod = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + /** **redirect** */ public enum TypeEnum { REDIRECT(String.valueOf("redirect")); @@ -83,9 +94,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutRedirectAction() {} /** @@ -97,6 +120,7 @@ public CheckoutRedirectAction() {} */ public CheckoutRedirectAction data(Map data) { this.data = data; + isSetData = true; // mark as set return this; } @@ -130,6 +154,7 @@ public Map getData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setData(Map data) { this.data = data; + isSetData = true; // mark as set } /** @@ -140,6 +165,7 @@ public void setData(Map data) { */ public CheckoutRedirectAction method(String method) { this.method = method; + isSetMethod = true; // mark as set return this; } @@ -163,6 +189,7 @@ public String getMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMethod(String method) { this.method = method; + isSetMethod = true; // mark as set } /** @@ -173,6 +200,7 @@ public void setMethod(String method) { */ public CheckoutRedirectAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -196,6 +224,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -206,6 +235,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutRedirectAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -229,6 +259,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -239,6 +270,7 @@ public void setType(TypeEnum type) { */ public CheckoutRedirectAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -262,6 +294,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutRedirectAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutRedirectAction object is equal to o. */ @@ -275,15 +328,31 @@ public boolean equals(Object o) { } CheckoutRedirectAction checkoutRedirectAction = (CheckoutRedirectAction) o; return Objects.equals(this.data, checkoutRedirectAction.data) + && Objects.equals(this.isSetData, checkoutRedirectAction.isSetData) && Objects.equals(this.method, checkoutRedirectAction.method) + && Objects.equals(this.isSetMethod, checkoutRedirectAction.isSetMethod) && Objects.equals(this.paymentMethodType, checkoutRedirectAction.paymentMethodType) + && Objects.equals( + this.isSetPaymentMethodType, checkoutRedirectAction.isSetPaymentMethodType) && Objects.equals(this.type, checkoutRedirectAction.type) - && Objects.equals(this.url, checkoutRedirectAction.url); + && Objects.equals(this.isSetType, checkoutRedirectAction.isSetType) + && Objects.equals(this.url, checkoutRedirectAction.url) + && Objects.equals(this.isSetUrl, checkoutRedirectAction.isSetUrl); } @Override public int hashCode() { - return Objects.hash(data, method, paymentMethodType, type, url); + return Objects.hash( + data, + isSetData, + method, + isSetMethod, + paymentMethodType, + isSetPaymentMethodType, + type, + isSetType, + url, + isSetUrl); } @Override @@ -309,6 +378,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetData) { + addIfNull(nulls, JSON_PROPERTY_DATA, this.data); + } + if (isSetMethod) { + addIfNull(nulls, JSON_PROPERTY_METHOD, this.method); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutRedirectAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java b/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java index 77dd438e3..574b85a59 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSDKAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,12 +37,21 @@ public class CheckoutSDKAction { public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private Map sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** The type of the action. */ public enum TypeEnum { SDK(String.valueOf("sdk")), @@ -85,9 +96,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutSDKAction() {} /** @@ -98,6 +121,7 @@ public CheckoutSDKAction() {} */ public CheckoutSDKAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -121,6 +145,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -131,6 +156,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutSDKAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -154,6 +180,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -164,6 +191,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutSDKAction sdkData(Map sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -195,6 +223,7 @@ public Map getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(Map sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -205,6 +234,7 @@ public void setSdkData(Map sdkData) { */ public CheckoutSDKAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -228,6 +258,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -238,6 +269,7 @@ public void setType(TypeEnum type) { */ public CheckoutSDKAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -261,6 +293,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutSDKAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutSDKAction object is equal to o. */ @@ -274,15 +327,30 @@ public boolean equals(Object o) { } CheckoutSDKAction checkoutSDKAction = (CheckoutSDKAction) o; return Objects.equals(this.paymentData, checkoutSDKAction.paymentData) + && Objects.equals(this.isSetPaymentData, checkoutSDKAction.isSetPaymentData) && Objects.equals(this.paymentMethodType, checkoutSDKAction.paymentMethodType) + && Objects.equals(this.isSetPaymentMethodType, checkoutSDKAction.isSetPaymentMethodType) && Objects.equals(this.sdkData, checkoutSDKAction.sdkData) + && Objects.equals(this.isSetSdkData, checkoutSDKAction.isSetSdkData) && Objects.equals(this.type, checkoutSDKAction.type) - && Objects.equals(this.url, checkoutSDKAction.url); + && Objects.equals(this.isSetType, checkoutSDKAction.isSetType) + && Objects.equals(this.url, checkoutSDKAction.url) + && Objects.equals(this.isSetUrl, checkoutSDKAction.isSetUrl); } @Override public int hashCode() { - return Objects.hash(paymentData, paymentMethodType, sdkData, type, url); + return Objects.hash( + paymentData, + isSetPaymentData, + paymentMethodType, + isSetPaymentMethodType, + sdkData, + isSetSdkData, + type, + isSetType, + url, + isSetUrl); } @Override @@ -308,6 +376,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutSDKAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java index 7dba3c069..7959f2361 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSessionInstallmentOption.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -90,12 +92,27 @@ public static PlansEnum fromValue(String value) { public static final String JSON_PROPERTY_PLANS = "plans"; private List plans; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlans = false; + public static final String JSON_PROPERTY_PRESELECTED_VALUE = "preselectedValue"; private Integer preselectedValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreselectedValue = false; + public static final String JSON_PROPERTY_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutSessionInstallmentOption() {} /** @@ -113,6 +130,7 @@ public CheckoutSessionInstallmentOption() {} */ public CheckoutSessionInstallmentOption plans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set return this; } @@ -156,6 +174,7 @@ public List getPlans() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set } /** @@ -167,6 +186,7 @@ public void setPlans(List plans) { */ public CheckoutSessionInstallmentOption preselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set return this; } @@ -190,6 +210,7 @@ public Integer getPreselectedValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set } /** @@ -203,6 +224,7 @@ public void setPreselectedValue(Integer preselectedValue) { */ public CheckoutSessionInstallmentOption values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -238,6 +260,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutSessionInstallmentOption includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutSessionInstallmentOption object is equal to o. */ @@ -252,13 +295,18 @@ public boolean equals(Object o) { CheckoutSessionInstallmentOption checkoutSessionInstallmentOption = (CheckoutSessionInstallmentOption) o; return Objects.equals(this.plans, checkoutSessionInstallmentOption.plans) + && Objects.equals(this.isSetPlans, checkoutSessionInstallmentOption.isSetPlans) && Objects.equals(this.preselectedValue, checkoutSessionInstallmentOption.preselectedValue) - && Objects.equals(this.values, checkoutSessionInstallmentOption.values); + && Objects.equals( + this.isSetPreselectedValue, checkoutSessionInstallmentOption.isSetPreselectedValue) + && Objects.equals(this.values, checkoutSessionInstallmentOption.values) + && Objects.equals(this.isSetValues, checkoutSessionInstallmentOption.isSetValues); } @Override public int hashCode() { - return Objects.hash(plans, preselectedValue, values); + return Objects.hash( + plans, isSetPlans, preselectedValue, isSetPreselectedValue, values, isSetValues); } @Override @@ -282,6 +330,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPlans) { + addIfNull(nulls, JSON_PROPERTY_PLANS, this.plans); + } + if (isSetPreselectedValue) { + addIfNull(nulls, JSON_PROPERTY_PRESELECTED_VALUE, this.preselectedValue); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutSessionInstallmentOption given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java b/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java index f8bf8c289..24b344f9f 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutSessionThreeDS2RequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,9 +34,15 @@ public class CheckoutSessionThreeDS2RequestData { public static final String JSON_PROPERTY_HOME_PHONE = "homePhone"; private Phone homePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomePhone = false; + public static final String JSON_PROPERTY_MOBILE_PHONE = "mobilePhone"; private Phone mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -94,9 +102,21 @@ public static ThreeDSRequestorChallengeIndEnum fromValue(String value) { "threeDSRequestorChallengeInd"; private ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorChallengeInd = false; + public static final String JSON_PROPERTY_WORK_PHONE = "workPhone"; private Phone workPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWorkPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutSessionThreeDS2RequestData() {} /** @@ -108,6 +128,7 @@ public CheckoutSessionThreeDS2RequestData() {} */ public CheckoutSessionThreeDS2RequestData homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -131,6 +152,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -142,6 +164,7 @@ public void setHomePhone(Phone homePhone) { */ public CheckoutSessionThreeDS2RequestData mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -165,6 +188,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -184,6 +208,7 @@ public void setMobilePhone(Phone mobilePhone) { public CheckoutSessionThreeDS2RequestData threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -222,6 +247,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -233,6 +259,7 @@ public void setThreeDSRequestorChallengeInd( */ public CheckoutSessionThreeDS2RequestData workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -256,6 +283,27 @@ public Phone getWorkPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWorkPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutSessionThreeDS2RequestData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutSessionThreeDS2RequestData object is equal to o. */ @@ -270,16 +318,31 @@ public boolean equals(Object o) { CheckoutSessionThreeDS2RequestData checkoutSessionThreeDS2RequestData = (CheckoutSessionThreeDS2RequestData) o; return Objects.equals(this.homePhone, checkoutSessionThreeDS2RequestData.homePhone) + && Objects.equals(this.isSetHomePhone, checkoutSessionThreeDS2RequestData.isSetHomePhone) && Objects.equals(this.mobilePhone, checkoutSessionThreeDS2RequestData.mobilePhone) + && Objects.equals( + this.isSetMobilePhone, checkoutSessionThreeDS2RequestData.isSetMobilePhone) && Objects.equals( this.threeDSRequestorChallengeInd, checkoutSessionThreeDS2RequestData.threeDSRequestorChallengeInd) - && Objects.equals(this.workPhone, checkoutSessionThreeDS2RequestData.workPhone); + && Objects.equals( + this.isSetThreeDSRequestorChallengeInd, + checkoutSessionThreeDS2RequestData.isSetThreeDSRequestorChallengeInd) + && Objects.equals(this.workPhone, checkoutSessionThreeDS2RequestData.workPhone) + && Objects.equals(this.isSetWorkPhone, checkoutSessionThreeDS2RequestData.isSetWorkPhone); } @Override public int hashCode() { - return Objects.hash(homePhone, mobilePhone, threeDSRequestorChallengeInd, workPhone); + return Objects.hash( + homePhone, + isSetHomePhone, + mobilePhone, + isSetMobilePhone, + threeDSRequestorChallengeInd, + isSetThreeDSRequestorChallengeInd, + workPhone, + isSetWorkPhone); } @Override @@ -306,6 +369,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + if (isSetWorkPhone) { + addIfNull(nulls, JSON_PROPERTY_WORK_PHONE, this.workPhone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutSessionThreeDS2RequestData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java b/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java index 088f45254..65eefa92b 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutThreeDS2Action.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,18 +37,33 @@ public class CheckoutThreeDS2Action { public static final String JSON_PROPERTY_AUTHORISATION_TOKEN = "authorisationToken"; private String authorisationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationToken = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + public static final String JSON_PROPERTY_TOKEN = "token"; private String token; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetToken = false; + /** **threeDS2** */ public enum TypeEnum { THREEDS2(String.valueOf("threeDS2")); @@ -89,9 +106,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutThreeDS2Action() {} /** @@ -102,6 +131,7 @@ public CheckoutThreeDS2Action() {} */ public CheckoutThreeDS2Action authorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set return this; } @@ -125,6 +155,7 @@ public String getAuthorisationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationToken(String authorisationToken) { this.authorisationToken = authorisationToken; + isSetAuthorisationToken = true; // mark as set } /** @@ -135,6 +166,7 @@ public void setAuthorisationToken(String authorisationToken) { */ public CheckoutThreeDS2Action paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -158,6 +190,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -168,6 +201,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutThreeDS2Action paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -191,6 +225,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -201,6 +236,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutThreeDS2Action subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -224,6 +260,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -234,6 +271,7 @@ public void setSubtype(String subtype) { */ public CheckoutThreeDS2Action token(String token) { this.token = token; + isSetToken = true; // mark as set return this; } @@ -257,6 +295,7 @@ public String getToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setToken(String token) { this.token = token; + isSetToken = true; // mark as set } /** @@ -267,6 +306,7 @@ public void setToken(String token) { */ public CheckoutThreeDS2Action type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -290,6 +330,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -300,6 +341,7 @@ public void setType(TypeEnum type) { */ public CheckoutThreeDS2Action url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -323,6 +365,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutThreeDS2Action includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutThreeDS2Action object is equal to o. */ @@ -336,18 +399,40 @@ public boolean equals(Object o) { } CheckoutThreeDS2Action checkoutThreeDS2Action = (CheckoutThreeDS2Action) o; return Objects.equals(this.authorisationToken, checkoutThreeDS2Action.authorisationToken) + && Objects.equals( + this.isSetAuthorisationToken, checkoutThreeDS2Action.isSetAuthorisationToken) && Objects.equals(this.paymentData, checkoutThreeDS2Action.paymentData) + && Objects.equals(this.isSetPaymentData, checkoutThreeDS2Action.isSetPaymentData) && Objects.equals(this.paymentMethodType, checkoutThreeDS2Action.paymentMethodType) + && Objects.equals( + this.isSetPaymentMethodType, checkoutThreeDS2Action.isSetPaymentMethodType) && Objects.equals(this.subtype, checkoutThreeDS2Action.subtype) + && Objects.equals(this.isSetSubtype, checkoutThreeDS2Action.isSetSubtype) && Objects.equals(this.token, checkoutThreeDS2Action.token) + && Objects.equals(this.isSetToken, checkoutThreeDS2Action.isSetToken) && Objects.equals(this.type, checkoutThreeDS2Action.type) - && Objects.equals(this.url, checkoutThreeDS2Action.url); + && Objects.equals(this.isSetType, checkoutThreeDS2Action.isSetType) + && Objects.equals(this.url, checkoutThreeDS2Action.url) + && Objects.equals(this.isSetUrl, checkoutThreeDS2Action.isSetUrl); } @Override public int hashCode() { return Objects.hash( - authorisationToken, paymentData, paymentMethodType, subtype, token, type, url); + authorisationToken, + isSetAuthorisationToken, + paymentData, + isSetPaymentData, + paymentMethodType, + isSetPaymentMethodType, + subtype, + isSetSubtype, + token, + isSetToken, + type, + isSetType, + url, + isSetUrl); } @Override @@ -375,6 +460,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthorisationToken) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_TOKEN, this.authorisationToken); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetToken) { + addIfNull(nulls, JSON_PROPERTY_TOKEN, this.token); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutThreeDS2Action given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java b/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java index 8dc61f06c..b43b1404f 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutVoucherAction.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -49,61 +51,118 @@ public class CheckoutVoucherAction { public static final String JSON_PROPERTY_ALTERNATIVE_REFERENCE = "alternativeReference"; private String alternativeReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAlternativeReference = false; + public static final String JSON_PROPERTY_COLLECTION_INSTITUTION_NUMBER = "collectionInstitutionNumber"; private String collectionInstitutionNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCollectionInstitutionNumber = false; + public static final String JSON_PROPERTY_DOWNLOAD_URL = "downloadUrl"; private String downloadUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDownloadUrl = false; + public static final String JSON_PROPERTY_ENTITY = "entity"; private String entity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntity = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_INITIAL_AMOUNT = "initialAmount"; private Amount initialAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInitialAmount = false; + public static final String JSON_PROPERTY_INSTRUCTIONS_URL = "instructionsUrl"; private String instructionsUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstructionsUrl = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_MASKED_TELEPHONE_NUMBER = "maskedTelephoneNumber"; private String maskedTelephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskedTelephoneNumber = false; + public static final String JSON_PROPERTY_MERCHANT_NAME = "merchantName"; private String merchantName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantName = false; + public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_PASS_CREATION_TOKEN = "passCreationToken"; private String passCreationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPassCreationToken = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_TYPE = "paymentMethodType"; private String paymentMethodType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodType = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private String shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SURCHARGE = "surcharge"; private Amount surcharge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSurcharge = false; + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; private Amount totalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + /** **voucher** */ public enum TypeEnum { VOUCHER(String.valueOf("voucher")); @@ -146,9 +205,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CheckoutVoucherAction() {} /** @@ -159,6 +230,7 @@ public CheckoutVoucherAction() {} */ public CheckoutVoucherAction alternativeReference(String alternativeReference) { this.alternativeReference = alternativeReference; + isSetAlternativeReference = true; // mark as set return this; } @@ -182,6 +254,7 @@ public String getAlternativeReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAlternativeReference(String alternativeReference) { this.alternativeReference = alternativeReference; + isSetAlternativeReference = true; // mark as set } /** @@ -193,6 +266,7 @@ public void setAlternativeReference(String alternativeReference) { */ public CheckoutVoucherAction collectionInstitutionNumber(String collectionInstitutionNumber) { this.collectionInstitutionNumber = collectionInstitutionNumber; + isSetCollectionInstitutionNumber = true; // mark as set return this; } @@ -218,6 +292,7 @@ public String getCollectionInstitutionNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCollectionInstitutionNumber(String collectionInstitutionNumber) { this.collectionInstitutionNumber = collectionInstitutionNumber; + isSetCollectionInstitutionNumber = true; // mark as set } /** @@ -228,6 +303,7 @@ public void setCollectionInstitutionNumber(String collectionInstitutionNumber) { */ public CheckoutVoucherAction downloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set return this; } @@ -251,6 +327,7 @@ public String getDownloadUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDownloadUrl(String downloadUrl) { this.downloadUrl = downloadUrl; + isSetDownloadUrl = true; // mark as set } /** @@ -261,6 +338,7 @@ public void setDownloadUrl(String downloadUrl) { */ public CheckoutVoucherAction entity(String entity) { this.entity = entity; + isSetEntity = true; // mark as set return this; } @@ -284,6 +362,7 @@ public String getEntity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntity(String entity) { this.entity = entity; + isSetEntity = true; // mark as set } /** @@ -294,6 +373,7 @@ public void setEntity(String entity) { */ public CheckoutVoucherAction expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -317,6 +397,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -327,6 +408,7 @@ public void setExpiresAt(String expiresAt) { */ public CheckoutVoucherAction initialAmount(Amount initialAmount) { this.initialAmount = initialAmount; + isSetInitialAmount = true; // mark as set return this; } @@ -350,6 +432,7 @@ public Amount getInitialAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInitialAmount(Amount initialAmount) { this.initialAmount = initialAmount; + isSetInitialAmount = true; // mark as set } /** @@ -360,6 +443,7 @@ public void setInitialAmount(Amount initialAmount) { */ public CheckoutVoucherAction instructionsUrl(String instructionsUrl) { this.instructionsUrl = instructionsUrl; + isSetInstructionsUrl = true; // mark as set return this; } @@ -383,6 +467,7 @@ public String getInstructionsUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstructionsUrl(String instructionsUrl) { this.instructionsUrl = instructionsUrl; + isSetInstructionsUrl = true; // mark as set } /** @@ -393,6 +478,7 @@ public void setInstructionsUrl(String instructionsUrl) { */ public CheckoutVoucherAction issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -416,6 +502,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -426,6 +513,7 @@ public void setIssuer(String issuer) { */ public CheckoutVoucherAction maskedTelephoneNumber(String maskedTelephoneNumber) { this.maskedTelephoneNumber = maskedTelephoneNumber; + isSetMaskedTelephoneNumber = true; // mark as set return this; } @@ -449,6 +537,7 @@ public String getMaskedTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaskedTelephoneNumber(String maskedTelephoneNumber) { this.maskedTelephoneNumber = maskedTelephoneNumber; + isSetMaskedTelephoneNumber = true; // mark as set } /** @@ -459,6 +548,7 @@ public void setMaskedTelephoneNumber(String maskedTelephoneNumber) { */ public CheckoutVoucherAction merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -482,6 +572,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -492,6 +583,7 @@ public void setMerchantName(String merchantName) { */ public CheckoutVoucherAction merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -515,6 +607,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -527,6 +620,7 @@ public void setMerchantReference(String merchantReference) { */ public CheckoutVoucherAction passCreationToken(String passCreationToken) { this.passCreationToken = passCreationToken; + isSetPassCreationToken = true; // mark as set return this; } @@ -554,6 +648,7 @@ public String getPassCreationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPassCreationToken(String passCreationToken) { this.passCreationToken = passCreationToken; + isSetPassCreationToken = true; // mark as set } /** @@ -564,6 +659,7 @@ public void setPassCreationToken(String passCreationToken) { */ public CheckoutVoucherAction paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -587,6 +683,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -597,6 +694,7 @@ public void setPaymentData(String paymentData) { */ public CheckoutVoucherAction paymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set return this; } @@ -620,6 +718,7 @@ public String getPaymentMethodType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodType(String paymentMethodType) { this.paymentMethodType = paymentMethodType; + isSetPaymentMethodType = true; // mark as set } /** @@ -630,6 +729,7 @@ public void setPaymentMethodType(String paymentMethodType) { */ public CheckoutVoucherAction reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -653,6 +753,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -663,6 +764,7 @@ public void setReference(String reference) { */ public CheckoutVoucherAction shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -686,6 +788,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -696,6 +799,7 @@ public void setShopperEmail(String shopperEmail) { */ public CheckoutVoucherAction shopperName(String shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -719,6 +823,7 @@ public String getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(String shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -729,6 +834,7 @@ public void setShopperName(String shopperName) { */ public CheckoutVoucherAction surcharge(Amount surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set return this; } @@ -752,6 +858,7 @@ public Amount getSurcharge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSurcharge(Amount surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set } /** @@ -762,6 +869,7 @@ public void setSurcharge(Amount surcharge) { */ public CheckoutVoucherAction totalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set return this; } @@ -785,6 +893,7 @@ public Amount getTotalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalAmount(Amount totalAmount) { this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set } /** @@ -795,6 +904,7 @@ public void setTotalAmount(Amount totalAmount) { */ public CheckoutVoucherAction type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -818,6 +928,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -828,6 +939,7 @@ public void setType(TypeEnum type) { */ public CheckoutVoucherAction url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -851,6 +963,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutVoucherAction includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CheckoutVoucherAction object is equal to o. */ @@ -864,53 +997,99 @@ public boolean equals(Object o) { } CheckoutVoucherAction checkoutVoucherAction = (CheckoutVoucherAction) o; return Objects.equals(this.alternativeReference, checkoutVoucherAction.alternativeReference) + && Objects.equals( + this.isSetAlternativeReference, checkoutVoucherAction.isSetAlternativeReference) && Objects.equals( this.collectionInstitutionNumber, checkoutVoucherAction.collectionInstitutionNumber) + && Objects.equals( + this.isSetCollectionInstitutionNumber, + checkoutVoucherAction.isSetCollectionInstitutionNumber) && Objects.equals(this.downloadUrl, checkoutVoucherAction.downloadUrl) + && Objects.equals(this.isSetDownloadUrl, checkoutVoucherAction.isSetDownloadUrl) && Objects.equals(this.entity, checkoutVoucherAction.entity) + && Objects.equals(this.isSetEntity, checkoutVoucherAction.isSetEntity) && Objects.equals(this.expiresAt, checkoutVoucherAction.expiresAt) + && Objects.equals(this.isSetExpiresAt, checkoutVoucherAction.isSetExpiresAt) && Objects.equals(this.initialAmount, checkoutVoucherAction.initialAmount) + && Objects.equals(this.isSetInitialAmount, checkoutVoucherAction.isSetInitialAmount) && Objects.equals(this.instructionsUrl, checkoutVoucherAction.instructionsUrl) + && Objects.equals(this.isSetInstructionsUrl, checkoutVoucherAction.isSetInstructionsUrl) && Objects.equals(this.issuer, checkoutVoucherAction.issuer) + && Objects.equals(this.isSetIssuer, checkoutVoucherAction.isSetIssuer) && Objects.equals(this.maskedTelephoneNumber, checkoutVoucherAction.maskedTelephoneNumber) + && Objects.equals( + this.isSetMaskedTelephoneNumber, checkoutVoucherAction.isSetMaskedTelephoneNumber) && Objects.equals(this.merchantName, checkoutVoucherAction.merchantName) + && Objects.equals(this.isSetMerchantName, checkoutVoucherAction.isSetMerchantName) && Objects.equals(this.merchantReference, checkoutVoucherAction.merchantReference) + && Objects.equals(this.isSetMerchantReference, checkoutVoucherAction.isSetMerchantReference) && Objects.equals(this.passCreationToken, checkoutVoucherAction.passCreationToken) + && Objects.equals(this.isSetPassCreationToken, checkoutVoucherAction.isSetPassCreationToken) && Objects.equals(this.paymentData, checkoutVoucherAction.paymentData) + && Objects.equals(this.isSetPaymentData, checkoutVoucherAction.isSetPaymentData) && Objects.equals(this.paymentMethodType, checkoutVoucherAction.paymentMethodType) + && Objects.equals(this.isSetPaymentMethodType, checkoutVoucherAction.isSetPaymentMethodType) && Objects.equals(this.reference, checkoutVoucherAction.reference) + && Objects.equals(this.isSetReference, checkoutVoucherAction.isSetReference) && Objects.equals(this.shopperEmail, checkoutVoucherAction.shopperEmail) + && Objects.equals(this.isSetShopperEmail, checkoutVoucherAction.isSetShopperEmail) && Objects.equals(this.shopperName, checkoutVoucherAction.shopperName) + && Objects.equals(this.isSetShopperName, checkoutVoucherAction.isSetShopperName) && Objects.equals(this.surcharge, checkoutVoucherAction.surcharge) + && Objects.equals(this.isSetSurcharge, checkoutVoucherAction.isSetSurcharge) && Objects.equals(this.totalAmount, checkoutVoucherAction.totalAmount) + && Objects.equals(this.isSetTotalAmount, checkoutVoucherAction.isSetTotalAmount) && Objects.equals(this.type, checkoutVoucherAction.type) - && Objects.equals(this.url, checkoutVoucherAction.url); + && Objects.equals(this.isSetType, checkoutVoucherAction.isSetType) + && Objects.equals(this.url, checkoutVoucherAction.url) + && Objects.equals(this.isSetUrl, checkoutVoucherAction.isSetUrl); } @Override public int hashCode() { return Objects.hash( alternativeReference, + isSetAlternativeReference, collectionInstitutionNumber, + isSetCollectionInstitutionNumber, downloadUrl, + isSetDownloadUrl, entity, + isSetEntity, expiresAt, + isSetExpiresAt, initialAmount, + isSetInitialAmount, instructionsUrl, + isSetInstructionsUrl, issuer, + isSetIssuer, maskedTelephoneNumber, + isSetMaskedTelephoneNumber, merchantName, + isSetMerchantName, merchantReference, + isSetMerchantReference, passCreationToken, + isSetPassCreationToken, paymentData, + isSetPaymentData, paymentMethodType, + isSetPaymentMethodType, reference, + isSetReference, shopperEmail, + isSetShopperEmail, shopperName, + isSetShopperName, surcharge, + isSetSurcharge, totalAmount, + isSetTotalAmount, type, - url); + isSetType, + url, + isSetUrl); } @Override @@ -958,6 +1137,91 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAlternativeReference) { + addIfNull(nulls, JSON_PROPERTY_ALTERNATIVE_REFERENCE, this.alternativeReference); + } + if (isSetCollectionInstitutionNumber) { + addIfNull( + nulls, JSON_PROPERTY_COLLECTION_INSTITUTION_NUMBER, this.collectionInstitutionNumber); + } + if (isSetDownloadUrl) { + addIfNull(nulls, JSON_PROPERTY_DOWNLOAD_URL, this.downloadUrl); + } + if (isSetEntity) { + addIfNull(nulls, JSON_PROPERTY_ENTITY, this.entity); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetInitialAmount) { + addIfNull(nulls, JSON_PROPERTY_INITIAL_AMOUNT, this.initialAmount); + } + if (isSetInstructionsUrl) { + addIfNull(nulls, JSON_PROPERTY_INSTRUCTIONS_URL, this.instructionsUrl); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetMaskedTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_MASKED_TELEPHONE_NUMBER, this.maskedTelephoneNumber); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetPassCreationToken) { + addIfNull(nulls, JSON_PROPERTY_PASS_CREATION_TOKEN, this.passCreationToken); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPaymentMethodType) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_TYPE, this.paymentMethodType); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetSurcharge) { + addIfNull(nulls, JSON_PROPERTY_SURCHARGE, this.surcharge); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CheckoutVoucherAction given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CommonField.java b/src/main/java/com/adyen/model/checkout/CommonField.java index 711a5d058..2c96b745a 100644 --- a/src/main/java/com/adyen/model/checkout/CommonField.java +++ b/src/main/java/com/adyen/model/checkout/CommonField.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class CommonField { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VERSION = "version"; private String version; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CommonField() {} /** @@ -36,6 +50,7 @@ public CommonField() {} */ public CommonField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setName(String name) { */ public CommonField version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(String version) { this.version = version; + isSetVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CommonField includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CommonField object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } CommonField commonField = (CommonField) o; return Objects.equals(this.name, commonField.name) - && Objects.equals(this.version, commonField.version); + && Objects.equals(this.isSetName, commonField.isSetName) + && Objects.equals(this.version, commonField.version) + && Objects.equals(this.isSetVersion, commonField.isSetVersion); } @Override public int hashCode() { - return Objects.hash(name, version); + return Objects.hash(name, isSetName, version, isSetVersion); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetVersion) { + addIfNull(nulls, JSON_PROPERTY_VERSION, this.version); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CommonField given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Company.java b/src/main/java/com/adyen/model/checkout/Company.java index a8338d9b9..3aa3b7e16 100644 --- a/src/main/java/com/adyen/model/checkout/Company.java +++ b/src/main/java/com/adyen/model/checkout/Company.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,21 +32,45 @@ public class Company { public static final String JSON_PROPERTY_HOMEPAGE = "homepage"; private String homepage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomepage = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_REGISTRATION_NUMBER = "registrationNumber"; private String registrationNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistrationNumber = false; + public static final String JSON_PROPERTY_REGISTRY_LOCATION = "registryLocation"; private String registryLocation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegistryLocation = false; + public static final String JSON_PROPERTY_TAX_ID = "taxId"; private String taxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Company() {} /** @@ -55,6 +81,7 @@ public Company() {} */ public Company homepage(String homepage) { this.homepage = homepage; + isSetHomepage = true; // mark as set return this; } @@ -78,6 +105,7 @@ public String getHomepage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomepage(String homepage) { this.homepage = homepage; + isSetHomepage = true; // mark as set } /** @@ -88,6 +116,7 @@ public void setHomepage(String homepage) { */ public Company name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -111,6 +140,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -121,6 +151,7 @@ public void setName(String name) { */ public Company registrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set return this; } @@ -144,6 +175,7 @@ public String getRegistrationNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistrationNumber(String registrationNumber) { this.registrationNumber = registrationNumber; + isSetRegistrationNumber = true; // mark as set } /** @@ -154,6 +186,7 @@ public void setRegistrationNumber(String registrationNumber) { */ public Company registryLocation(String registryLocation) { this.registryLocation = registryLocation; + isSetRegistryLocation = true; // mark as set return this; } @@ -177,6 +210,7 @@ public String getRegistryLocation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegistryLocation(String registryLocation) { this.registryLocation = registryLocation; + isSetRegistryLocation = true; // mark as set } /** @@ -187,6 +221,7 @@ public void setRegistryLocation(String registryLocation) { */ public Company taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -210,6 +245,7 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set } /** @@ -220,6 +256,7 @@ public void setTaxId(String taxId) { */ public Company type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -243,6 +280,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Company includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Company object is equal to o. */ @@ -256,16 +314,34 @@ public boolean equals(Object o) { } Company company = (Company) o; return Objects.equals(this.homepage, company.homepage) + && Objects.equals(this.isSetHomepage, company.isSetHomepage) && Objects.equals(this.name, company.name) + && Objects.equals(this.isSetName, company.isSetName) && Objects.equals(this.registrationNumber, company.registrationNumber) + && Objects.equals(this.isSetRegistrationNumber, company.isSetRegistrationNumber) && Objects.equals(this.registryLocation, company.registryLocation) + && Objects.equals(this.isSetRegistryLocation, company.isSetRegistryLocation) && Objects.equals(this.taxId, company.taxId) - && Objects.equals(this.type, company.type); + && Objects.equals(this.isSetTaxId, company.isSetTaxId) + && Objects.equals(this.type, company.type) + && Objects.equals(this.isSetType, company.isSetType); } @Override public int hashCode() { - return Objects.hash(homepage, name, registrationNumber, registryLocation, taxId, type); + return Objects.hash( + homepage, + isSetHomepage, + name, + isSetName, + registrationNumber, + isSetRegistrationNumber, + registryLocation, + isSetRegistryLocation, + taxId, + isSetTaxId, + type, + isSetType); } @Override @@ -292,6 +368,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetHomepage) { + addIfNull(nulls, JSON_PROPERTY_HOMEPAGE, this.homepage); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetRegistrationNumber) { + addIfNull(nulls, JSON_PROPERTY_REGISTRATION_NUMBER, this.registrationNumber); + } + if (isSetRegistryLocation) { + addIfNull(nulls, JSON_PROPERTY_REGISTRY_LOCATION, this.registryLocation); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Company given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java index ed55b878b..4f1f032b3 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -95,33 +97,63 @@ public class CreateCheckoutSessionRequest { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -173,60 +205,117 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private Company company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_ENABLE_ONE_CLICK = "enableOneClick"; private Boolean enableOneClick; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableOneClick = false; + public static final String JSON_PROPERTY_ENABLE_PAY_OUT = "enablePayOut"; private Boolean enablePayOut; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnablePayOut = false; + public static final String JSON_PROPERTY_ENABLE_RECURRING = "enableRecurring"; private Boolean enableRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableRecurring = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MANDATE = "mandate"; private Mandate mandate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandate = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + /** * Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in * or Components integration * **hosted**: Hosted Checkout integration @@ -274,18 +363,33 @@ public static ModeEnum fromValue(String value) { public static final String JSON_PROPERTY_MODE = "mode"; private ModeEnum mode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMode = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private String recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details. * Allowed values: * `Subscription` – A transaction for a fixed or variable amount, @@ -343,27 +447,51 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -424,37 +552,70 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private ShopperName shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SHOW_INSTALLMENT_AMOUNT = "showInstallmentAmount"; private Boolean showInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowInstallmentAmount = false; + public static final String JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** * Specifies how payment methods should be filtered based on the 'store' parameter: - * 'exclusive': Only payment methods belonging to the specified 'store' are @@ -506,9 +667,15 @@ public static StoreFiltrationModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_FILTRATION_MODE = "storeFiltrationMode"; private StoreFiltrationModeEnum storeFiltrationMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreFiltrationMode = false; + public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD = "storePaymentMethod"; private Boolean storePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethod = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -561,24 +728,48 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateCheckoutSessionRequest() {} /** @@ -589,6 +780,7 @@ public CreateCheckoutSessionRequest() {} */ public CreateCheckoutSessionRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -612,6 +804,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -622,6 +815,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public CreateCheckoutSessionRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -645,6 +839,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -659,6 +854,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public CreateCheckoutSessionRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -698,6 +894,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -713,6 +910,7 @@ public void setAdditionalData(Map additionalData) { */ public CreateCheckoutSessionRequest allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -755,6 +953,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -765,6 +964,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public CreateCheckoutSessionRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -788,6 +988,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -798,6 +999,7 @@ public void setAmount(Amount amount) { */ public CreateCheckoutSessionRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -821,6 +1023,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -831,6 +1034,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public CreateCheckoutSessionRequest authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -854,6 +1058,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -864,6 +1069,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public CreateCheckoutSessionRequest billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -887,6 +1093,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -902,6 +1109,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public CreateCheckoutSessionRequest blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -944,6 +1152,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -955,6 +1164,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public CreateCheckoutSessionRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -980,6 +1190,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -996,6 +1207,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public CreateCheckoutSessionRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -1031,6 +1243,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -1041,6 +1254,7 @@ public void setChannel(ChannelEnum channel) { */ public CreateCheckoutSessionRequest company(Company company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -1064,6 +1278,7 @@ public Company getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(Company company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -1074,6 +1289,7 @@ public void setCompany(Company company) { */ public CreateCheckoutSessionRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -1097,6 +1313,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -1109,6 +1326,7 @@ public void setCountryCode(String countryCode) { */ public CreateCheckoutSessionRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -1136,6 +1354,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -1150,6 +1369,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public CreateCheckoutSessionRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -1181,6 +1401,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -1191,6 +1412,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public CreateCheckoutSessionRequest deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -1214,6 +1436,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -1228,6 +1451,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { */ public CreateCheckoutSessionRequest enableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set return this; } @@ -1259,6 +1483,7 @@ public Boolean getEnableOneClick() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set } /** @@ -1271,6 +1496,7 @@ public void setEnableOneClick(Boolean enableOneClick) { */ public CreateCheckoutSessionRequest enablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set return this; } @@ -1298,6 +1524,7 @@ public Boolean getEnablePayOut() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set } /** @@ -1314,6 +1541,7 @@ public void setEnablePayOut(Boolean enablePayOut) { */ public CreateCheckoutSessionRequest enableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set return this; } @@ -1349,6 +1577,7 @@ public Boolean getEnableRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set } /** @@ -1365,6 +1594,7 @@ public void setEnableRecurring(Boolean enableRecurring) { */ public CreateCheckoutSessionRequest expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -1400,6 +1630,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -1410,6 +1641,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public CreateCheckoutSessionRequest fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -1433,6 +1665,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -1443,6 +1676,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public CreateCheckoutSessionRequest fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -1466,6 +1700,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1483,6 +1718,7 @@ public void setFundRecipient(FundRecipient fundRecipient) { public CreateCheckoutSessionRequest installmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -1528,6 +1764,7 @@ public Map getInstallmentOptions() { public void setInstallmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -1542,6 +1779,7 @@ public void setInstallmentOptions( */ public CreateCheckoutSessionRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1581,6 +1819,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1591,6 +1830,7 @@ public void setLineItems(List lineItems) { */ public CreateCheckoutSessionRequest mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1614,6 +1854,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1628,6 +1869,7 @@ public void setMandate(Mandate mandate) { */ public CreateCheckoutSessionRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1659,6 +1901,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1670,6 +1913,7 @@ public void setMcc(String mcc) { */ public CreateCheckoutSessionRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1695,6 +1939,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1719,6 +1964,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateCheckoutSessionRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1771,6 +2017,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1785,6 +2032,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public CreateCheckoutSessionRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1824,6 +2072,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1836,6 +2085,7 @@ public void setMetadata(Map metadata) { */ public CreateCheckoutSessionRequest mode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set return this; } @@ -1863,6 +2113,7 @@ public ModeEnum getMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set } /** @@ -1873,6 +2124,7 @@ public void setMode(ModeEnum mode) { */ public CreateCheckoutSessionRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1896,6 +2148,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1907,6 +2160,7 @@ public void setMpiData(ThreeDSecureData mpiData) { public CreateCheckoutSessionRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1930,6 +2184,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1941,6 +2196,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CreateCheckoutSessionRequest recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1966,6 +2222,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1976,6 +2233,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public CreateCheckoutSessionRequest recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1999,6 +2257,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -2026,6 +2285,7 @@ public void setRecurringFrequency(String recurringFrequency) { public CreateCheckoutSessionRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2081,6 +2341,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2092,6 +2353,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public CreateCheckoutSessionRequest redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -2117,6 +2379,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -2128,6 +2391,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public CreateCheckoutSessionRequest redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -2153,6 +2417,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -2163,6 +2428,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public CreateCheckoutSessionRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -2186,6 +2452,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -2223,6 +2490,7 @@ public void setReference(String reference) { */ public CreateCheckoutSessionRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -2300,6 +2568,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -2310,6 +2579,7 @@ public void setReturnUrl(String returnUrl) { */ public CreateCheckoutSessionRequest riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -2333,6 +2603,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -2343,6 +2614,7 @@ public void setRiskData(RiskData riskData) { */ public CreateCheckoutSessionRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -2366,6 +2638,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -2389,6 +2662,7 @@ public void setShopperEmail(String shopperEmail) { */ public CreateCheckoutSessionRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -2438,6 +2712,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -2470,6 +2745,7 @@ public void setShopperIP(String shopperIP) { public CreateCheckoutSessionRequest shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2535,6 +2811,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2547,6 +2824,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public CreateCheckoutSessionRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -2574,6 +2852,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2584,6 +2863,7 @@ public void setShopperLocale(String shopperLocale) { */ public CreateCheckoutSessionRequest shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2607,6 +2887,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2622,6 +2903,7 @@ public void setShopperName(ShopperName shopperName) { */ public CreateCheckoutSessionRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2655,6 +2937,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2670,6 +2953,7 @@ public void setShopperReference(String shopperReference) { */ public CreateCheckoutSessionRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -2703,6 +2987,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -2713,6 +2998,7 @@ public void setShopperStatement(String shopperStatement) { */ public CreateCheckoutSessionRequest showInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set return this; } @@ -2736,6 +3022,7 @@ public Boolean getShowInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set } /** @@ -2748,6 +3035,7 @@ public void setShowInstallmentAmount(Boolean showInstallmentAmount) { public CreateCheckoutSessionRequest showRemovePaymentMethodButton( Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -2773,6 +3061,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -2783,6 +3072,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public CreateCheckoutSessionRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2806,6 +3096,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2818,6 +3109,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public CreateCheckoutSessionRequest splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -2845,6 +3137,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -2863,6 +3156,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public CreateCheckoutSessionRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2910,6 +3204,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2933,6 +3228,7 @@ public void setSplits(List splits) { */ public CreateCheckoutSessionRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2982,6 +3278,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2999,6 +3296,7 @@ public void setStore(String store) { public CreateCheckoutSessionRequest storeFiltrationMode( StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set return this; } @@ -3034,6 +3332,7 @@ public StoreFiltrationModeEnum getStoreFiltrationMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set } /** @@ -3048,6 +3347,7 @@ public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) */ public CreateCheckoutSessionRequest storePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set return this; } @@ -3079,6 +3379,7 @@ public Boolean getStorePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set } /** @@ -3099,6 +3400,7 @@ public void setStorePaymentMethod(Boolean storePaymentMethod) { public CreateCheckoutSessionRequest storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -3140,6 +3442,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -3158,6 +3461,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public CreateCheckoutSessionRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -3197,6 +3501,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -3211,6 +3516,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public CreateCheckoutSessionRequest themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -3242,6 +3548,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -3253,6 +3560,7 @@ public void setThemeId(String themeId) { public CreateCheckoutSessionRequest threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -3276,6 +3584,7 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -3296,6 +3605,7 @@ public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2Re // `authenticationData.authenticationOnly` instead. public CreateCheckoutSessionRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -3339,6 +3649,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -3349,6 +3660,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public CreateCheckoutSessionRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -3372,6 +3684,27 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateCheckoutSessionRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateCheckoutSessionRequest object is equal to o. */ @@ -3385,148 +3718,316 @@ public boolean equals(Object o) { } CreateCheckoutSessionRequest createCheckoutSessionRequest = (CreateCheckoutSessionRequest) o; return Objects.equals(this.accountInfo, createCheckoutSessionRequest.accountInfo) + && Objects.equals(this.isSetAccountInfo, createCheckoutSessionRequest.isSetAccountInfo) && Objects.equals(this.additionalAmount, createCheckoutSessionRequest.additionalAmount) + && Objects.equals( + this.isSetAdditionalAmount, createCheckoutSessionRequest.isSetAdditionalAmount) && Objects.equals(this.additionalData, createCheckoutSessionRequest.additionalData) + && Objects.equals( + this.isSetAdditionalData, createCheckoutSessionRequest.isSetAdditionalData) && Objects.equals( this.allowedPaymentMethods, createCheckoutSessionRequest.allowedPaymentMethods) + && Objects.equals( + this.isSetAllowedPaymentMethods, + createCheckoutSessionRequest.isSetAllowedPaymentMethods) && Objects.equals(this.amount, createCheckoutSessionRequest.amount) + && Objects.equals(this.isSetAmount, createCheckoutSessionRequest.isSetAmount) && Objects.equals(this.applicationInfo, createCheckoutSessionRequest.applicationInfo) + && Objects.equals( + this.isSetApplicationInfo, createCheckoutSessionRequest.isSetApplicationInfo) && Objects.equals(this.authenticationData, createCheckoutSessionRequest.authenticationData) + && Objects.equals( + this.isSetAuthenticationData, createCheckoutSessionRequest.isSetAuthenticationData) && Objects.equals(this.billingAddress, createCheckoutSessionRequest.billingAddress) + && Objects.equals( + this.isSetBillingAddress, createCheckoutSessionRequest.isSetBillingAddress) && Objects.equals( this.blockedPaymentMethods, createCheckoutSessionRequest.blockedPaymentMethods) + && Objects.equals( + this.isSetBlockedPaymentMethods, + createCheckoutSessionRequest.isSetBlockedPaymentMethods) && Objects.equals(this.captureDelayHours, createCheckoutSessionRequest.captureDelayHours) + && Objects.equals( + this.isSetCaptureDelayHours, createCheckoutSessionRequest.isSetCaptureDelayHours) && Objects.equals(this.channel, createCheckoutSessionRequest.channel) + && Objects.equals(this.isSetChannel, createCheckoutSessionRequest.isSetChannel) && Objects.equals(this.company, createCheckoutSessionRequest.company) + && Objects.equals(this.isSetCompany, createCheckoutSessionRequest.isSetCompany) && Objects.equals(this.countryCode, createCheckoutSessionRequest.countryCode) + && Objects.equals(this.isSetCountryCode, createCheckoutSessionRequest.isSetCountryCode) && Objects.equals(this.dateOfBirth, createCheckoutSessionRequest.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, createCheckoutSessionRequest.isSetDateOfBirth) && Objects.equals(this.deliverAt, createCheckoutSessionRequest.deliverAt) + && Objects.equals(this.isSetDeliverAt, createCheckoutSessionRequest.isSetDeliverAt) && Objects.equals(this.deliveryAddress, createCheckoutSessionRequest.deliveryAddress) + && Objects.equals( + this.isSetDeliveryAddress, createCheckoutSessionRequest.isSetDeliveryAddress) && Objects.equals(this.enableOneClick, createCheckoutSessionRequest.enableOneClick) + && Objects.equals( + this.isSetEnableOneClick, createCheckoutSessionRequest.isSetEnableOneClick) && Objects.equals(this.enablePayOut, createCheckoutSessionRequest.enablePayOut) + && Objects.equals(this.isSetEnablePayOut, createCheckoutSessionRequest.isSetEnablePayOut) && Objects.equals(this.enableRecurring, createCheckoutSessionRequest.enableRecurring) + && Objects.equals( + this.isSetEnableRecurring, createCheckoutSessionRequest.isSetEnableRecurring) && Objects.equals(this.expiresAt, createCheckoutSessionRequest.expiresAt) + && Objects.equals(this.isSetExpiresAt, createCheckoutSessionRequest.isSetExpiresAt) && Objects.equals(this.fundOrigin, createCheckoutSessionRequest.fundOrigin) + && Objects.equals(this.isSetFundOrigin, createCheckoutSessionRequest.isSetFundOrigin) && Objects.equals(this.fundRecipient, createCheckoutSessionRequest.fundRecipient) + && Objects.equals(this.isSetFundRecipient, createCheckoutSessionRequest.isSetFundRecipient) && Objects.equals(this.installmentOptions, createCheckoutSessionRequest.installmentOptions) + && Objects.equals( + this.isSetInstallmentOptions, createCheckoutSessionRequest.isSetInstallmentOptions) && Objects.equals(this.lineItems, createCheckoutSessionRequest.lineItems) + && Objects.equals(this.isSetLineItems, createCheckoutSessionRequest.isSetLineItems) && Objects.equals(this.mandate, createCheckoutSessionRequest.mandate) + && Objects.equals(this.isSetMandate, createCheckoutSessionRequest.isSetMandate) && Objects.equals(this.mcc, createCheckoutSessionRequest.mcc) + && Objects.equals(this.isSetMcc, createCheckoutSessionRequest.isSetMcc) && Objects.equals(this.merchantAccount, createCheckoutSessionRequest.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, createCheckoutSessionRequest.isSetMerchantAccount) && Objects.equals( this.merchantOrderReference, createCheckoutSessionRequest.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, + createCheckoutSessionRequest.isSetMerchantOrderReference) && Objects.equals(this.metadata, createCheckoutSessionRequest.metadata) + && Objects.equals(this.isSetMetadata, createCheckoutSessionRequest.isSetMetadata) && Objects.equals(this.mode, createCheckoutSessionRequest.mode) + && Objects.equals(this.isSetMode, createCheckoutSessionRequest.isSetMode) && Objects.equals(this.mpiData, createCheckoutSessionRequest.mpiData) + && Objects.equals(this.isSetMpiData, createCheckoutSessionRequest.isSetMpiData) && Objects.equals( this.platformChargebackLogic, createCheckoutSessionRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, + createCheckoutSessionRequest.isSetPlatformChargebackLogic) && Objects.equals(this.recurringExpiry, createCheckoutSessionRequest.recurringExpiry) + && Objects.equals( + this.isSetRecurringExpiry, createCheckoutSessionRequest.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, createCheckoutSessionRequest.recurringFrequency) + && Objects.equals( + this.isSetRecurringFrequency, createCheckoutSessionRequest.isSetRecurringFrequency) && Objects.equals( this.recurringProcessingModel, createCheckoutSessionRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, + createCheckoutSessionRequest.isSetRecurringProcessingModel) && Objects.equals( this.redirectFromIssuerMethod, createCheckoutSessionRequest.redirectFromIssuerMethod) + && Objects.equals( + this.isSetRedirectFromIssuerMethod, + createCheckoutSessionRequest.isSetRedirectFromIssuerMethod) && Objects.equals( this.redirectToIssuerMethod, createCheckoutSessionRequest.redirectToIssuerMethod) + && Objects.equals( + this.isSetRedirectToIssuerMethod, + createCheckoutSessionRequest.isSetRedirectToIssuerMethod) && Objects.equals(this.reference, createCheckoutSessionRequest.reference) + && Objects.equals(this.isSetReference, createCheckoutSessionRequest.isSetReference) && Objects.equals(this.returnUrl, createCheckoutSessionRequest.returnUrl) + && Objects.equals(this.isSetReturnUrl, createCheckoutSessionRequest.isSetReturnUrl) && Objects.equals(this.riskData, createCheckoutSessionRequest.riskData) + && Objects.equals(this.isSetRiskData, createCheckoutSessionRequest.isSetRiskData) && Objects.equals(this.shopperEmail, createCheckoutSessionRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, createCheckoutSessionRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, createCheckoutSessionRequest.shopperIP) + && Objects.equals(this.isSetShopperIP, createCheckoutSessionRequest.isSetShopperIP) && Objects.equals(this.shopperInteraction, createCheckoutSessionRequest.shopperInteraction) + && Objects.equals( + this.isSetShopperInteraction, createCheckoutSessionRequest.isSetShopperInteraction) && Objects.equals(this.shopperLocale, createCheckoutSessionRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, createCheckoutSessionRequest.isSetShopperLocale) && Objects.equals(this.shopperName, createCheckoutSessionRequest.shopperName) + && Objects.equals(this.isSetShopperName, createCheckoutSessionRequest.isSetShopperName) && Objects.equals(this.shopperReference, createCheckoutSessionRequest.shopperReference) + && Objects.equals( + this.isSetShopperReference, createCheckoutSessionRequest.isSetShopperReference) && Objects.equals(this.shopperStatement, createCheckoutSessionRequest.shopperStatement) + && Objects.equals( + this.isSetShopperStatement, createCheckoutSessionRequest.isSetShopperStatement) && Objects.equals( this.showInstallmentAmount, createCheckoutSessionRequest.showInstallmentAmount) + && Objects.equals( + this.isSetShowInstallmentAmount, + createCheckoutSessionRequest.isSetShowInstallmentAmount) && Objects.equals( this.showRemovePaymentMethodButton, createCheckoutSessionRequest.showRemovePaymentMethodButton) + && Objects.equals( + this.isSetShowRemovePaymentMethodButton, + createCheckoutSessionRequest.isSetShowRemovePaymentMethodButton) && Objects.equals( this.socialSecurityNumber, createCheckoutSessionRequest.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, createCheckoutSessionRequest.isSetSocialSecurityNumber) && Objects.equals( this.splitCardFundingSources, createCheckoutSessionRequest.splitCardFundingSources) + && Objects.equals( + this.isSetSplitCardFundingSources, + createCheckoutSessionRequest.isSetSplitCardFundingSources) && Objects.equals(this.splits, createCheckoutSessionRequest.splits) + && Objects.equals(this.isSetSplits, createCheckoutSessionRequest.isSetSplits) && Objects.equals(this.store, createCheckoutSessionRequest.store) + && Objects.equals(this.isSetStore, createCheckoutSessionRequest.isSetStore) && Objects.equals( this.storeFiltrationMode, createCheckoutSessionRequest.storeFiltrationMode) + && Objects.equals( + this.isSetStoreFiltrationMode, createCheckoutSessionRequest.isSetStoreFiltrationMode) && Objects.equals(this.storePaymentMethod, createCheckoutSessionRequest.storePaymentMethod) + && Objects.equals( + this.isSetStorePaymentMethod, createCheckoutSessionRequest.isSetStorePaymentMethod) && Objects.equals( this.storePaymentMethodMode, createCheckoutSessionRequest.storePaymentMethodMode) + && Objects.equals( + this.isSetStorePaymentMethodMode, + createCheckoutSessionRequest.isSetStorePaymentMethodMode) && Objects.equals(this.telephoneNumber, createCheckoutSessionRequest.telephoneNumber) + && Objects.equals( + this.isSetTelephoneNumber, createCheckoutSessionRequest.isSetTelephoneNumber) && Objects.equals(this.themeId, createCheckoutSessionRequest.themeId) + && Objects.equals(this.isSetThemeId, createCheckoutSessionRequest.isSetThemeId) && Objects.equals( this.threeDS2RequestData, createCheckoutSessionRequest.threeDS2RequestData) + && Objects.equals( + this.isSetThreeDS2RequestData, createCheckoutSessionRequest.isSetThreeDS2RequestData) && Objects.equals( this.threeDSAuthenticationOnly, createCheckoutSessionRequest.threeDSAuthenticationOnly) - && Objects.equals(this.trustedShopper, createCheckoutSessionRequest.trustedShopper); + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, + createCheckoutSessionRequest.isSetThreeDSAuthenticationOnly) + && Objects.equals(this.trustedShopper, createCheckoutSessionRequest.trustedShopper) + && Objects.equals( + this.isSetTrustedShopper, createCheckoutSessionRequest.isSetTrustedShopper); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, allowedPaymentMethods, + isSetAllowedPaymentMethods, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, authenticationData, + isSetAuthenticationData, billingAddress, + isSetBillingAddress, blockedPaymentMethods, + isSetBlockedPaymentMethods, captureDelayHours, + isSetCaptureDelayHours, channel, + isSetChannel, company, + isSetCompany, countryCode, + isSetCountryCode, dateOfBirth, + isSetDateOfBirth, deliverAt, + isSetDeliverAt, deliveryAddress, + isSetDeliveryAddress, enableOneClick, + isSetEnableOneClick, enablePayOut, + isSetEnablePayOut, enableRecurring, + isSetEnableRecurring, expiresAt, + isSetExpiresAt, fundOrigin, + isSetFundOrigin, fundRecipient, + isSetFundRecipient, installmentOptions, + isSetInstallmentOptions, lineItems, + isSetLineItems, mandate, + isSetMandate, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, metadata, + isSetMetadata, mode, + isSetMode, mpiData, + isSetMpiData, platformChargebackLogic, + isSetPlatformChargebackLogic, recurringExpiry, + isSetRecurringExpiry, recurringFrequency, + isSetRecurringFrequency, recurringProcessingModel, + isSetRecurringProcessingModel, redirectFromIssuerMethod, + isSetRedirectFromIssuerMethod, redirectToIssuerMethod, + isSetRedirectToIssuerMethod, reference, + isSetReference, returnUrl, + isSetReturnUrl, riskData, + isSetRiskData, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, showInstallmentAmount, + isSetShowInstallmentAmount, showRemovePaymentMethodButton, + isSetShowRemovePaymentMethodButton, socialSecurityNumber, + isSetSocialSecurityNumber, splitCardFundingSources, + isSetSplitCardFundingSources, splits, + isSetSplits, store, + isSetStore, storeFiltrationMode, + isSetStoreFiltrationMode, storePaymentMethod, + isSetStorePaymentMethod, storePaymentMethodMode, + isSetStorePaymentMethodMode, telephoneNumber, + isSetTelephoneNumber, themeId, + isSetThemeId, threeDS2RequestData, + isSetThreeDS2RequestData, threeDSAuthenticationOnly, - trustedShopper); + isSetThreeDSAuthenticationOnly, + trustedShopper, + isSetTrustedShopper); } @Override @@ -3638,6 +4139,213 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetEnableOneClick) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_ONE_CLICK, this.enableOneClick); + } + if (isSetEnablePayOut) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_PAY_OUT, this.enablePayOut); + } + if (isSetEnableRecurring) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_RECURRING, this.enableRecurring); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMandate) { + addIfNull(nulls, JSON_PROPERTY_MANDATE, this.mandate); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMode) { + addIfNull(nulls, JSON_PROPERTY_MODE, this.mode); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetShowInstallmentAmount) { + addIfNull(nulls, JSON_PROPERTY_SHOW_INSTALLMENT_AMOUNT, this.showInstallmentAmount); + } + if (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStoreFiltrationMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_FILTRATION_MODE, this.storeFiltrationMode); + } + if (isSetStorePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD, this.storePaymentMethod); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateCheckoutSessionRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java index 7ac817353..2a367c5aa 100644 --- a/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateCheckoutSessionResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -97,33 +99,63 @@ public class CreateCheckoutSessionResponse { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -175,63 +207,123 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private Company company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private OffsetDateTime dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_ENABLE_ONE_CLICK = "enableOneClick"; private Boolean enableOneClick; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableOneClick = false; + public static final String JSON_PROPERTY_ENABLE_PAY_OUT = "enablePayOut"; private Boolean enablePayOut; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnablePayOut = false; + public static final String JSON_PROPERTY_ENABLE_RECURRING = "enableRecurring"; private Boolean enableRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableRecurring = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MANDATE = "mandate"; private Mandate mandate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandate = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + /** * Indicates the type of front end integration. Possible values: * **embedded** (default): Drop-in * or Components integration * **hosted**: Hosted Checkout integration @@ -279,18 +371,33 @@ public static ModeEnum fromValue(String value) { public static final String JSON_PROPERTY_MODE = "mode"; private ModeEnum mode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMode = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private String recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details. * Allowed values: * `Subscription` – A transaction for a fixed or variable amount, @@ -348,30 +455,57 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; + public static final String JSON_PROPERTY_SESSION_DATA = "sessionData"; private String sessionData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -432,37 +566,70 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private ShopperName shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SHOW_INSTALLMENT_AMOUNT = "showInstallmentAmount"; private Boolean showInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowInstallmentAmount = false; + public static final String JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** * Specifies how payment methods should be filtered based on the 'store' parameter: - * 'exclusive': Only payment methods belonging to the specified 'store' are @@ -514,9 +681,15 @@ public static StoreFiltrationModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_FILTRATION_MODE = "storeFiltrationMode"; private StoreFiltrationModeEnum storeFiltrationMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreFiltrationMode = false; + public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD = "storePaymentMethod"; private Boolean storePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethod = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -569,27 +742,54 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateCheckoutSessionResponse() {} @JsonCreator @@ -607,6 +807,7 @@ public CreateCheckoutSessionResponse(@JsonProperty(JSON_PROPERTY_ID) String id) */ public CreateCheckoutSessionResponse accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -630,6 +831,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -641,6 +843,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public CreateCheckoutSessionResponse additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -664,6 +867,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -679,6 +883,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public CreateCheckoutSessionResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -719,6 +924,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -735,6 +941,7 @@ public void setAdditionalData(Map additionalData) { */ public CreateCheckoutSessionResponse allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -777,6 +984,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -788,6 +996,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public CreateCheckoutSessionResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -811,6 +1020,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -822,6 +1032,7 @@ public void setAmount(Amount amount) { */ public CreateCheckoutSessionResponse applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -845,6 +1056,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -856,6 +1068,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public CreateCheckoutSessionResponse authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -879,6 +1092,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -890,6 +1104,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public CreateCheckoutSessionResponse billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -913,6 +1128,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -929,6 +1145,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public CreateCheckoutSessionResponse blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -971,6 +1188,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -983,6 +1201,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public CreateCheckoutSessionResponse captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -1008,6 +1227,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -1025,6 +1245,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public CreateCheckoutSessionResponse channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -1060,6 +1281,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -1071,6 +1293,7 @@ public void setChannel(ChannelEnum channel) { */ public CreateCheckoutSessionResponse company(Company company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -1094,6 +1317,7 @@ public Company getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(Company company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -1105,6 +1329,7 @@ public void setCompany(Company company) { */ public CreateCheckoutSessionResponse countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -1128,6 +1353,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -1141,6 +1367,7 @@ public void setCountryCode(String countryCode) { */ public CreateCheckoutSessionResponse dateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -1168,6 +1395,7 @@ public OffsetDateTime getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -1183,6 +1411,7 @@ public void setDateOfBirth(OffsetDateTime dateOfBirth) { */ public CreateCheckoutSessionResponse deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -1214,6 +1443,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -1225,6 +1455,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public CreateCheckoutSessionResponse deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -1248,6 +1479,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -1263,6 +1495,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { */ public CreateCheckoutSessionResponse enableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set return this; } @@ -1294,6 +1527,7 @@ public Boolean getEnableOneClick() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set } /** @@ -1307,6 +1541,7 @@ public void setEnableOneClick(Boolean enableOneClick) { */ public CreateCheckoutSessionResponse enablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set return this; } @@ -1334,6 +1569,7 @@ public Boolean getEnablePayOut() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set } /** @@ -1351,6 +1587,7 @@ public void setEnablePayOut(Boolean enablePayOut) { */ public CreateCheckoutSessionResponse enableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set return this; } @@ -1386,6 +1623,7 @@ public Boolean getEnableRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set } /** @@ -1403,6 +1641,7 @@ public void setEnableRecurring(Boolean enableRecurring) { */ public CreateCheckoutSessionResponse expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -1438,6 +1677,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -1449,6 +1689,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public CreateCheckoutSessionResponse fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -1472,6 +1713,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -1483,6 +1725,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public CreateCheckoutSessionResponse fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -1506,6 +1749,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1535,6 +1779,7 @@ public String getId() { public CreateCheckoutSessionResponse installmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -1580,6 +1825,7 @@ public Map getInstallmentOptions() { public void setInstallmentOptions( Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -1595,6 +1841,7 @@ public void setInstallmentOptions( */ public CreateCheckoutSessionResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1634,6 +1881,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1645,6 +1893,7 @@ public void setLineItems(List lineItems) { */ public CreateCheckoutSessionResponse mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1668,6 +1917,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1683,6 +1933,7 @@ public void setMandate(Mandate mandate) { */ public CreateCheckoutSessionResponse mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1714,6 +1965,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1726,6 +1978,7 @@ public void setMcc(String mcc) { */ public CreateCheckoutSessionResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1751,6 +2004,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1776,6 +2030,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateCheckoutSessionResponse merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1828,6 +2083,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1843,6 +2099,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public CreateCheckoutSessionResponse metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1882,6 +2139,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1895,6 +2153,7 @@ public void setMetadata(Map metadata) { */ public CreateCheckoutSessionResponse mode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set return this; } @@ -1922,6 +2181,7 @@ public ModeEnum getMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMode(ModeEnum mode) { this.mode = mode; + isSetMode = true; // mark as set } /** @@ -1933,6 +2193,7 @@ public void setMode(ModeEnum mode) { */ public CreateCheckoutSessionResponse mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1956,6 +2217,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1968,6 +2230,7 @@ public void setMpiData(ThreeDSecureData mpiData) { public CreateCheckoutSessionResponse platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1991,6 +2254,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -2003,6 +2267,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public CreateCheckoutSessionResponse recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -2028,6 +2293,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -2039,6 +2305,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public CreateCheckoutSessionResponse recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -2062,6 +2329,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -2090,6 +2358,7 @@ public void setRecurringFrequency(String recurringFrequency) { public CreateCheckoutSessionResponse recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2145,6 +2414,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2157,6 +2427,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public CreateCheckoutSessionResponse redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -2182,6 +2453,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -2194,6 +2466,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public CreateCheckoutSessionResponse redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -2219,6 +2492,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -2230,6 +2504,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public CreateCheckoutSessionResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -2253,6 +2528,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -2291,6 +2567,7 @@ public void setReference(String reference) { */ public CreateCheckoutSessionResponse returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -2368,6 +2645,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -2379,6 +2657,7 @@ public void setReturnUrl(String returnUrl) { */ public CreateCheckoutSessionResponse riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -2402,6 +2681,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -2413,6 +2693,7 @@ public void setRiskData(RiskData riskData) { */ public CreateCheckoutSessionResponse sessionData(String sessionData) { this.sessionData = sessionData; + isSetSessionData = true; // mark as set return this; } @@ -2436,6 +2717,7 @@ public String getSessionData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionData(String sessionData) { this.sessionData = sessionData; + isSetSessionData = true; // mark as set } /** @@ -2447,6 +2729,7 @@ public void setSessionData(String sessionData) { */ public CreateCheckoutSessionResponse shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -2470,6 +2753,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -2494,6 +2778,7 @@ public void setShopperEmail(String shopperEmail) { */ public CreateCheckoutSessionResponse shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -2543,6 +2828,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -2576,6 +2862,7 @@ public void setShopperIP(String shopperIP) { public CreateCheckoutSessionResponse shopperInteraction( ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2641,6 +2928,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2654,6 +2942,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public CreateCheckoutSessionResponse shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -2681,6 +2970,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2692,6 +2982,7 @@ public void setShopperLocale(String shopperLocale) { */ public CreateCheckoutSessionResponse shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2715,6 +3006,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2731,6 +3023,7 @@ public void setShopperName(ShopperName shopperName) { */ public CreateCheckoutSessionResponse shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2764,6 +3057,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2780,6 +3074,7 @@ public void setShopperReference(String shopperReference) { */ public CreateCheckoutSessionResponse shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -2813,6 +3108,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -2824,6 +3120,7 @@ public void setShopperStatement(String shopperStatement) { */ public CreateCheckoutSessionResponse showInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set return this; } @@ -2847,6 +3144,7 @@ public Boolean getShowInstallmentAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowInstallmentAmount(Boolean showInstallmentAmount) { this.showInstallmentAmount = showInstallmentAmount; + isSetShowInstallmentAmount = true; // mark as set } /** @@ -2860,6 +3158,7 @@ public void setShowInstallmentAmount(Boolean showInstallmentAmount) { public CreateCheckoutSessionResponse showRemovePaymentMethodButton( Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -2885,6 +3184,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -2896,6 +3196,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public CreateCheckoutSessionResponse socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2919,6 +3220,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2932,6 +3234,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public CreateCheckoutSessionResponse splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -2959,6 +3262,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -2978,6 +3282,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public CreateCheckoutSessionResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -3025,6 +3330,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -3049,6 +3355,7 @@ public void setSplits(List splits) { */ public CreateCheckoutSessionResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -3098,6 +3405,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -3116,6 +3424,7 @@ public void setStore(String store) { public CreateCheckoutSessionResponse storeFiltrationMode( StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set return this; } @@ -3151,6 +3460,7 @@ public StoreFiltrationModeEnum getStoreFiltrationMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set } /** @@ -3166,6 +3476,7 @@ public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) */ public CreateCheckoutSessionResponse storePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set return this; } @@ -3197,6 +3508,7 @@ public Boolean getStorePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set } /** @@ -3218,6 +3530,7 @@ public void setStorePaymentMethod(Boolean storePaymentMethod) { public CreateCheckoutSessionResponse storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -3259,6 +3572,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -3278,6 +3592,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public CreateCheckoutSessionResponse telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -3317,6 +3632,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -3332,6 +3648,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public CreateCheckoutSessionResponse themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -3363,6 +3680,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -3375,6 +3693,7 @@ public void setThemeId(String themeId) { public CreateCheckoutSessionResponse threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -3398,6 +3717,7 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -3420,6 +3740,7 @@ public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2Re public CreateCheckoutSessionResponse threeDSAuthenticationOnly( Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -3463,6 +3784,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -3474,6 +3796,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public CreateCheckoutSessionResponse trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -3497,6 +3820,7 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set } /** @@ -3510,6 +3834,7 @@ public void setTrustedShopper(Boolean trustedShopper) { */ public CreateCheckoutSessionResponse url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -3537,6 +3862,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateCheckoutSessionResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateCheckoutSessionResponse object is equal to o. */ @@ -3550,154 +3896,328 @@ public boolean equals(Object o) { } CreateCheckoutSessionResponse createCheckoutSessionResponse = (CreateCheckoutSessionResponse) o; return Objects.equals(this.accountInfo, createCheckoutSessionResponse.accountInfo) + && Objects.equals(this.isSetAccountInfo, createCheckoutSessionResponse.isSetAccountInfo) && Objects.equals(this.additionalAmount, createCheckoutSessionResponse.additionalAmount) + && Objects.equals( + this.isSetAdditionalAmount, createCheckoutSessionResponse.isSetAdditionalAmount) && Objects.equals(this.additionalData, createCheckoutSessionResponse.additionalData) + && Objects.equals( + this.isSetAdditionalData, createCheckoutSessionResponse.isSetAdditionalData) && Objects.equals( this.allowedPaymentMethods, createCheckoutSessionResponse.allowedPaymentMethods) + && Objects.equals( + this.isSetAllowedPaymentMethods, + createCheckoutSessionResponse.isSetAllowedPaymentMethods) && Objects.equals(this.amount, createCheckoutSessionResponse.amount) + && Objects.equals(this.isSetAmount, createCheckoutSessionResponse.isSetAmount) && Objects.equals(this.applicationInfo, createCheckoutSessionResponse.applicationInfo) + && Objects.equals( + this.isSetApplicationInfo, createCheckoutSessionResponse.isSetApplicationInfo) && Objects.equals(this.authenticationData, createCheckoutSessionResponse.authenticationData) + && Objects.equals( + this.isSetAuthenticationData, createCheckoutSessionResponse.isSetAuthenticationData) && Objects.equals(this.billingAddress, createCheckoutSessionResponse.billingAddress) + && Objects.equals( + this.isSetBillingAddress, createCheckoutSessionResponse.isSetBillingAddress) && Objects.equals( this.blockedPaymentMethods, createCheckoutSessionResponse.blockedPaymentMethods) + && Objects.equals( + this.isSetBlockedPaymentMethods, + createCheckoutSessionResponse.isSetBlockedPaymentMethods) && Objects.equals(this.captureDelayHours, createCheckoutSessionResponse.captureDelayHours) + && Objects.equals( + this.isSetCaptureDelayHours, createCheckoutSessionResponse.isSetCaptureDelayHours) && Objects.equals(this.channel, createCheckoutSessionResponse.channel) + && Objects.equals(this.isSetChannel, createCheckoutSessionResponse.isSetChannel) && Objects.equals(this.company, createCheckoutSessionResponse.company) + && Objects.equals(this.isSetCompany, createCheckoutSessionResponse.isSetCompany) && Objects.equals(this.countryCode, createCheckoutSessionResponse.countryCode) + && Objects.equals(this.isSetCountryCode, createCheckoutSessionResponse.isSetCountryCode) && Objects.equals(this.dateOfBirth, createCheckoutSessionResponse.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, createCheckoutSessionResponse.isSetDateOfBirth) && Objects.equals(this.deliverAt, createCheckoutSessionResponse.deliverAt) + && Objects.equals(this.isSetDeliverAt, createCheckoutSessionResponse.isSetDeliverAt) && Objects.equals(this.deliveryAddress, createCheckoutSessionResponse.deliveryAddress) + && Objects.equals( + this.isSetDeliveryAddress, createCheckoutSessionResponse.isSetDeliveryAddress) && Objects.equals(this.enableOneClick, createCheckoutSessionResponse.enableOneClick) + && Objects.equals( + this.isSetEnableOneClick, createCheckoutSessionResponse.isSetEnableOneClick) && Objects.equals(this.enablePayOut, createCheckoutSessionResponse.enablePayOut) + && Objects.equals(this.isSetEnablePayOut, createCheckoutSessionResponse.isSetEnablePayOut) && Objects.equals(this.enableRecurring, createCheckoutSessionResponse.enableRecurring) + && Objects.equals( + this.isSetEnableRecurring, createCheckoutSessionResponse.isSetEnableRecurring) && Objects.equals(this.expiresAt, createCheckoutSessionResponse.expiresAt) + && Objects.equals(this.isSetExpiresAt, createCheckoutSessionResponse.isSetExpiresAt) && Objects.equals(this.fundOrigin, createCheckoutSessionResponse.fundOrigin) + && Objects.equals(this.isSetFundOrigin, createCheckoutSessionResponse.isSetFundOrigin) && Objects.equals(this.fundRecipient, createCheckoutSessionResponse.fundRecipient) + && Objects.equals(this.isSetFundRecipient, createCheckoutSessionResponse.isSetFundRecipient) && Objects.equals(this.id, createCheckoutSessionResponse.id) + && Objects.equals(this.isSetId, createCheckoutSessionResponse.isSetId) && Objects.equals(this.installmentOptions, createCheckoutSessionResponse.installmentOptions) + && Objects.equals( + this.isSetInstallmentOptions, createCheckoutSessionResponse.isSetInstallmentOptions) && Objects.equals(this.lineItems, createCheckoutSessionResponse.lineItems) + && Objects.equals(this.isSetLineItems, createCheckoutSessionResponse.isSetLineItems) && Objects.equals(this.mandate, createCheckoutSessionResponse.mandate) + && Objects.equals(this.isSetMandate, createCheckoutSessionResponse.isSetMandate) && Objects.equals(this.mcc, createCheckoutSessionResponse.mcc) + && Objects.equals(this.isSetMcc, createCheckoutSessionResponse.isSetMcc) && Objects.equals(this.merchantAccount, createCheckoutSessionResponse.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, createCheckoutSessionResponse.isSetMerchantAccount) && Objects.equals( this.merchantOrderReference, createCheckoutSessionResponse.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, + createCheckoutSessionResponse.isSetMerchantOrderReference) && Objects.equals(this.metadata, createCheckoutSessionResponse.metadata) + && Objects.equals(this.isSetMetadata, createCheckoutSessionResponse.isSetMetadata) && Objects.equals(this.mode, createCheckoutSessionResponse.mode) + && Objects.equals(this.isSetMode, createCheckoutSessionResponse.isSetMode) && Objects.equals(this.mpiData, createCheckoutSessionResponse.mpiData) + && Objects.equals(this.isSetMpiData, createCheckoutSessionResponse.isSetMpiData) && Objects.equals( this.platformChargebackLogic, createCheckoutSessionResponse.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, + createCheckoutSessionResponse.isSetPlatformChargebackLogic) && Objects.equals(this.recurringExpiry, createCheckoutSessionResponse.recurringExpiry) + && Objects.equals( + this.isSetRecurringExpiry, createCheckoutSessionResponse.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, createCheckoutSessionResponse.recurringFrequency) + && Objects.equals( + this.isSetRecurringFrequency, createCheckoutSessionResponse.isSetRecurringFrequency) && Objects.equals( this.recurringProcessingModel, createCheckoutSessionResponse.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, + createCheckoutSessionResponse.isSetRecurringProcessingModel) && Objects.equals( this.redirectFromIssuerMethod, createCheckoutSessionResponse.redirectFromIssuerMethod) + && Objects.equals( + this.isSetRedirectFromIssuerMethod, + createCheckoutSessionResponse.isSetRedirectFromIssuerMethod) && Objects.equals( this.redirectToIssuerMethod, createCheckoutSessionResponse.redirectToIssuerMethod) + && Objects.equals( + this.isSetRedirectToIssuerMethod, + createCheckoutSessionResponse.isSetRedirectToIssuerMethod) && Objects.equals(this.reference, createCheckoutSessionResponse.reference) + && Objects.equals(this.isSetReference, createCheckoutSessionResponse.isSetReference) && Objects.equals(this.returnUrl, createCheckoutSessionResponse.returnUrl) + && Objects.equals(this.isSetReturnUrl, createCheckoutSessionResponse.isSetReturnUrl) && Objects.equals(this.riskData, createCheckoutSessionResponse.riskData) + && Objects.equals(this.isSetRiskData, createCheckoutSessionResponse.isSetRiskData) && Objects.equals(this.sessionData, createCheckoutSessionResponse.sessionData) + && Objects.equals(this.isSetSessionData, createCheckoutSessionResponse.isSetSessionData) && Objects.equals(this.shopperEmail, createCheckoutSessionResponse.shopperEmail) + && Objects.equals(this.isSetShopperEmail, createCheckoutSessionResponse.isSetShopperEmail) && Objects.equals(this.shopperIP, createCheckoutSessionResponse.shopperIP) + && Objects.equals(this.isSetShopperIP, createCheckoutSessionResponse.isSetShopperIP) && Objects.equals(this.shopperInteraction, createCheckoutSessionResponse.shopperInteraction) + && Objects.equals( + this.isSetShopperInteraction, createCheckoutSessionResponse.isSetShopperInteraction) && Objects.equals(this.shopperLocale, createCheckoutSessionResponse.shopperLocale) + && Objects.equals(this.isSetShopperLocale, createCheckoutSessionResponse.isSetShopperLocale) && Objects.equals(this.shopperName, createCheckoutSessionResponse.shopperName) + && Objects.equals(this.isSetShopperName, createCheckoutSessionResponse.isSetShopperName) && Objects.equals(this.shopperReference, createCheckoutSessionResponse.shopperReference) + && Objects.equals( + this.isSetShopperReference, createCheckoutSessionResponse.isSetShopperReference) && Objects.equals(this.shopperStatement, createCheckoutSessionResponse.shopperStatement) + && Objects.equals( + this.isSetShopperStatement, createCheckoutSessionResponse.isSetShopperStatement) && Objects.equals( this.showInstallmentAmount, createCheckoutSessionResponse.showInstallmentAmount) + && Objects.equals( + this.isSetShowInstallmentAmount, + createCheckoutSessionResponse.isSetShowInstallmentAmount) && Objects.equals( this.showRemovePaymentMethodButton, createCheckoutSessionResponse.showRemovePaymentMethodButton) + && Objects.equals( + this.isSetShowRemovePaymentMethodButton, + createCheckoutSessionResponse.isSetShowRemovePaymentMethodButton) && Objects.equals( this.socialSecurityNumber, createCheckoutSessionResponse.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, createCheckoutSessionResponse.isSetSocialSecurityNumber) && Objects.equals( this.splitCardFundingSources, createCheckoutSessionResponse.splitCardFundingSources) + && Objects.equals( + this.isSetSplitCardFundingSources, + createCheckoutSessionResponse.isSetSplitCardFundingSources) && Objects.equals(this.splits, createCheckoutSessionResponse.splits) + && Objects.equals(this.isSetSplits, createCheckoutSessionResponse.isSetSplits) && Objects.equals(this.store, createCheckoutSessionResponse.store) + && Objects.equals(this.isSetStore, createCheckoutSessionResponse.isSetStore) && Objects.equals( this.storeFiltrationMode, createCheckoutSessionResponse.storeFiltrationMode) + && Objects.equals( + this.isSetStoreFiltrationMode, createCheckoutSessionResponse.isSetStoreFiltrationMode) && Objects.equals(this.storePaymentMethod, createCheckoutSessionResponse.storePaymentMethod) + && Objects.equals( + this.isSetStorePaymentMethod, createCheckoutSessionResponse.isSetStorePaymentMethod) && Objects.equals( this.storePaymentMethodMode, createCheckoutSessionResponse.storePaymentMethodMode) + && Objects.equals( + this.isSetStorePaymentMethodMode, + createCheckoutSessionResponse.isSetStorePaymentMethodMode) && Objects.equals(this.telephoneNumber, createCheckoutSessionResponse.telephoneNumber) + && Objects.equals( + this.isSetTelephoneNumber, createCheckoutSessionResponse.isSetTelephoneNumber) && Objects.equals(this.themeId, createCheckoutSessionResponse.themeId) + && Objects.equals(this.isSetThemeId, createCheckoutSessionResponse.isSetThemeId) && Objects.equals( this.threeDS2RequestData, createCheckoutSessionResponse.threeDS2RequestData) + && Objects.equals( + this.isSetThreeDS2RequestData, createCheckoutSessionResponse.isSetThreeDS2RequestData) && Objects.equals( this.threeDSAuthenticationOnly, createCheckoutSessionResponse.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, + createCheckoutSessionResponse.isSetThreeDSAuthenticationOnly) && Objects.equals(this.trustedShopper, createCheckoutSessionResponse.trustedShopper) - && Objects.equals(this.url, createCheckoutSessionResponse.url); + && Objects.equals( + this.isSetTrustedShopper, createCheckoutSessionResponse.isSetTrustedShopper) + && Objects.equals(this.url, createCheckoutSessionResponse.url) + && Objects.equals(this.isSetUrl, createCheckoutSessionResponse.isSetUrl); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, allowedPaymentMethods, + isSetAllowedPaymentMethods, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, authenticationData, + isSetAuthenticationData, billingAddress, + isSetBillingAddress, blockedPaymentMethods, + isSetBlockedPaymentMethods, captureDelayHours, + isSetCaptureDelayHours, channel, + isSetChannel, company, + isSetCompany, countryCode, + isSetCountryCode, dateOfBirth, + isSetDateOfBirth, deliverAt, + isSetDeliverAt, deliveryAddress, + isSetDeliveryAddress, enableOneClick, + isSetEnableOneClick, enablePayOut, + isSetEnablePayOut, enableRecurring, + isSetEnableRecurring, expiresAt, + isSetExpiresAt, fundOrigin, + isSetFundOrigin, fundRecipient, + isSetFundRecipient, id, + isSetId, installmentOptions, + isSetInstallmentOptions, lineItems, + isSetLineItems, mandate, + isSetMandate, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, metadata, + isSetMetadata, mode, + isSetMode, mpiData, + isSetMpiData, platformChargebackLogic, + isSetPlatformChargebackLogic, recurringExpiry, + isSetRecurringExpiry, recurringFrequency, + isSetRecurringFrequency, recurringProcessingModel, + isSetRecurringProcessingModel, redirectFromIssuerMethod, + isSetRedirectFromIssuerMethod, redirectToIssuerMethod, + isSetRedirectToIssuerMethod, reference, + isSetReference, returnUrl, + isSetReturnUrl, riskData, + isSetRiskData, sessionData, + isSetSessionData, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, showInstallmentAmount, + isSetShowInstallmentAmount, showRemovePaymentMethodButton, + isSetShowRemovePaymentMethodButton, socialSecurityNumber, + isSetSocialSecurityNumber, splitCardFundingSources, + isSetSplitCardFundingSources, splits, + isSetSplits, store, + isSetStore, storeFiltrationMode, + isSetStoreFiltrationMode, storePaymentMethod, + isSetStorePaymentMethod, storePaymentMethodMode, + isSetStorePaymentMethodMode, telephoneNumber, + isSetTelephoneNumber, themeId, + isSetThemeId, threeDS2RequestData, + isSetThreeDS2RequestData, threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly, trustedShopper, - url); + isSetTrustedShopper, + url, + isSetUrl); } @Override @@ -3812,6 +4332,222 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetEnableOneClick) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_ONE_CLICK, this.enableOneClick); + } + if (isSetEnablePayOut) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_PAY_OUT, this.enablePayOut); + } + if (isSetEnableRecurring) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_RECURRING, this.enableRecurring); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMandate) { + addIfNull(nulls, JSON_PROPERTY_MANDATE, this.mandate); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMode) { + addIfNull(nulls, JSON_PROPERTY_MODE, this.mode); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetSessionData) { + addIfNull(nulls, JSON_PROPERTY_SESSION_DATA, this.sessionData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetShowInstallmentAmount) { + addIfNull(nulls, JSON_PROPERTY_SHOW_INSTALLMENT_AMOUNT, this.showInstallmentAmount); + } + if (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStoreFiltrationMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_FILTRATION_MODE, this.storeFiltrationMode); + } + if (isSetStorePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD, this.storePaymentMethod); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateCheckoutSessionResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java b/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java index 71280b5a6..0823430fa 100644 --- a/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/CreateOrderRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class CreateOrderRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateOrderRequest() {} /** @@ -47,6 +67,7 @@ public CreateOrderRequest() {} */ public CreateOrderRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -70,6 +91,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAmount(Amount amount) { */ public CreateOrderRequest expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -115,6 +138,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -126,6 +150,7 @@ public void setExpiresAt(String expiresAt) { */ public CreateOrderRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -151,6 +176,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -161,6 +187,7 @@ public void setMerchantAccount(String merchantAccount) { */ public CreateOrderRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -184,6 +211,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateOrderRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateOrderRequest object is equal to o. */ @@ -197,14 +245,26 @@ public boolean equals(Object o) { } CreateOrderRequest createOrderRequest = (CreateOrderRequest) o; return Objects.equals(this.amount, createOrderRequest.amount) + && Objects.equals(this.isSetAmount, createOrderRequest.isSetAmount) && Objects.equals(this.expiresAt, createOrderRequest.expiresAt) + && Objects.equals(this.isSetExpiresAt, createOrderRequest.isSetExpiresAt) && Objects.equals(this.merchantAccount, createOrderRequest.merchantAccount) - && Objects.equals(this.reference, createOrderRequest.reference); + && Objects.equals(this.isSetMerchantAccount, createOrderRequest.isSetMerchantAccount) + && Objects.equals(this.reference, createOrderRequest.reference) + && Objects.equals(this.isSetReference, createOrderRequest.isSetReference); } @Override public int hashCode() { - return Objects.hash(amount, expiresAt, merchantAccount, reference); + return Objects.hash( + amount, + isSetAmount, + expiresAt, + isSetExpiresAt, + merchantAccount, + isSetMerchantAccount, + reference, + isSetReference); } @Override @@ -229,6 +289,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateOrderRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java b/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java index b83dc21ea..fd53642a1 100644 --- a/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/CreateOrderResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,30 +42,57 @@ public class CreateOrderResponse { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private String expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FRAUD_RESULT = "fraudResult"; private FraudResult fraudResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResult = false; + public static final String JSON_PROPERTY_ORDER_DATA = "orderData"; private String orderData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderData = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + public static final String JSON_PROPERTY_REMAINING_AMOUNT = "remainingAmount"; private Amount remainingAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemainingAmount = false; + /** The result of the order creation request. The value is always **Success**. */ public enum ResultCodeEnum { SUCCESS(String.valueOf("Success")); @@ -106,6 +135,15 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public CreateOrderResponse() {} /** @@ -119,6 +157,7 @@ public CreateOrderResponse() {} */ public CreateOrderResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -156,6 +195,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -166,6 +206,7 @@ public void setAdditionalData(Map additionalData) { */ public CreateOrderResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -189,6 +230,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -199,6 +241,7 @@ public void setAmount(Amount amount) { */ public CreateOrderResponse expiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -222,6 +265,7 @@ public String getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(String expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -232,6 +276,7 @@ public void setExpiresAt(String expiresAt) { */ public CreateOrderResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -255,6 +300,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -266,6 +312,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public CreateOrderResponse orderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set return this; } @@ -291,6 +338,7 @@ public String getOrderData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set } /** @@ -303,6 +351,7 @@ public void setOrderData(String orderData) { */ public CreateOrderResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -331,6 +380,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -341,6 +391,7 @@ public void setPspReference(String pspReference) { */ public CreateOrderResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -364,6 +415,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -382,6 +434,7 @@ public void setReference(String reference) { */ public CreateOrderResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -421,6 +474,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -431,6 +485,7 @@ public void setRefusalReason(String refusalReason) { */ public CreateOrderResponse remainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set return this; } @@ -454,6 +509,7 @@ public Amount getRemainingAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemainingAmount(Amount remainingAmount) { this.remainingAmount = remainingAmount; + isSetRemainingAmount = true; // mark as set } /** @@ -464,6 +520,7 @@ public void setRemainingAmount(Amount remainingAmount) { */ public CreateOrderResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -487,6 +544,27 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CreateOrderResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this CreateOrderResponse object is equal to o. */ @@ -500,30 +578,50 @@ public boolean equals(Object o) { } CreateOrderResponse createOrderResponse = (CreateOrderResponse) o; return Objects.equals(this.additionalData, createOrderResponse.additionalData) + && Objects.equals(this.isSetAdditionalData, createOrderResponse.isSetAdditionalData) && Objects.equals(this.amount, createOrderResponse.amount) + && Objects.equals(this.isSetAmount, createOrderResponse.isSetAmount) && Objects.equals(this.expiresAt, createOrderResponse.expiresAt) + && Objects.equals(this.isSetExpiresAt, createOrderResponse.isSetExpiresAt) && Objects.equals(this.fraudResult, createOrderResponse.fraudResult) + && Objects.equals(this.isSetFraudResult, createOrderResponse.isSetFraudResult) && Objects.equals(this.orderData, createOrderResponse.orderData) + && Objects.equals(this.isSetOrderData, createOrderResponse.isSetOrderData) && Objects.equals(this.pspReference, createOrderResponse.pspReference) + && Objects.equals(this.isSetPspReference, createOrderResponse.isSetPspReference) && Objects.equals(this.reference, createOrderResponse.reference) + && Objects.equals(this.isSetReference, createOrderResponse.isSetReference) && Objects.equals(this.refusalReason, createOrderResponse.refusalReason) + && Objects.equals(this.isSetRefusalReason, createOrderResponse.isSetRefusalReason) && Objects.equals(this.remainingAmount, createOrderResponse.remainingAmount) - && Objects.equals(this.resultCode, createOrderResponse.resultCode); + && Objects.equals(this.isSetRemainingAmount, createOrderResponse.isSetRemainingAmount) + && Objects.equals(this.resultCode, createOrderResponse.resultCode) + && Objects.equals(this.isSetResultCode, createOrderResponse.isSetResultCode); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, amount, + isSetAmount, expiresAt, + isSetExpiresAt, fraudResult, + isSetFraudResult, orderData, + isSetOrderData, pspReference, + isSetPspReference, reference, + isSetReference, refusalReason, + isSetRefusalReason, remainingAmount, - resultCode); + isSetRemainingAmount, + resultCode, + isSetResultCode); } @Override @@ -554,6 +652,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetOrderData) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATA, this.orderData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetRemainingAmount) { + addIfNull(nulls, JSON_PROPERTY_REMAINING_AMOUNT, this.remainingAmount); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of CreateOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java index ff692da56..d182413a2 100644 --- a/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java +++ b/src/main/java/com/adyen/model/checkout/DefaultErrorResponseEntity.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,27 +36,57 @@ public class DefaultErrorResponseEntity { public static final String JSON_PROPERTY_DETAIL = "detail"; private String detail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_INSTANCE = "instance"; private String instance; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; private List invalidFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; private String requestId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TITLE = "title"; private String title; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DefaultErrorResponseEntity() {} /** @@ -65,6 +97,7 @@ public DefaultErrorResponseEntity() {} */ public DefaultErrorResponseEntity detail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set return this; } @@ -88,6 +121,7 @@ public String getDetail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetail(String detail) { this.detail = detail; + isSetDetail = true; // mark as set } /** @@ -98,6 +132,7 @@ public void setDetail(String detail) { */ public DefaultErrorResponseEntity errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -121,6 +156,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -131,6 +167,7 @@ public void setErrorCode(String errorCode) { */ public DefaultErrorResponseEntity instance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set return this; } @@ -154,6 +191,7 @@ public String getInstance() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstance(String instance) { this.instance = instance; + isSetInstance = true; // mark as set } /** @@ -164,6 +202,7 @@ public void setInstance(String instance) { */ public DefaultErrorResponseEntity invalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set return this; } @@ -195,6 +234,7 @@ public List getInvalidFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInvalidFields(List invalidFields) { this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set } /** @@ -205,6 +245,7 @@ public void setInvalidFields(List invalidFields) { */ public DefaultErrorResponseEntity requestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set return this; } @@ -228,6 +269,7 @@ public String getRequestId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestId(String requestId) { this.requestId = requestId; + isSetRequestId = true; // mark as set } /** @@ -238,6 +280,7 @@ public void setRequestId(String requestId) { */ public DefaultErrorResponseEntity status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +304,7 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -271,6 +315,7 @@ public void setStatus(Integer status) { */ public DefaultErrorResponseEntity title(String title) { this.title = title; + isSetTitle = true; // mark as set return this; } @@ -294,6 +339,7 @@ public String getTitle() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTitle(String title) { this.title = title; + isSetTitle = true; // mark as set } /** @@ -306,6 +352,7 @@ public void setTitle(String title) { */ public DefaultErrorResponseEntity type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -333,6 +380,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DefaultErrorResponseEntity object is equal to o. */ @@ -346,18 +414,42 @@ public boolean equals(Object o) { } DefaultErrorResponseEntity defaultErrorResponseEntity = (DefaultErrorResponseEntity) o; return Objects.equals(this.detail, defaultErrorResponseEntity.detail) + && Objects.equals(this.isSetDetail, defaultErrorResponseEntity.isSetDetail) && Objects.equals(this.errorCode, defaultErrorResponseEntity.errorCode) + && Objects.equals(this.isSetErrorCode, defaultErrorResponseEntity.isSetErrorCode) && Objects.equals(this.instance, defaultErrorResponseEntity.instance) + && Objects.equals(this.isSetInstance, defaultErrorResponseEntity.isSetInstance) && Objects.equals(this.invalidFields, defaultErrorResponseEntity.invalidFields) + && Objects.equals(this.isSetInvalidFields, defaultErrorResponseEntity.isSetInvalidFields) && Objects.equals(this.requestId, defaultErrorResponseEntity.requestId) + && Objects.equals(this.isSetRequestId, defaultErrorResponseEntity.isSetRequestId) && Objects.equals(this.status, defaultErrorResponseEntity.status) + && Objects.equals(this.isSetStatus, defaultErrorResponseEntity.isSetStatus) && Objects.equals(this.title, defaultErrorResponseEntity.title) - && Objects.equals(this.type, defaultErrorResponseEntity.type); + && Objects.equals(this.isSetTitle, defaultErrorResponseEntity.isSetTitle) + && Objects.equals(this.type, defaultErrorResponseEntity.type) + && Objects.equals(this.isSetType, defaultErrorResponseEntity.isSetType); } @Override public int hashCode() { - return Objects.hash(detail, errorCode, instance, invalidFields, requestId, status, title, type); + return Objects.hash( + detail, + isSetDetail, + errorCode, + isSetErrorCode, + instance, + isSetInstance, + invalidFields, + isSetInvalidFields, + requestId, + isSetRequestId, + status, + isSetStatus, + title, + isSetTitle, + type, + isSetType); } @Override @@ -386,6 +478,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DefaultErrorResponseEntity given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DeliveryAddress.java b/src/main/java/com/adyen/model/checkout/DeliveryAddress.java index 8be597897..e9bd01f05 100644 --- a/src/main/java/com/adyen/model/checkout/DeliveryAddress.java +++ b/src/main/java/com/adyen/model/checkout/DeliveryAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,27 +34,57 @@ public class DeliveryAddress { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_HOUSE_NUMBER_OR_NAME = "houseNumberOrName"; private String houseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHouseNumberOrName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; private String postalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; private String stateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + public static final String JSON_PROPERTY_STREET = "street"; private String street; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryAddress() {} /** @@ -63,6 +95,7 @@ public DeliveryAddress() {} */ public DeliveryAddress city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -86,6 +119,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -100,6 +134,7 @@ public void setCity(String city) { */ public DeliveryAddress country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -131,6 +166,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -141,6 +177,7 @@ public void setCountry(String country) { */ public DeliveryAddress firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -164,6 +201,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -174,6 +212,7 @@ public void setFirstName(String firstName) { */ public DeliveryAddress houseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set return this; } @@ -197,6 +236,7 @@ public String getHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHouseNumberOrName(String houseNumberOrName) { this.houseNumberOrName = houseNumberOrName; + isSetHouseNumberOrName = true; // mark as set } /** @@ -207,6 +247,7 @@ public void setHouseNumberOrName(String houseNumberOrName) { */ public DeliveryAddress lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -230,6 +271,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -242,6 +284,7 @@ public void setLastName(String lastName) { */ public DeliveryAddress postalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set return this; } @@ -269,6 +312,7 @@ public String getPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(String postalCode) { this.postalCode = postalCode; + isSetPostalCode = true; // mark as set } /** @@ -281,6 +325,7 @@ public void setPostalCode(String postalCode) { */ public DeliveryAddress stateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set return this; } @@ -308,6 +353,7 @@ public String getStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStateOrProvince(String stateOrProvince) { this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set } /** @@ -321,6 +367,7 @@ public void setStateOrProvince(String stateOrProvince) { */ public DeliveryAddress street(String street) { this.street = street; + isSetStreet = true; // mark as set return this; } @@ -350,6 +397,27 @@ public String getStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStreet(String street) { this.street = street; + isSetStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryAddress includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeliveryAddress object is equal to o. */ @@ -363,19 +431,42 @@ public boolean equals(Object o) { } DeliveryAddress deliveryAddress = (DeliveryAddress) o; return Objects.equals(this.city, deliveryAddress.city) + && Objects.equals(this.isSetCity, deliveryAddress.isSetCity) && Objects.equals(this.country, deliveryAddress.country) + && Objects.equals(this.isSetCountry, deliveryAddress.isSetCountry) && Objects.equals(this.firstName, deliveryAddress.firstName) + && Objects.equals(this.isSetFirstName, deliveryAddress.isSetFirstName) && Objects.equals(this.houseNumberOrName, deliveryAddress.houseNumberOrName) + && Objects.equals(this.isSetHouseNumberOrName, deliveryAddress.isSetHouseNumberOrName) && Objects.equals(this.lastName, deliveryAddress.lastName) + && Objects.equals(this.isSetLastName, deliveryAddress.isSetLastName) && Objects.equals(this.postalCode, deliveryAddress.postalCode) + && Objects.equals(this.isSetPostalCode, deliveryAddress.isSetPostalCode) && Objects.equals(this.stateOrProvince, deliveryAddress.stateOrProvince) - && Objects.equals(this.street, deliveryAddress.street); + && Objects.equals(this.isSetStateOrProvince, deliveryAddress.isSetStateOrProvince) + && Objects.equals(this.street, deliveryAddress.street) + && Objects.equals(this.isSetStreet, deliveryAddress.isSetStreet); } @Override public int hashCode() { return Objects.hash( - city, country, firstName, houseNumberOrName, lastName, postalCode, stateOrProvince, street); + city, + isSetCity, + country, + isSetCountry, + firstName, + isSetFirstName, + houseNumberOrName, + isSetHouseNumberOrName, + lastName, + isSetLastName, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince, + street, + isSetStreet); } @Override @@ -404,6 +495,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetHouseNumberOrName) { + addIfNull(nulls, JSON_PROPERTY_HOUSE_NUMBER_OR_NAME, this.houseNumberOrName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DeliveryAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DeliveryMethod.java b/src/main/java/com/adyen/model/checkout/DeliveryMethod.java index a07d214ab..771914790 100644 --- a/src/main/java/com/adyen/model/checkout/DeliveryMethod.java +++ b/src/main/java/com/adyen/model/checkout/DeliveryMethod.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class DeliveryMethod { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELECTED = "selected"; private Boolean selected; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSelected = false; + /** The type of the delivery method. */ public enum TypeEnum { SHIPPING(String.valueOf("Shipping")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeliveryMethod() {} /** @@ -94,6 +117,7 @@ public DeliveryMethod() {} */ public DeliveryMethod amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -117,6 +141,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setAmount(Amount amount) { */ public DeliveryMethod description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -150,6 +176,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -160,6 +187,7 @@ public void setDescription(String description) { */ public DeliveryMethod reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -183,6 +211,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -195,6 +224,7 @@ public void setReference(String reference) { */ public DeliveryMethod selected(Boolean selected) { this.selected = selected; + isSetSelected = true; // mark as set return this; } @@ -222,6 +252,7 @@ public Boolean getSelected() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSelected(Boolean selected) { this.selected = selected; + isSetSelected = true; // mark as set } /** @@ -232,6 +263,7 @@ public void setSelected(Boolean selected) { */ public DeliveryMethod type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -255,6 +287,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeliveryMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeliveryMethod object is equal to o. */ @@ -268,15 +321,30 @@ public boolean equals(Object o) { } DeliveryMethod deliveryMethod = (DeliveryMethod) o; return Objects.equals(this.amount, deliveryMethod.amount) + && Objects.equals(this.isSetAmount, deliveryMethod.isSetAmount) && Objects.equals(this.description, deliveryMethod.description) + && Objects.equals(this.isSetDescription, deliveryMethod.isSetDescription) && Objects.equals(this.reference, deliveryMethod.reference) + && Objects.equals(this.isSetReference, deliveryMethod.isSetReference) && Objects.equals(this.selected, deliveryMethod.selected) - && Objects.equals(this.type, deliveryMethod.type); + && Objects.equals(this.isSetSelected, deliveryMethod.isSetSelected) + && Objects.equals(this.type, deliveryMethod.type) + && Objects.equals(this.isSetType, deliveryMethod.isSetType); } @Override public int hashCode() { - return Objects.hash(amount, description, reference, selected, type); + return Objects.hash( + amount, + isSetAmount, + description, + isSetDescription, + reference, + isSetReference, + selected, + isSetSelected, + type, + isSetType); } @Override @@ -302,6 +370,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSelected) { + addIfNull(nulls, JSON_PROPERTY_SELECTED, this.selected); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DeliveryMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Destination.java b/src/main/java/com/adyen/model/checkout/Destination.java new file mode 100644 index 000000000..49ed8f5f3 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/Destination.java @@ -0,0 +1,321 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** Destination */ +@JsonPropertyOrder({ + Destination.JSON_PROPERTY_COUNTRY_CODE, + Destination.JSON_PROPERTY_POSTAL_CODE, + Destination.JSON_PROPERTY_STATE_OR_PROVINCE +}) +public class Destination { + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; + private String countryCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; + private String postalCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + public static final String JSON_PROPERTY_STATE_OR_PROVINCE = "stateOrProvince"; + private String stateOrProvince; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStateOrProvince = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public Destination() {} + + /** + * The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) or + * 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 * Min length: 2 characters * Max length: 3 characters + * + * @param countryCode The two-letter [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) or 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 * Min length: 2 characters * Max length: 3 characters + * @return the current {@code Destination} instance, allowing for method chaining + */ + public Destination countryCode(String countryCode) { + this.countryCode = countryCode; + isSetCountryCode = true; // mark as set + return this; + } + + /** + * The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) or + * 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 * Min length: 2 characters * Max length: 3 characters + * + * @return countryCode The two-letter [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) or 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 * Min length: 2 characters * Max length: 3 characters + */ + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountryCode() { + return countryCode; + } + + /** + * The two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) or + * 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 * Min length: 2 characters * Max length: 3 characters + * + * @param countryCode The two-letter [ISO 3166-1 + * alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) or 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 * Min length: 2 characters * Max length: 3 characters + */ + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + isSetCountryCode = true; // mark as set + } + + /** + * The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * + * Must not start with a space. * For the US, it must be in five or nine digits format. For + * example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B + * 1G5. + * + * @param postalCode The postal code of the destination address. * Encoding: ASCII * Max length: + * 10 characters * Must not start with a space. * For the US, it must be in five or nine + * digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits + * format. For example, M4B 1G5. + * @return the current {@code Destination} instance, allowing for method chaining + */ + public Destination postalCode(String postalCode) { + this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + return this; + } + + /** + * The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * + * Must not start with a space. * For the US, it must be in five or nine digits format. For + * example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B + * 1G5. + * + * @return postalCode The postal code of the destination address. * Encoding: ASCII * Max length: + * 10 characters * Must not start with a space. * For the US, it must be in five or nine + * digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits + * format. For example, M4B 1G5. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPostalCode() { + return postalCode; + } + + /** + * The postal code of the destination address. * Encoding: ASCII * Max length: 10 characters * + * Must not start with a space. * For the US, it must be in five or nine digits format. For + * example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B + * 1G5. + * + * @param postalCode The postal code of the destination address. * Encoding: ASCII * Max length: + * 10 characters * Must not start with a space. * For the US, it must be in five or nine + * digits format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits + * format. For example, M4B 1G5. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * The state or province code of the destination address. * Encoding: ASCII * Max length: 3 + * characters * Must not start with a space. + * + * @param stateOrProvince The state or province code of the destination address. * Encoding: ASCII + * * Max length: 3 characters * Must not start with a space. + * @return the current {@code Destination} instance, allowing for method chaining + */ + public Destination stateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + return this; + } + + /** + * The state or province code of the destination address. * Encoding: ASCII * Max length: 3 + * characters * Must not start with a space. + * + * @return stateOrProvince The state or province code of the destination address. * Encoding: + * ASCII * Max length: 3 characters * Must not start with a space. + */ + @JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStateOrProvince() { + return stateOrProvince; + } + + /** + * The state or province code of the destination address. * Encoding: ASCII * Max length: 3 + * characters * Must not start with a space. + * + * @param stateOrProvince The state or province code of the destination address. * Encoding: ASCII + * * Max length: 3 characters * Must not start with a space. + */ + @JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStateOrProvince(String stateOrProvince) { + this.stateOrProvince = stateOrProvince; + isSetStateOrProvince = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Destination includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this Destination object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Destination destination = (Destination) o; + return Objects.equals(this.countryCode, destination.countryCode) + && Objects.equals(this.isSetCountryCode, destination.isSetCountryCode) + && Objects.equals(this.postalCode, destination.postalCode) + && Objects.equals(this.isSetPostalCode, destination.isSetPostalCode) + && Objects.equals(this.stateOrProvince, destination.stateOrProvince) + && Objects.equals(this.isSetStateOrProvince, destination.isSetStateOrProvince); + } + + @Override + public int hashCode() { + return Objects.hash( + countryCode, + isSetCountryCode, + postalCode, + isSetPostalCode, + stateOrProvince, + isSetStateOrProvince); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Destination {\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" stateOrProvince: ").append(toIndentedString(stateOrProvince)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetStateOrProvince) { + addIfNull(nulls, JSON_PROPERTY_STATE_OR_PROVINCE, this.stateOrProvince); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of Destination given an JSON string + * + * @param jsonString JSON string + * @return An instance of Destination + * @throws JsonProcessingException if the JSON string is invalid with respect to Destination + */ + public static Destination fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, Destination.class); + } + + /** + * Convert an instance of Destination to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java b/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java index e584b917e..d0241d8f1 100644 --- a/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java +++ b/src/main/java/com/adyen/model/checkout/DetailsRequestAuthenticationData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class DetailsRequestAuthenticationData { public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DetailsRequestAuthenticationData() {} /** @@ -40,6 +51,7 @@ public DetailsRequestAuthenticationData() {} */ public DetailsRequestAuthenticationData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -75,6 +87,27 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DetailsRequestAuthenticationData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DetailsRequestAuthenticationData object is equal to o. */ @@ -89,12 +122,14 @@ public boolean equals(Object o) { DetailsRequestAuthenticationData detailsRequestAuthenticationData = (DetailsRequestAuthenticationData) o; return Objects.equals( - this.authenticationOnly, detailsRequestAuthenticationData.authenticationOnly); + this.authenticationOnly, detailsRequestAuthenticationData.authenticationOnly) + && Objects.equals( + this.isSetAuthenticationOnly, detailsRequestAuthenticationData.isSetAuthenticationOnly); } @Override public int hashCode() { - return Objects.hash(authenticationOnly); + return Objects.hash(authenticationOnly, isSetAuthenticationOnly); } @Override @@ -116,6 +151,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DetailsRequestAuthenticationData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java b/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java index 929db88d5..16c71885e 100644 --- a/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java +++ b/src/main/java/com/adyen/model/checkout/DeviceRenderOptions.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -75,6 +77,9 @@ public static SdkInterfaceEnum fromValue(String value) { public static final String JSON_PROPERTY_SDK_INTERFACE = "sdkInterface"; private SdkInterfaceEnum sdkInterface; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkInterface = false; + /** Gets or Sets sdkUiType */ public enum SdkUiTypeEnum { MULTISELECT(String.valueOf("multiSelect")), @@ -125,6 +130,15 @@ public static SdkUiTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_SDK_UI_TYPE = "sdkUiType"; private List sdkUiType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkUiType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DeviceRenderOptions() {} /** @@ -135,6 +149,7 @@ public DeviceRenderOptions() {} */ public DeviceRenderOptions sdkInterface(SdkInterfaceEnum sdkInterface) { this.sdkInterface = sdkInterface; + isSetSdkInterface = true; // mark as set return this; } @@ -158,6 +173,7 @@ public SdkInterfaceEnum getSdkInterface() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkInterface(SdkInterfaceEnum sdkInterface) { this.sdkInterface = sdkInterface; + isSetSdkInterface = true; // mark as set } /** @@ -170,6 +186,7 @@ public void setSdkInterface(SdkInterfaceEnum sdkInterface) { */ public DeviceRenderOptions sdkUiType(List sdkUiType) { this.sdkUiType = sdkUiType; + isSetSdkUiType = true; // mark as set return this; } @@ -205,6 +222,27 @@ public List getSdkUiType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkUiType(List sdkUiType) { this.sdkUiType = sdkUiType; + isSetSdkUiType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DeviceRenderOptions includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DeviceRenderOptions object is equal to o. */ @@ -218,12 +256,14 @@ public boolean equals(Object o) { } DeviceRenderOptions deviceRenderOptions = (DeviceRenderOptions) o; return Objects.equals(this.sdkInterface, deviceRenderOptions.sdkInterface) - && Objects.equals(this.sdkUiType, deviceRenderOptions.sdkUiType); + && Objects.equals(this.isSetSdkInterface, deviceRenderOptions.isSetSdkInterface) + && Objects.equals(this.sdkUiType, deviceRenderOptions.sdkUiType) + && Objects.equals(this.isSetSdkUiType, deviceRenderOptions.isSetSdkUiType); } @Override public int hashCode() { - return Objects.hash(sdkInterface, sdkUiType); + return Objects.hash(sdkInterface, isSetSdkInterface, sdkUiType, isSetSdkUiType); } @Override @@ -246,6 +286,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSdkInterface) { + addIfNull(nulls, JSON_PROPERTY_SDK_INTERFACE, this.sdkInterface); + } + if (isSetSdkUiType) { + addIfNull(nulls, JSON_PROPERTY_SDK_UI_TYPE, this.sdkUiType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DeviceRenderOptions given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DokuDetails.java b/src/main/java/com/adyen/model/checkout/DokuDetails.java index 1df8f345b..ad9c1a860 100644 --- a/src/main/java/com/adyen/model/checkout/DokuDetails.java +++ b/src/main/java/com/adyen/model/checkout/DokuDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,18 +36,33 @@ public class DokuDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + /** **doku** */ public enum TypeEnum { DOKU_MANDIRI_VA(String.valueOf("doku_mandiri_va")), @@ -108,6 +125,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DokuDetails() {} /** @@ -118,6 +144,7 @@ public DokuDetails() {} */ public DokuDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -141,6 +168,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -151,6 +179,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public DokuDetails firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -174,6 +203,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -184,6 +214,7 @@ public void setFirstName(String firstName) { */ public DokuDetails lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -207,6 +238,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -217,6 +249,7 @@ public void setLastName(String lastName) { */ public DokuDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -241,6 +274,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -251,6 +285,7 @@ public void setSdkData(String sdkData) { */ public DokuDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -274,6 +309,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -284,6 +320,7 @@ public void setShopperEmail(String shopperEmail) { */ public DokuDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -307,6 +344,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DokuDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DokuDetails object is equal to o. */ @@ -320,16 +378,34 @@ public boolean equals(Object o) { } DokuDetails dokuDetails = (DokuDetails) o; return Objects.equals(this.checkoutAttemptId, dokuDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, dokuDetails.isSetCheckoutAttemptId) && Objects.equals(this.firstName, dokuDetails.firstName) + && Objects.equals(this.isSetFirstName, dokuDetails.isSetFirstName) && Objects.equals(this.lastName, dokuDetails.lastName) + && Objects.equals(this.isSetLastName, dokuDetails.isSetLastName) && Objects.equals(this.sdkData, dokuDetails.sdkData) + && Objects.equals(this.isSetSdkData, dokuDetails.isSetSdkData) && Objects.equals(this.shopperEmail, dokuDetails.shopperEmail) - && Objects.equals(this.type, dokuDetails.type); + && Objects.equals(this.isSetShopperEmail, dokuDetails.isSetShopperEmail) + && Objects.equals(this.type, dokuDetails.type) + && Objects.equals(this.isSetType, dokuDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, firstName, lastName, sdkData, shopperEmail, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + firstName, + isSetFirstName, + lastName, + isSetLastName, + sdkData, + isSetSdkData, + shopperEmail, + isSetShopperEmail, + type, + isSetType); } @Override @@ -356,6 +432,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DokuDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Donation.java b/src/main/java/com/adyen/model/checkout/Donation.java index 750c3a67a..a574caf7c 100644 --- a/src/main/java/com/adyen/model/checkout/Donation.java +++ b/src/main/java/com/adyen/model/checkout/Donation.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,18 +33,39 @@ public class Donation { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_DONATION_TYPE = "donationType"; private String donationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationType = false; + public static final String JSON_PROPERTY_MAX_ROUNDUP_AMOUNT = "maxRoundupAmount"; private Long maxRoundupAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxRoundupAmount = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Donation() {} /** @@ -55,6 +78,7 @@ public Donation() {} */ public Donation currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -82,6 +106,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -99,6 +124,7 @@ public void setCurrency(String currency) { */ public Donation donationType(String donationType) { this.donationType = donationType; + isSetDonationType = true; // mark as set return this; } @@ -136,6 +162,7 @@ public String getDonationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationType(String donationType) { this.donationType = donationType; + isSetDonationType = true; // mark as set } /** @@ -148,6 +175,7 @@ public void setDonationType(String donationType) { */ public Donation maxRoundupAmount(Long maxRoundupAmount) { this.maxRoundupAmount = maxRoundupAmount; + isSetMaxRoundupAmount = true; // mark as set return this; } @@ -175,6 +203,7 @@ public Long getMaxRoundupAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxRoundupAmount(Long maxRoundupAmount) { this.maxRoundupAmount = maxRoundupAmount; + isSetMaxRoundupAmount = true; // mark as set } /** @@ -192,6 +221,7 @@ public void setMaxRoundupAmount(Long maxRoundupAmount) { */ public Donation type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -229,6 +259,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -243,6 +274,7 @@ public void setType(String type) { */ public Donation values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -282,6 +314,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Donation includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Donation object is equal to o. */ @@ -295,15 +348,30 @@ public boolean equals(Object o) { } Donation donation = (Donation) o; return Objects.equals(this.currency, donation.currency) + && Objects.equals(this.isSetCurrency, donation.isSetCurrency) && Objects.equals(this.donationType, donation.donationType) + && Objects.equals(this.isSetDonationType, donation.isSetDonationType) && Objects.equals(this.maxRoundupAmount, donation.maxRoundupAmount) + && Objects.equals(this.isSetMaxRoundupAmount, donation.isSetMaxRoundupAmount) && Objects.equals(this.type, donation.type) - && Objects.equals(this.values, donation.values); + && Objects.equals(this.isSetType, donation.isSetType) + && Objects.equals(this.values, donation.values) + && Objects.equals(this.isSetValues, donation.isSetValues); } @Override public int hashCode() { - return Objects.hash(currency, donationType, maxRoundupAmount, type, values); + return Objects.hash( + currency, + isSetCurrency, + donationType, + isSetDonationType, + maxRoundupAmount, + isSetMaxRoundupAmount, + type, + isSetType, + values, + isSetValues); } @Override @@ -329,6 +397,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetDonationType) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TYPE, this.donationType); + } + if (isSetMaxRoundupAmount) { + addIfNull(nulls, JSON_PROPERTY_MAX_ROUNDUP_AMOUNT, this.maxRoundupAmount); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Donation given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationCampaign.java b/src/main/java/com/adyen/model/checkout/DonationCampaign.java index 3d9f37a04..a49198922 100644 --- a/src/main/java/com/adyen/model/checkout/DonationCampaign.java +++ b/src/main/java/com/adyen/model/checkout/DonationCampaign.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,36 +37,75 @@ public class DonationCampaign { public static final String JSON_PROPERTY_AMOUNTS = "amounts"; private Amounts amounts; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmounts = false; + public static final String JSON_PROPERTY_BANNER_URL = "bannerUrl"; private String bannerUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBannerUrl = false; + public static final String JSON_PROPERTY_CAMPAIGN_NAME = "campaignName"; private String campaignName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCampaignName = false; + public static final String JSON_PROPERTY_CAUSE_NAME = "causeName"; private String causeName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCauseName = false; + public static final String JSON_PROPERTY_DONATION = "donation"; private Donation donation; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonation = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LOGO_URL = "logoUrl"; private String logoUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLogoUrl = false; + public static final String JSON_PROPERTY_NONPROFIT_DESCRIPTION = "nonprofitDescription"; private String nonprofitDescription; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitDescription = false; + public static final String JSON_PROPERTY_NONPROFIT_NAME = "nonprofitName"; private String nonprofitName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitName = false; + public static final String JSON_PROPERTY_NONPROFIT_URL = "nonprofitUrl"; private String nonprofitUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNonprofitUrl = false; + public static final String JSON_PROPERTY_TERMS_AND_CONDITIONS_URL = "termsAndConditionsUrl"; private String termsAndConditionsUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTermsAndConditionsUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationCampaign() {} /** @@ -75,6 +116,7 @@ public DonationCampaign() {} */ public DonationCampaign amounts(Amounts amounts) { this.amounts = amounts; + isSetAmounts = true; // mark as set return this; } @@ -98,6 +140,7 @@ public Amounts getAmounts() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmounts(Amounts amounts) { this.amounts = amounts; + isSetAmounts = true; // mark as set } /** @@ -108,6 +151,7 @@ public void setAmounts(Amounts amounts) { */ public DonationCampaign bannerUrl(String bannerUrl) { this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set return this; } @@ -131,6 +175,7 @@ public String getBannerUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBannerUrl(String bannerUrl) { this.bannerUrl = bannerUrl; + isSetBannerUrl = true; // mark as set } /** @@ -141,6 +186,7 @@ public void setBannerUrl(String bannerUrl) { */ public DonationCampaign campaignName(String campaignName) { this.campaignName = campaignName; + isSetCampaignName = true; // mark as set return this; } @@ -164,6 +210,7 @@ public String getCampaignName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCampaignName(String campaignName) { this.campaignName = campaignName; + isSetCampaignName = true; // mark as set } /** @@ -174,6 +221,7 @@ public void setCampaignName(String campaignName) { */ public DonationCampaign causeName(String causeName) { this.causeName = causeName; + isSetCauseName = true; // mark as set return this; } @@ -197,6 +245,7 @@ public String getCauseName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCauseName(String causeName) { this.causeName = causeName; + isSetCauseName = true; // mark as set } /** @@ -207,6 +256,7 @@ public void setCauseName(String causeName) { */ public DonationCampaign donation(Donation donation) { this.donation = donation; + isSetDonation = true; // mark as set return this; } @@ -230,6 +280,7 @@ public Donation getDonation() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonation(Donation donation) { this.donation = donation; + isSetDonation = true; // mark as set } /** @@ -240,6 +291,7 @@ public void setDonation(Donation donation) { */ public DonationCampaign id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -263,6 +315,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -273,6 +326,7 @@ public void setId(String id) { */ public DonationCampaign logoUrl(String logoUrl) { this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set return this; } @@ -296,6 +350,7 @@ public String getLogoUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; + isSetLogoUrl = true; // mark as set } /** @@ -306,6 +361,7 @@ public void setLogoUrl(String logoUrl) { */ public DonationCampaign nonprofitDescription(String nonprofitDescription) { this.nonprofitDescription = nonprofitDescription; + isSetNonprofitDescription = true; // mark as set return this; } @@ -329,6 +385,7 @@ public String getNonprofitDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNonprofitDescription(String nonprofitDescription) { this.nonprofitDescription = nonprofitDescription; + isSetNonprofitDescription = true; // mark as set } /** @@ -339,6 +396,7 @@ public void setNonprofitDescription(String nonprofitDescription) { */ public DonationCampaign nonprofitName(String nonprofitName) { this.nonprofitName = nonprofitName; + isSetNonprofitName = true; // mark as set return this; } @@ -362,6 +420,7 @@ public String getNonprofitName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNonprofitName(String nonprofitName) { this.nonprofitName = nonprofitName; + isSetNonprofitName = true; // mark as set } /** @@ -372,6 +431,7 @@ public void setNonprofitName(String nonprofitName) { */ public DonationCampaign nonprofitUrl(String nonprofitUrl) { this.nonprofitUrl = nonprofitUrl; + isSetNonprofitUrl = true; // mark as set return this; } @@ -395,6 +455,7 @@ public String getNonprofitUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNonprofitUrl(String nonprofitUrl) { this.nonprofitUrl = nonprofitUrl; + isSetNonprofitUrl = true; // mark as set } /** @@ -406,6 +467,7 @@ public void setNonprofitUrl(String nonprofitUrl) { */ public DonationCampaign termsAndConditionsUrl(String termsAndConditionsUrl) { this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set return this; } @@ -431,6 +493,27 @@ public String getTermsAndConditionsUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTermsAndConditionsUrl(String termsAndConditionsUrl) { this.termsAndConditionsUrl = termsAndConditionsUrl; + isSetTermsAndConditionsUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaign includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DonationCampaign object is equal to o. */ @@ -444,32 +527,56 @@ public boolean equals(Object o) { } DonationCampaign donationCampaign = (DonationCampaign) o; return Objects.equals(this.amounts, donationCampaign.amounts) + && Objects.equals(this.isSetAmounts, donationCampaign.isSetAmounts) && Objects.equals(this.bannerUrl, donationCampaign.bannerUrl) + && Objects.equals(this.isSetBannerUrl, donationCampaign.isSetBannerUrl) && Objects.equals(this.campaignName, donationCampaign.campaignName) + && Objects.equals(this.isSetCampaignName, donationCampaign.isSetCampaignName) && Objects.equals(this.causeName, donationCampaign.causeName) + && Objects.equals(this.isSetCauseName, donationCampaign.isSetCauseName) && Objects.equals(this.donation, donationCampaign.donation) + && Objects.equals(this.isSetDonation, donationCampaign.isSetDonation) && Objects.equals(this.id, donationCampaign.id) + && Objects.equals(this.isSetId, donationCampaign.isSetId) && Objects.equals(this.logoUrl, donationCampaign.logoUrl) + && Objects.equals(this.isSetLogoUrl, donationCampaign.isSetLogoUrl) && Objects.equals(this.nonprofitDescription, donationCampaign.nonprofitDescription) + && Objects.equals( + this.isSetNonprofitDescription, donationCampaign.isSetNonprofitDescription) && Objects.equals(this.nonprofitName, donationCampaign.nonprofitName) + && Objects.equals(this.isSetNonprofitName, donationCampaign.isSetNonprofitName) && Objects.equals(this.nonprofitUrl, donationCampaign.nonprofitUrl) - && Objects.equals(this.termsAndConditionsUrl, donationCampaign.termsAndConditionsUrl); + && Objects.equals(this.isSetNonprofitUrl, donationCampaign.isSetNonprofitUrl) + && Objects.equals(this.termsAndConditionsUrl, donationCampaign.termsAndConditionsUrl) + && Objects.equals( + this.isSetTermsAndConditionsUrl, donationCampaign.isSetTermsAndConditionsUrl); } @Override public int hashCode() { return Objects.hash( amounts, + isSetAmounts, bannerUrl, + isSetBannerUrl, campaignName, + isSetCampaignName, causeName, + isSetCauseName, donation, + isSetDonation, id, + isSetId, logoUrl, + isSetLogoUrl, nonprofitDescription, + isSetNonprofitDescription, nonprofitName, + isSetNonprofitName, nonprofitUrl, - termsAndConditionsUrl); + isSetNonprofitUrl, + termsAndConditionsUrl, + isSetTermsAndConditionsUrl); } @Override @@ -505,6 +612,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmounts) { + addIfNull(nulls, JSON_PROPERTY_AMOUNTS, this.amounts); + } + if (isSetBannerUrl) { + addIfNull(nulls, JSON_PROPERTY_BANNER_URL, this.bannerUrl); + } + if (isSetCampaignName) { + addIfNull(nulls, JSON_PROPERTY_CAMPAIGN_NAME, this.campaignName); + } + if (isSetCauseName) { + addIfNull(nulls, JSON_PROPERTY_CAUSE_NAME, this.causeName); + } + if (isSetDonation) { + addIfNull(nulls, JSON_PROPERTY_DONATION, this.donation); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLogoUrl) { + addIfNull(nulls, JSON_PROPERTY_LOGO_URL, this.logoUrl); + } + if (isSetNonprofitDescription) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_DESCRIPTION, this.nonprofitDescription); + } + if (isSetNonprofitName) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_NAME, this.nonprofitName); + } + if (isSetNonprofitUrl) { + addIfNull(nulls, JSON_PROPERTY_NONPROFIT_URL, this.nonprofitUrl); + } + if (isSetTermsAndConditionsUrl) { + addIfNull(nulls, JSON_PROPERTY_TERMS_AND_CONDITIONS_URL, this.termsAndConditionsUrl); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DonationCampaign given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java b/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java index 001265b8d..ac638893a 100644 --- a/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java +++ b/src/main/java/com/adyen/model/checkout/DonationCampaignsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class DonationCampaignsRequest { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_LOCALE = "locale"; private String locale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocale = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationCampaignsRequest() {} /** @@ -45,6 +62,7 @@ public DonationCampaignsRequest() {} */ public DonationCampaignsRequest currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -72,6 +90,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setCurrency(String currency) { */ public DonationCampaignsRequest locale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setLocale(String locale) { */ public DonationCampaignsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignsRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DonationCampaignsRequest object is equal to o. */ @@ -151,13 +194,17 @@ public boolean equals(Object o) { } DonationCampaignsRequest donationCampaignsRequest = (DonationCampaignsRequest) o; return Objects.equals(this.currency, donationCampaignsRequest.currency) + && Objects.equals(this.isSetCurrency, donationCampaignsRequest.isSetCurrency) && Objects.equals(this.locale, donationCampaignsRequest.locale) - && Objects.equals(this.merchantAccount, donationCampaignsRequest.merchantAccount); + && Objects.equals(this.isSetLocale, donationCampaignsRequest.isSetLocale) + && Objects.equals(this.merchantAccount, donationCampaignsRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, donationCampaignsRequest.isSetMerchantAccount); } @Override public int hashCode() { - return Objects.hash(currency, locale, merchantAccount); + return Objects.hash( + currency, isSetCurrency, locale, isSetLocale, merchantAccount, isSetMerchantAccount); } @Override @@ -181,6 +228,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetLocale) { + addIfNull(nulls, JSON_PROPERTY_LOCALE, this.locale); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DonationCampaignsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java b/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java index 0bb1ff92c..d4a60af93 100644 --- a/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java +++ b/src/main/java/com/adyen/model/checkout/DonationCampaignsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class DonationCampaignsResponse { public static final String JSON_PROPERTY_DONATION_CAMPAIGNS = "donationCampaigns"; private List donationCampaigns; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationCampaigns = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationCampaignsResponse() {} /** @@ -35,6 +46,7 @@ public DonationCampaignsResponse() {} */ public DonationCampaignsResponse donationCampaigns(List donationCampaigns) { this.donationCampaigns = donationCampaigns; + isSetDonationCampaigns = true; // mark as set return this; } @@ -67,6 +79,27 @@ public List getDonationCampaigns() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationCampaigns(List donationCampaigns) { this.donationCampaigns = donationCampaigns; + isSetDonationCampaigns = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationCampaignsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DonationCampaignsResponse object is equal to o. */ @@ -79,12 +112,14 @@ public boolean equals(Object o) { return false; } DonationCampaignsResponse donationCampaignsResponse = (DonationCampaignsResponse) o; - return Objects.equals(this.donationCampaigns, donationCampaignsResponse.donationCampaigns); + return Objects.equals(this.donationCampaigns, donationCampaignsResponse.donationCampaigns) + && Objects.equals( + this.isSetDonationCampaigns, donationCampaignsResponse.isSetDonationCampaigns); } @Override public int hashCode() { - return Objects.hash(donationCampaigns); + return Objects.hash(donationCampaigns, isSetDonationCampaigns); } @Override @@ -106,6 +141,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDonationCampaigns) { + addIfNull(nulls, JSON_PROPERTY_DONATION_CAMPAIGNS, this.donationCampaigns); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DonationCampaignsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java b/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java index f07b2d810..f567b1b30 100644 --- a/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/DonationPaymentRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -75,24 +77,45 @@ public class DonationPaymentRequest { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -144,62 +167,119 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CONVERSION_ID = "conversionId"; @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead private String conversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConversionId = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private OffsetDateTime dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + public static final String JSON_PROPERTY_DONATION_ACCOUNT = "donationAccount"; private String donationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationAccount = false; + public static final String JSON_PROPERTY_DONATION_CAMPAIGN_ID = "donationCampaignId"; private String donationCampaignId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationCampaignId = false; + public static final String JSON_PROPERTY_DONATION_ORIGINAL_PSP_REFERENCE = "donationOriginalPspReference"; private String donationOriginalPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationOriginalPspReference = false; + public static final String JSON_PROPERTY_DONATION_TOKEN = "donationToken"; private String donationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationToken = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_RISK_INDICATOR = "merchantRiskIndicator"; private MerchantRiskIndicator merchantRiskIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRiskIndicator = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORIGIN = "origin"; private String origin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrigin = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private DonationPaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details or * using stored payment details. Allowed values: * `Subscription` – A transaction for a @@ -257,27 +337,51 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_SESSION_VALIDITY = "sessionValidity"; private String sessionValidity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionValidity = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -338,30 +442,60 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private ShopperName shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private ThreeDS2RequestFields threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationPaymentRequest() {} /** @@ -372,6 +506,7 @@ public DonationPaymentRequest() {} */ public DonationPaymentRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -395,6 +530,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -409,6 +545,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public DonationPaymentRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -448,6 +585,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -458,6 +596,7 @@ public void setAdditionalData(Map additionalData) { */ public DonationPaymentRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -481,6 +620,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -491,6 +631,7 @@ public void setAmount(Amount amount) { */ public DonationPaymentRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -514,6 +655,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -524,6 +666,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public DonationPaymentRequest authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -547,6 +690,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -557,6 +701,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public DonationPaymentRequest billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -580,6 +725,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -590,6 +736,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public DonationPaymentRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -613,6 +760,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -629,6 +777,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public DonationPaymentRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -664,6 +813,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -676,6 +826,7 @@ public void setChannel(ChannelEnum channel) { */ public DonationPaymentRequest checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -703,6 +854,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -717,6 +869,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead public DonationPaymentRequest conversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set return this; } @@ -748,6 +901,7 @@ public String getConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set } /** @@ -760,6 +914,7 @@ public void setConversionId(String conversionId) { */ public DonationPaymentRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -787,6 +942,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -799,6 +955,7 @@ public void setCountryCode(String countryCode) { */ public DonationPaymentRequest dateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -826,6 +983,7 @@ public OffsetDateTime getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -840,6 +998,7 @@ public void setDateOfBirth(OffsetDateTime dateOfBirth) { */ public DonationPaymentRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -871,6 +1030,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -881,6 +1041,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public DonationPaymentRequest deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -904,6 +1065,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -917,6 +1079,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { */ public DonationPaymentRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -946,6 +1109,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -956,6 +1120,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public DonationPaymentRequest donationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set return this; } @@ -979,6 +1144,7 @@ public String getDonationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set } /** @@ -990,6 +1156,7 @@ public void setDonationAccount(String donationAccount) { */ public DonationPaymentRequest donationCampaignId(String donationCampaignId) { this.donationCampaignId = donationCampaignId; + isSetDonationCampaignId = true; // mark as set return this; } @@ -1015,6 +1182,7 @@ public String getDonationCampaignId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationCampaignId(String donationCampaignId) { this.donationCampaignId = donationCampaignId; + isSetDonationCampaignId = true; // mark as set } /** @@ -1027,6 +1195,7 @@ public void setDonationCampaignId(String donationCampaignId) { */ public DonationPaymentRequest donationOriginalPspReference(String donationOriginalPspReference) { this.donationOriginalPspReference = donationOriginalPspReference; + isSetDonationOriginalPspReference = true; // mark as set return this; } @@ -1054,6 +1223,7 @@ public String getDonationOriginalPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationOriginalPspReference(String donationOriginalPspReference) { this.donationOriginalPspReference = donationOriginalPspReference; + isSetDonationOriginalPspReference = true; // mark as set } /** @@ -1064,6 +1234,7 @@ public void setDonationOriginalPspReference(String donationOriginalPspReference) */ public DonationPaymentRequest donationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set return this; } @@ -1087,6 +1258,7 @@ public String getDonationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set } /** @@ -1101,6 +1273,7 @@ public void setDonationToken(String donationToken) { */ public DonationPaymentRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1140,6 +1313,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1151,6 +1325,7 @@ public void setLineItems(List lineItems) { */ public DonationPaymentRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1176,6 +1351,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1186,6 +1362,7 @@ public void setMerchantAccount(String merchantAccount) { */ public DonationPaymentRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -1209,6 +1386,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -1225,6 +1403,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public DonationPaymentRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1268,6 +1447,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1278,6 +1458,7 @@ public void setMetadata(Map metadata) { */ public DonationPaymentRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -1301,6 +1482,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -1315,6 +1497,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public DonationPaymentRequest origin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set return this; } @@ -1346,6 +1529,7 @@ public String getOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrigin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set } /** @@ -1356,6 +1540,7 @@ public void setOrigin(String origin) { */ public DonationPaymentRequest paymentMethod(DonationPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -1379,6 +1564,7 @@ public DonationPaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(DonationPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -1407,6 +1593,7 @@ public void setPaymentMethod(DonationPaymentMethod paymentMethod) { public DonationPaymentRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1464,6 +1651,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1475,6 +1663,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public DonationPaymentRequest redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -1500,6 +1689,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -1511,6 +1701,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public DonationPaymentRequest redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -1536,6 +1727,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -1552,6 +1744,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public DonationPaymentRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1587,6 +1780,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1624,6 +1818,7 @@ public void setReference(String reference) { */ public DonationPaymentRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -1701,6 +1896,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -1714,6 +1910,7 @@ public void setReturnUrl(String returnUrl) { */ public DonationPaymentRequest sessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set return this; } @@ -1743,6 +1940,7 @@ public String getSessionValidity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set } /** @@ -1757,6 +1955,7 @@ public void setSessionValidity(String sessionValidity) { */ public DonationPaymentRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1788,6 +1987,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1811,6 +2011,7 @@ public void setShopperEmail(String shopperEmail) { */ public DonationPaymentRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -1860,6 +2061,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -1891,6 +2093,7 @@ public void setShopperIP(String shopperIP) { */ public DonationPaymentRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -1956,6 +2159,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -1968,6 +2172,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public DonationPaymentRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1995,6 +2200,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -2005,6 +2211,7 @@ public void setShopperLocale(String shopperLocale) { */ public DonationPaymentRequest shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -2028,6 +2235,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -2043,6 +2251,7 @@ public void setShopperName(ShopperName shopperName) { */ public DonationPaymentRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2076,6 +2285,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2086,6 +2296,7 @@ public void setShopperReference(String shopperReference) { */ public DonationPaymentRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -2109,6 +2320,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -2127,6 +2339,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public DonationPaymentRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2166,6 +2379,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2176,6 +2390,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public DonationPaymentRequest threeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2199,6 +2414,7 @@ public ThreeDS2RequestFields getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2219,6 +2435,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { // `authenticationData.authenticationOnly` instead. public DonationPaymentRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -2262,6 +2479,27 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationPaymentRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DonationPaymentRequest object is equal to o. */ @@ -2275,99 +2513,200 @@ public boolean equals(Object o) { } DonationPaymentRequest donationPaymentRequest = (DonationPaymentRequest) o; return Objects.equals(this.accountInfo, donationPaymentRequest.accountInfo) + && Objects.equals(this.isSetAccountInfo, donationPaymentRequest.isSetAccountInfo) && Objects.equals(this.additionalData, donationPaymentRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, donationPaymentRequest.isSetAdditionalData) && Objects.equals(this.amount, donationPaymentRequest.amount) + && Objects.equals(this.isSetAmount, donationPaymentRequest.isSetAmount) && Objects.equals(this.applicationInfo, donationPaymentRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, donationPaymentRequest.isSetApplicationInfo) && Objects.equals(this.authenticationData, donationPaymentRequest.authenticationData) + && Objects.equals( + this.isSetAuthenticationData, donationPaymentRequest.isSetAuthenticationData) && Objects.equals(this.billingAddress, donationPaymentRequest.billingAddress) + && Objects.equals(this.isSetBillingAddress, donationPaymentRequest.isSetBillingAddress) && Objects.equals(this.browserInfo, donationPaymentRequest.browserInfo) + && Objects.equals(this.isSetBrowserInfo, donationPaymentRequest.isSetBrowserInfo) && Objects.equals(this.channel, donationPaymentRequest.channel) + && Objects.equals(this.isSetChannel, donationPaymentRequest.isSetChannel) && Objects.equals(this.checkoutAttemptId, donationPaymentRequest.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, donationPaymentRequest.isSetCheckoutAttemptId) && Objects.equals(this.conversionId, donationPaymentRequest.conversionId) + && Objects.equals(this.isSetConversionId, donationPaymentRequest.isSetConversionId) && Objects.equals(this.countryCode, donationPaymentRequest.countryCode) + && Objects.equals(this.isSetCountryCode, donationPaymentRequest.isSetCountryCode) && Objects.equals(this.dateOfBirth, donationPaymentRequest.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, donationPaymentRequest.isSetDateOfBirth) && Objects.equals(this.deliverAt, donationPaymentRequest.deliverAt) + && Objects.equals(this.isSetDeliverAt, donationPaymentRequest.isSetDeliverAt) && Objects.equals(this.deliveryAddress, donationPaymentRequest.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, donationPaymentRequest.isSetDeliveryAddress) && Objects.equals(this.deviceFingerprint, donationPaymentRequest.deviceFingerprint) + && Objects.equals( + this.isSetDeviceFingerprint, donationPaymentRequest.isSetDeviceFingerprint) && Objects.equals(this.donationAccount, donationPaymentRequest.donationAccount) + && Objects.equals(this.isSetDonationAccount, donationPaymentRequest.isSetDonationAccount) && Objects.equals(this.donationCampaignId, donationPaymentRequest.donationCampaignId) + && Objects.equals( + this.isSetDonationCampaignId, donationPaymentRequest.isSetDonationCampaignId) && Objects.equals( this.donationOriginalPspReference, donationPaymentRequest.donationOriginalPspReference) + && Objects.equals( + this.isSetDonationOriginalPspReference, + donationPaymentRequest.isSetDonationOriginalPspReference) && Objects.equals(this.donationToken, donationPaymentRequest.donationToken) + && Objects.equals(this.isSetDonationToken, donationPaymentRequest.isSetDonationToken) && Objects.equals(this.lineItems, donationPaymentRequest.lineItems) + && Objects.equals(this.isSetLineItems, donationPaymentRequest.isSetLineItems) && Objects.equals(this.merchantAccount, donationPaymentRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, donationPaymentRequest.isSetMerchantAccount) && Objects.equals(this.merchantRiskIndicator, donationPaymentRequest.merchantRiskIndicator) + && Objects.equals( + this.isSetMerchantRiskIndicator, donationPaymentRequest.isSetMerchantRiskIndicator) && Objects.equals(this.metadata, donationPaymentRequest.metadata) + && Objects.equals(this.isSetMetadata, donationPaymentRequest.isSetMetadata) && Objects.equals(this.mpiData, donationPaymentRequest.mpiData) + && Objects.equals(this.isSetMpiData, donationPaymentRequest.isSetMpiData) && Objects.equals(this.origin, donationPaymentRequest.origin) + && Objects.equals(this.isSetOrigin, donationPaymentRequest.isSetOrigin) && Objects.equals(this.paymentMethod, donationPaymentRequest.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, donationPaymentRequest.isSetPaymentMethod) && Objects.equals( this.recurringProcessingModel, donationPaymentRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, + donationPaymentRequest.isSetRecurringProcessingModel) && Objects.equals( this.redirectFromIssuerMethod, donationPaymentRequest.redirectFromIssuerMethod) + && Objects.equals( + this.isSetRedirectFromIssuerMethod, + donationPaymentRequest.isSetRedirectFromIssuerMethod) && Objects.equals( this.redirectToIssuerMethod, donationPaymentRequest.redirectToIssuerMethod) + && Objects.equals( + this.isSetRedirectToIssuerMethod, donationPaymentRequest.isSetRedirectToIssuerMethod) && Objects.equals(this.reference, donationPaymentRequest.reference) + && Objects.equals(this.isSetReference, donationPaymentRequest.isSetReference) && Objects.equals(this.returnUrl, donationPaymentRequest.returnUrl) + && Objects.equals(this.isSetReturnUrl, donationPaymentRequest.isSetReturnUrl) && Objects.equals(this.sessionValidity, donationPaymentRequest.sessionValidity) + && Objects.equals(this.isSetSessionValidity, donationPaymentRequest.isSetSessionValidity) && Objects.equals(this.shopperEmail, donationPaymentRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, donationPaymentRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, donationPaymentRequest.shopperIP) + && Objects.equals(this.isSetShopperIP, donationPaymentRequest.isSetShopperIP) && Objects.equals(this.shopperInteraction, donationPaymentRequest.shopperInteraction) + && Objects.equals( + this.isSetShopperInteraction, donationPaymentRequest.isSetShopperInteraction) && Objects.equals(this.shopperLocale, donationPaymentRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, donationPaymentRequest.isSetShopperLocale) && Objects.equals(this.shopperName, donationPaymentRequest.shopperName) + && Objects.equals(this.isSetShopperName, donationPaymentRequest.isSetShopperName) && Objects.equals(this.shopperReference, donationPaymentRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, donationPaymentRequest.isSetShopperReference) && Objects.equals(this.socialSecurityNumber, donationPaymentRequest.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, donationPaymentRequest.isSetSocialSecurityNumber) && Objects.equals(this.telephoneNumber, donationPaymentRequest.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, donationPaymentRequest.isSetTelephoneNumber) && Objects.equals(this.threeDS2RequestData, donationPaymentRequest.threeDS2RequestData) && Objects.equals( - this.threeDSAuthenticationOnly, donationPaymentRequest.threeDSAuthenticationOnly); + this.isSetThreeDS2RequestData, donationPaymentRequest.isSetThreeDS2RequestData) + && Objects.equals( + this.threeDSAuthenticationOnly, donationPaymentRequest.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, + donationPaymentRequest.isSetThreeDSAuthenticationOnly); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalData, + isSetAdditionalData, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, authenticationData, + isSetAuthenticationData, billingAddress, + isSetBillingAddress, browserInfo, + isSetBrowserInfo, channel, + isSetChannel, checkoutAttemptId, + isSetCheckoutAttemptId, conversionId, + isSetConversionId, countryCode, + isSetCountryCode, dateOfBirth, + isSetDateOfBirth, deliverAt, + isSetDeliverAt, deliveryAddress, + isSetDeliveryAddress, deviceFingerprint, + isSetDeviceFingerprint, donationAccount, + isSetDonationAccount, donationCampaignId, + isSetDonationCampaignId, donationOriginalPspReference, + isSetDonationOriginalPspReference, donationToken, + isSetDonationToken, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, merchantRiskIndicator, + isSetMerchantRiskIndicator, metadata, + isSetMetadata, mpiData, + isSetMpiData, origin, + isSetOrigin, paymentMethod, + isSetPaymentMethod, recurringProcessingModel, + isSetRecurringProcessingModel, redirectFromIssuerMethod, + isSetRedirectFromIssuerMethod, redirectToIssuerMethod, + isSetRedirectToIssuerMethod, reference, + isSetReference, returnUrl, + isSetReturnUrl, sessionValidity, + isSetSessionValidity, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, socialSecurityNumber, + isSetSocialSecurityNumber, telephoneNumber, + isSetTelephoneNumber, threeDS2RequestData, - threeDSAuthenticationOnly); + isSetThreeDS2RequestData, + threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly); } @Override @@ -2446,6 +2785,154 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetConversionId) { + addIfNull(nulls, JSON_PROPERTY_CONVERSION_ID, this.conversionId); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetDonationAccount) { + addIfNull(nulls, JSON_PROPERTY_DONATION_ACCOUNT, this.donationAccount); + } + if (isSetDonationCampaignId) { + addIfNull(nulls, JSON_PROPERTY_DONATION_CAMPAIGN_ID, this.donationCampaignId); + } + if (isSetDonationOriginalPspReference) { + addIfNull( + nulls, JSON_PROPERTY_DONATION_ORIGINAL_PSP_REFERENCE, this.donationOriginalPspReference); + } + if (isSetDonationToken) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TOKEN, this.donationToken); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantRiskIndicator) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_RISK_INDICATOR, this.merchantRiskIndicator); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOrigin) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN, this.origin); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetSessionValidity) { + addIfNull(nulls, JSON_PROPERTY_SESSION_VALIDITY, this.sessionValidity); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DonationPaymentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java b/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java index 880346c4f..6c4cd4c26 100644 --- a/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java +++ b/src/main/java/com/adyen/model/checkout/DonationPaymentResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +37,39 @@ public class DonationPaymentResponse { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_DONATION_ACCOUNT = "donationAccount"; private String donationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationAccount = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT = "payment"; private PaymentResponse payment; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayment = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the donation transaction. Possible values: * **completed** * **pending** * * **refused** @@ -99,6 +119,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DonationPaymentResponse() {} /** @@ -109,6 +138,7 @@ public DonationPaymentResponse() {} */ public DonationPaymentResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -132,6 +162,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -146,6 +177,7 @@ public void setAmount(Amount amount) { */ public DonationPaymentResponse donationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set return this; } @@ -177,6 +209,7 @@ public String getDonationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationAccount(String donationAccount) { this.donationAccount = donationAccount; + isSetDonationAccount = true; // mark as set } /** @@ -187,6 +220,7 @@ public void setDonationAccount(String donationAccount) { */ public DonationPaymentResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -210,6 +244,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -221,6 +256,7 @@ public void setId(String id) { */ public DonationPaymentResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -246,6 +282,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -256,6 +293,7 @@ public void setMerchantAccount(String merchantAccount) { */ public DonationPaymentResponse payment(PaymentResponse payment) { this.payment = payment; + isSetPayment = true; // mark as set return this; } @@ -279,6 +317,7 @@ public PaymentResponse getPayment() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayment(PaymentResponse payment) { this.payment = payment; + isSetPayment = true; // mark as set } /** @@ -295,6 +334,7 @@ public void setPayment(PaymentResponse payment) { */ public DonationPaymentResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -330,6 +370,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -342,6 +383,7 @@ public void setReference(String reference) { */ public DonationPaymentResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -369,6 +411,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DonationPaymentResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DonationPaymentResponse object is equal to o. */ @@ -382,17 +445,38 @@ public boolean equals(Object o) { } DonationPaymentResponse donationPaymentResponse = (DonationPaymentResponse) o; return Objects.equals(this.amount, donationPaymentResponse.amount) + && Objects.equals(this.isSetAmount, donationPaymentResponse.isSetAmount) && Objects.equals(this.donationAccount, donationPaymentResponse.donationAccount) + && Objects.equals(this.isSetDonationAccount, donationPaymentResponse.isSetDonationAccount) && Objects.equals(this.id, donationPaymentResponse.id) + && Objects.equals(this.isSetId, donationPaymentResponse.isSetId) && Objects.equals(this.merchantAccount, donationPaymentResponse.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, donationPaymentResponse.isSetMerchantAccount) && Objects.equals(this.payment, donationPaymentResponse.payment) + && Objects.equals(this.isSetPayment, donationPaymentResponse.isSetPayment) && Objects.equals(this.reference, donationPaymentResponse.reference) - && Objects.equals(this.status, donationPaymentResponse.status); + && Objects.equals(this.isSetReference, donationPaymentResponse.isSetReference) + && Objects.equals(this.status, donationPaymentResponse.status) + && Objects.equals(this.isSetStatus, donationPaymentResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(amount, donationAccount, id, merchantAccount, payment, reference, status); + return Objects.hash( + amount, + isSetAmount, + donationAccount, + isSetDonationAccount, + id, + isSetId, + merchantAccount, + isSetMerchantAccount, + payment, + isSetPayment, + reference, + isSetReference, + status, + isSetStatus); } @Override @@ -420,6 +504,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDonationAccount) { + addIfNull(nulls, JSON_PROPERTY_DONATION_ACCOUNT, this.donationAccount); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPayment) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT, this.payment); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DonationPaymentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/DragonpayDetails.java b/src/main/java/com/adyen/model/checkout/DragonpayDetails.java index b03bc32fc..a6176c182 100644 --- a/src/main/java/com/adyen/model/checkout/DragonpayDetails.java +++ b/src/main/java/com/adyen/model/checkout/DragonpayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class DragonpayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + /** **dragonpay** */ public enum TypeEnum { DRAGONPAY_EBANKING(String.valueOf("dragonpay_ebanking")), @@ -90,6 +104,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public DragonpayDetails() {} /** @@ -100,6 +123,7 @@ public DragonpayDetails() {} */ public DragonpayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -123,6 +147,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -135,6 +160,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public DragonpayDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -162,6 +188,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -172,6 +199,7 @@ public void setIssuer(String issuer) { */ public DragonpayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -196,6 +224,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -206,6 +235,7 @@ public void setSdkData(String sdkData) { */ public DragonpayDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -229,6 +259,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -239,6 +270,7 @@ public void setShopperEmail(String shopperEmail) { */ public DragonpayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -262,6 +294,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DragonpayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this DragonpayDetails object is equal to o. */ @@ -275,15 +328,30 @@ public boolean equals(Object o) { } DragonpayDetails dragonpayDetails = (DragonpayDetails) o; return Objects.equals(this.checkoutAttemptId, dragonpayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, dragonpayDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, dragonpayDetails.issuer) + && Objects.equals(this.isSetIssuer, dragonpayDetails.isSetIssuer) && Objects.equals(this.sdkData, dragonpayDetails.sdkData) + && Objects.equals(this.isSetSdkData, dragonpayDetails.isSetSdkData) && Objects.equals(this.shopperEmail, dragonpayDetails.shopperEmail) - && Objects.equals(this.type, dragonpayDetails.type); + && Objects.equals(this.isSetShopperEmail, dragonpayDetails.isSetShopperEmail) + && Objects.equals(this.type, dragonpayDetails.type) + && Objects.equals(this.isSetType, dragonpayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, issuer, sdkData, shopperEmail, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + sdkData, + isSetSdkData, + shopperEmail, + isSetShopperEmail, + type, + isSetType); } @Override @@ -309,6 +377,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of DragonpayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java b/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java index e239df293..6fc00907d 100644 --- a/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java +++ b/src/main/java/com/adyen/model/checkout/EBankingFinlandDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class EBankingFinlandDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **ebanking_FI** */ public enum TypeEnum { EBANKING_FI(String.valueOf("ebanking_FI")); @@ -80,6 +91,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EBankingFinlandDetails() {} /** @@ -90,6 +110,7 @@ public EBankingFinlandDetails() {} */ public EBankingFinlandDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public EBankingFinlandDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setIssuer(String issuer) { */ public EBankingFinlandDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -180,6 +205,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setSdkData(String sdkData) { */ public EBankingFinlandDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -213,6 +240,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EBankingFinlandDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EBankingFinlandDetails object is equal to o. */ @@ -226,14 +274,27 @@ public boolean equals(Object o) { } EBankingFinlandDetails ebankingFinlandDetails = (EBankingFinlandDetails) o; return Objects.equals(this.checkoutAttemptId, ebankingFinlandDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, ebankingFinlandDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, ebankingFinlandDetails.issuer) + && Objects.equals(this.isSetIssuer, ebankingFinlandDetails.isSetIssuer) && Objects.equals(this.sdkData, ebankingFinlandDetails.sdkData) - && Objects.equals(this.type, ebankingFinlandDetails.type); + && Objects.equals(this.isSetSdkData, ebankingFinlandDetails.isSetSdkData) + && Objects.equals(this.type, ebankingFinlandDetails.type) + && Objects.equals(this.isSetType, ebankingFinlandDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, issuer, sdkData, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -258,6 +319,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EBankingFinlandDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java b/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java index eb8856400..55155b925 100644 --- a/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java +++ b/src/main/java/com/adyen/model/checkout/EcontextVoucherDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +37,39 @@ public class EcontextVoucherDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + /** **econtextvoucher** */ public enum TypeEnum { ECONTEXT_SEVEN_ELEVEN(String.valueOf("econtext_seven_eleven")), @@ -100,6 +120,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EcontextVoucherDetails() {} /** @@ -110,6 +139,7 @@ public EcontextVoucherDetails() {} */ public EcontextVoucherDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -133,6 +163,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -143,6 +174,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public EcontextVoucherDetails firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -166,6 +198,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -176,6 +209,7 @@ public void setFirstName(String firstName) { */ public EcontextVoucherDetails lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -199,6 +233,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -209,6 +244,7 @@ public void setLastName(String lastName) { */ public EcontextVoucherDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -233,6 +269,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -243,6 +280,7 @@ public void setSdkData(String sdkData) { */ public EcontextVoucherDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -266,6 +304,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -280,6 +319,7 @@ public void setShopperEmail(String shopperEmail) { */ public EcontextVoucherDetails telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -311,6 +351,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -321,6 +362,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public EcontextVoucherDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -344,6 +386,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EcontextVoucherDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EcontextVoucherDetails object is equal to o. */ @@ -357,18 +420,39 @@ public boolean equals(Object o) { } EcontextVoucherDetails econtextVoucherDetails = (EcontextVoucherDetails) o; return Objects.equals(this.checkoutAttemptId, econtextVoucherDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, econtextVoucherDetails.isSetCheckoutAttemptId) && Objects.equals(this.firstName, econtextVoucherDetails.firstName) + && Objects.equals(this.isSetFirstName, econtextVoucherDetails.isSetFirstName) && Objects.equals(this.lastName, econtextVoucherDetails.lastName) + && Objects.equals(this.isSetLastName, econtextVoucherDetails.isSetLastName) && Objects.equals(this.sdkData, econtextVoucherDetails.sdkData) + && Objects.equals(this.isSetSdkData, econtextVoucherDetails.isSetSdkData) && Objects.equals(this.shopperEmail, econtextVoucherDetails.shopperEmail) + && Objects.equals(this.isSetShopperEmail, econtextVoucherDetails.isSetShopperEmail) && Objects.equals(this.telephoneNumber, econtextVoucherDetails.telephoneNumber) - && Objects.equals(this.type, econtextVoucherDetails.type); + && Objects.equals(this.isSetTelephoneNumber, econtextVoucherDetails.isSetTelephoneNumber) + && Objects.equals(this.type, econtextVoucherDetails.type) + && Objects.equals(this.isSetType, econtextVoucherDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, firstName, lastName, sdkData, shopperEmail, telephoneNumber, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + firstName, + isSetFirstName, + lastName, + isSetLastName, + sdkData, + isSetSdkData, + shopperEmail, + isSetShopperEmail, + telephoneNumber, + isSetTelephoneNumber, + type, + isSetType); } @Override @@ -396,6 +480,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EcontextVoucherDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EftDetails.java b/src/main/java/com/adyen/model/checkout/EftDetails.java index 388ec456b..531accb23 100644 --- a/src/main/java/com/adyen/model/checkout/EftDetails.java +++ b/src/main/java/com/adyen/model/checkout/EftDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,28 +39,52 @@ public class EftDetails { public static final String JSON_PROPERTY_BANK_ACCOUNT_NUMBER = "bankAccountNumber"; private String bankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountNumber = false; + public static final String JSON_PROPERTY_BANK_CODE = "bankCode"; private String bankCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankCode = false; + public static final String JSON_PROPERTY_BANK_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **eft** */ public enum TypeEnum { EFT_DIRECTDEBIT_CA(String.valueOf("eft_directdebit_CA")); @@ -101,6 +127,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EftDetails() {} /** @@ -111,6 +146,7 @@ public EftDetails() {} */ public EftDetails bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -134,6 +170,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -144,6 +181,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public EftDetails bankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set return this; } @@ -167,6 +205,7 @@ public String getBankCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankCode(String bankCode) { this.bankCode = bankCode; + isSetBankCode = true; // mark as set } /** @@ -177,6 +216,7 @@ public void setBankCode(String bankCode) { */ public EftDetails bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -200,6 +240,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -210,6 +251,7 @@ public void setBankLocationId(String bankLocationId) { */ public EftDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -233,6 +275,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -259,6 +302,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public EftDetails ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -314,6 +358,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -328,6 +373,7 @@ public void setOwnerName(String ownerName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public EftDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -359,6 +405,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -369,6 +416,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public EftDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -393,6 +441,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -405,6 +454,7 @@ public void setSdkData(String sdkData) { */ public EftDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -432,6 +482,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -442,6 +493,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public EftDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -465,6 +517,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EftDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EftDetails object is equal to o. */ @@ -478,28 +551,47 @@ public boolean equals(Object o) { } EftDetails eftDetails = (EftDetails) o; return Objects.equals(this.bankAccountNumber, eftDetails.bankAccountNumber) + && Objects.equals(this.isSetBankAccountNumber, eftDetails.isSetBankAccountNumber) && Objects.equals(this.bankCode, eftDetails.bankCode) + && Objects.equals(this.isSetBankCode, eftDetails.isSetBankCode) && Objects.equals(this.bankLocationId, eftDetails.bankLocationId) + && Objects.equals(this.isSetBankLocationId, eftDetails.isSetBankLocationId) && Objects.equals(this.checkoutAttemptId, eftDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, eftDetails.isSetCheckoutAttemptId) && Objects.equals(this.ownerName, eftDetails.ownerName) + && Objects.equals(this.isSetOwnerName, eftDetails.isSetOwnerName) && Objects.equals(this.recurringDetailReference, eftDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, eftDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, eftDetails.sdkData) + && Objects.equals(this.isSetSdkData, eftDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, eftDetails.storedPaymentMethodId) - && Objects.equals(this.type, eftDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, eftDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, eftDetails.type) + && Objects.equals(this.isSetType, eftDetails.isSetType); } @Override public int hashCode() { return Objects.hash( bankAccountNumber, + isSetBankAccountNumber, bankCode, + isSetBankCode, bankLocationId, + isSetBankLocationId, checkoutAttemptId, + isSetCheckoutAttemptId, ownerName, + isSetOwnerName, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -533,6 +625,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankCode) { + addIfNull(nulls, JSON_PROPERTY_BANK_CODE, this.bankCode); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EftDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java index 391ea7057..7260e052b 100644 --- a/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java +++ b/src/main/java/com/adyen/model/checkout/EncryptedOrderData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class EncryptedOrderData { public static final String JSON_PROPERTY_ORDER_DATA = "orderData"; private String orderData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderData = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EncryptedOrderData() {} /** @@ -39,6 +53,7 @@ public EncryptedOrderData() {} */ public EncryptedOrderData orderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getOrderData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderData(String orderData) { this.orderData = orderData; + isSetOrderData = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setOrderData(String orderData) { */ public EncryptedOrderData pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -95,6 +112,27 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EncryptedOrderData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EncryptedOrderData object is equal to o. */ @@ -108,12 +146,14 @@ public boolean equals(Object o) { } EncryptedOrderData encryptedOrderData = (EncryptedOrderData) o; return Objects.equals(this.orderData, encryptedOrderData.orderData) - && Objects.equals(this.pspReference, encryptedOrderData.pspReference); + && Objects.equals(this.isSetOrderData, encryptedOrderData.isSetOrderData) + && Objects.equals(this.pspReference, encryptedOrderData.pspReference) + && Objects.equals(this.isSetPspReference, encryptedOrderData.isSetPspReference); } @Override public int hashCode() { - return Objects.hash(orderData, pspReference); + return Objects.hash(orderData, isSetOrderData, pspReference, isSetPspReference); } @Override @@ -136,6 +176,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOrderData) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATA, this.orderData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EncryptedOrderData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java b/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java index fa7ca197c..31b690697 100644 --- a/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java +++ b/src/main/java/com/adyen/model/checkout/EnhancedSchemeData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -18,11 +20,29 @@ import java.util.*; /** EnhancedSchemeData */ -@JsonPropertyOrder({EnhancedSchemeData.JSON_PROPERTY_AIRLINE}) +@JsonPropertyOrder({ + EnhancedSchemeData.JSON_PROPERTY_AIRLINE, + EnhancedSchemeData.JSON_PROPERTY_LEVEL_TWO_THREE +}) public class EnhancedSchemeData { public static final String JSON_PROPERTY_AIRLINE = "airline"; private Airline airline; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAirline = false; + + public static final String JSON_PROPERTY_LEVEL_TWO_THREE = "levelTwoThree"; + private LevelTwoThree levelTwoThree; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLevelTwoThree = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public EnhancedSchemeData() {} /** @@ -33,6 +53,7 @@ public EnhancedSchemeData() {} */ public EnhancedSchemeData airline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set return this; } @@ -56,6 +77,62 @@ public Airline getAirline() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAirline(Airline airline) { this.airline = airline; + isSetAirline = true; // mark as set + } + + /** + * levelTwoThree + * + * @param levelTwoThree + * @return the current {@code EnhancedSchemeData} instance, allowing for method chaining + */ + public EnhancedSchemeData levelTwoThree(LevelTwoThree levelTwoThree) { + this.levelTwoThree = levelTwoThree; + isSetLevelTwoThree = true; // mark as set + return this; + } + + /** + * Get levelTwoThree + * + * @return levelTwoThree + */ + @JsonProperty(JSON_PROPERTY_LEVEL_TWO_THREE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LevelTwoThree getLevelTwoThree() { + return levelTwoThree; + } + + /** + * levelTwoThree + * + * @param levelTwoThree + */ + @JsonProperty(JSON_PROPERTY_LEVEL_TWO_THREE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLevelTwoThree(LevelTwoThree levelTwoThree) { + this.levelTwoThree = levelTwoThree; + isSetLevelTwoThree = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public EnhancedSchemeData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this EnhancedSchemeData object is equal to o. */ @@ -68,12 +145,15 @@ public boolean equals(Object o) { return false; } EnhancedSchemeData enhancedSchemeData = (EnhancedSchemeData) o; - return Objects.equals(this.airline, enhancedSchemeData.airline); + return Objects.equals(this.airline, enhancedSchemeData.airline) + && Objects.equals(this.isSetAirline, enhancedSchemeData.isSetAirline) + && Objects.equals(this.levelTwoThree, enhancedSchemeData.levelTwoThree) + && Objects.equals(this.isSetLevelTwoThree, enhancedSchemeData.isSetLevelTwoThree); } @Override public int hashCode() { - return Objects.hash(airline); + return Objects.hash(airline, isSetAirline, levelTwoThree, isSetLevelTwoThree); } @Override @@ -81,6 +161,7 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EnhancedSchemeData {\n"); sb.append(" airline: ").append(toIndentedString(airline)).append("\n"); + sb.append(" levelTwoThree: ").append(toIndentedString(levelTwoThree)).append("\n"); sb.append("}"); return sb.toString(); } @@ -95,6 +176,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAirline) { + addIfNull(nulls, JSON_PROPERTY_AIRLINE, this.airline); + } + if (isSetLevelTwoThree) { + addIfNull(nulls, JSON_PROPERTY_LEVEL_TWO_THREE, this.levelTwoThree); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of EnhancedSchemeData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ExternalPlatform.java b/src/main/java/com/adyen/model/checkout/ExternalPlatform.java index 065b8e302..6b2005fa0 100644 --- a/src/main/java/com/adyen/model/checkout/ExternalPlatform.java +++ b/src/main/java/com/adyen/model/checkout/ExternalPlatform.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ExternalPlatform { public static final String JSON_PROPERTY_INTEGRATOR = "integrator"; private String integrator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIntegrator = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VERSION = "version"; private String version; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ExternalPlatform() {} /** @@ -43,6 +60,7 @@ public ExternalPlatform() {} */ public ExternalPlatform integrator(String integrator) { this.integrator = integrator; + isSetIntegrator = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getIntegrator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIntegrator(String integrator) { this.integrator = integrator; + isSetIntegrator = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setIntegrator(String integrator) { */ public ExternalPlatform name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setName(String name) { */ public ExternalPlatform version(String version) { this.version = version; + isSetVersion = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(String version) { this.version = version; + isSetVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalPlatform includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ExternalPlatform object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ExternalPlatform externalPlatform = (ExternalPlatform) o; return Objects.equals(this.integrator, externalPlatform.integrator) + && Objects.equals(this.isSetIntegrator, externalPlatform.isSetIntegrator) && Objects.equals(this.name, externalPlatform.name) - && Objects.equals(this.version, externalPlatform.version); + && Objects.equals(this.isSetName, externalPlatform.isSetName) + && Objects.equals(this.version, externalPlatform.version) + && Objects.equals(this.isSetVersion, externalPlatform.isSetVersion); } @Override public int hashCode() { - return Objects.hash(integrator, name, version); + return Objects.hash(integrator, isSetIntegrator, name, isSetName, version, isSetVersion); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIntegrator) { + addIfNull(nulls, JSON_PROPERTY_INTEGRATOR, this.integrator); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetVersion) { + addIfNull(nulls, JSON_PROPERTY_VERSION, this.version); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ExternalPlatform given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ExternalTokenDetails.java b/src/main/java/com/adyen/model/checkout/ExternalTokenDetails.java new file mode 100644 index 000000000..d9ca160c4 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/ExternalTokenDetails.java @@ -0,0 +1,642 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** ExternalTokenDetails */ +@JsonPropertyOrder({ + ExternalTokenDetails.JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, + ExternalTokenDetails.JSON_PROPERTY_EXPIRY_MONTH, + ExternalTokenDetails.JSON_PROPERTY_EXPIRY_YEAR, + ExternalTokenDetails.JSON_PROPERTY_HOLDER_NAME, + ExternalTokenDetails.JSON_PROPERTY_NUMBER, + ExternalTokenDetails.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, + ExternalTokenDetails.JSON_PROPERTY_SUBTYPE, + ExternalTokenDetails.JSON_PROPERTY_TYPE +}) +public class ExternalTokenDetails { + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; + private String checkoutAttemptId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; + private String expiryMonth; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; + private String expiryYear; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; + private String holderName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; + private String storedPaymentMethodId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + + /** + * The external service from which to fetch the token. Supported only for specific companies. + * Contact Adyen if you want to use this feature. + */ + public enum SubtypeEnum { + HILTON(String.valueOf("hilton")); + + private static final Logger LOG = Logger.getLogger(SubtypeEnum.class.getName()); + + private String value; + + SubtypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SubtypeEnum fromValue(String value) { + for (SubtypeEnum b : SubtypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "SubtypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(SubtypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; + private SubtypeEnum subtype; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + + /** The type of token. Allowed value: **externalToken**. */ + public enum TypeEnum { + EXTERNALTOKEN(String.valueOf("externalToken")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ExternalTokenDetails() {} + + /** + * The checkout attempt identifier. + * + * @param checkoutAttemptId The checkout attempt identifier. + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails checkoutAttemptId(String checkoutAttemptId) { + this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set + return this; + } + + /** + * The checkout attempt identifier. + * + * @return checkoutAttemptId The checkout attempt identifier. + */ + @JsonProperty(JSON_PROPERTY_CHECKOUT_ATTEMPT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCheckoutAttemptId() { + return checkoutAttemptId; + } + + /** + * The checkout attempt identifier. + * + * @param checkoutAttemptId The checkout attempt identifier. + */ + @JsonProperty(JSON_PROPERTY_CHECKOUT_ATTEMPT_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCheckoutAttemptId(String checkoutAttemptId) { + this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set + } + + /** + * The card expiry month. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @param expiryMonth The card expiry month. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails expiryMonth(String expiryMonth) { + this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set + return this; + } + + /** + * The card expiry month. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return expiryMonth The card expiry month. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiryMonth() { + return expiryMonth; + } + + /** + * The card expiry month. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @param expiryMonth The card expiry month. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryMonth(String expiryMonth) { + this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set + } + + /** + * The card expiry year. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @param expiryYear The card expiry year. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails expiryYear(String expiryYear) { + this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set + return this; + } + + /** + * The card expiry year. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return expiryYear The card expiry year. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiryYear() { + return expiryYear; + } + + /** + * The card expiry year. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @param expiryYear The card expiry year. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryYear(String expiryYear) { + this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set + } + + /** + * The name of the card holder. + * + * @param holderName The name of the card holder. + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails holderName(String holderName) { + this.holderName = holderName; + isSetHolderName = true; // mark as set + return this; + } + + /** + * The name of the card holder. + * + * @return holderName The name of the card holder. + */ + @JsonProperty(JSON_PROPERTY_HOLDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHolderName() { + return holderName; + } + + /** + * The name of the card holder. + * + * @param holderName The name of the card holder. + */ + @JsonProperty(JSON_PROPERTY_HOLDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHolderName(String holderName) { + this.holderName = holderName; + isSetHolderName = true; // mark as set + } + + /** + * The card number. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @param number The card number. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails number(String number) { + this.number = number; + isSetNumber = true; // mark as set + return this; + } + + /** + * The card number. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @return number The card number. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + /** + * The card number. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + * + * @param number The card number. Only collect raw card data if you are [fully PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + isSetNumber = true; // mark as set + } + + /** + * Identifier used to fetch the token from the external service + * + * @param storedPaymentMethodId Identifier used to fetch the token from the external service + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails storedPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + return this; + } + + /** + * Identifier used to fetch the token from the external service + * + * @return storedPaymentMethodId Identifier used to fetch the token from the external service + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStoredPaymentMethodId() { + return storedPaymentMethodId; + } + + /** + * Identifier used to fetch the token from the external service + * + * @param storedPaymentMethodId Identifier used to fetch the token from the external service + */ + @JsonProperty(JSON_PROPERTY_STORED_PAYMENT_METHOD_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStoredPaymentMethodId(String storedPaymentMethodId) { + this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set + } + + /** + * The external service from which to fetch the token. Supported only for specific companies. + * Contact Adyen if you want to use this feature. + * + * @param subtype The external service from which to fetch the token. Supported only for specific + * companies. Contact Adyen if you want to use this feature. + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails subtype(SubtypeEnum subtype) { + this.subtype = subtype; + isSetSubtype = true; // mark as set + return this; + } + + /** + * The external service from which to fetch the token. Supported only for specific companies. + * Contact Adyen if you want to use this feature. + * + * @return subtype The external service from which to fetch the token. Supported only for specific + * companies. Contact Adyen if you want to use this feature. + */ + @JsonProperty(JSON_PROPERTY_SUBTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubtypeEnum getSubtype() { + return subtype; + } + + /** + * The external service from which to fetch the token. Supported only for specific companies. + * Contact Adyen if you want to use this feature. + * + * @param subtype The external service from which to fetch the token. Supported only for specific + * companies. Contact Adyen if you want to use this feature. + */ + @JsonProperty(JSON_PROPERTY_SUBTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubtype(SubtypeEnum subtype) { + this.subtype = subtype; + isSetSubtype = true; // mark as set + } + + /** + * The type of token. Allowed value: **externalToken**. + * + * @param type The type of token. Allowed value: **externalToken**. + * @return the current {@code ExternalTokenDetails} instance, allowing for method chaining + */ + public ExternalTokenDetails type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * The type of token. Allowed value: **externalToken**. + * + * @return type The type of token. Allowed value: **externalToken**. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * The type of token. Allowed value: **externalToken**. + * + * @param type The type of token. Allowed value: **externalToken**. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ExternalTokenDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ExternalTokenDetails object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExternalTokenDetails externalTokenDetails = (ExternalTokenDetails) o; + return Objects.equals(this.checkoutAttemptId, externalTokenDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, externalTokenDetails.isSetCheckoutAttemptId) + && Objects.equals(this.expiryMonth, externalTokenDetails.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, externalTokenDetails.isSetExpiryMonth) + && Objects.equals(this.expiryYear, externalTokenDetails.expiryYear) + && Objects.equals(this.isSetExpiryYear, externalTokenDetails.isSetExpiryYear) + && Objects.equals(this.holderName, externalTokenDetails.holderName) + && Objects.equals(this.isSetHolderName, externalTokenDetails.isSetHolderName) + && Objects.equals(this.number, externalTokenDetails.number) + && Objects.equals(this.isSetNumber, externalTokenDetails.isSetNumber) + && Objects.equals(this.storedPaymentMethodId, externalTokenDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, externalTokenDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.subtype, externalTokenDetails.subtype) + && Objects.equals(this.isSetSubtype, externalTokenDetails.isSetSubtype) + && Objects.equals(this.type, externalTokenDetails.type) + && Objects.equals(this.isSetType, externalTokenDetails.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + expiryMonth, + isSetExpiryMonth, + expiryYear, + isSetExpiryYear, + holderName, + isSetHolderName, + number, + isSetNumber, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + subtype, + isSetSubtype, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExternalTokenDetails {\n"); + sb.append(" checkoutAttemptId: ").append(toIndentedString(checkoutAttemptId)).append("\n"); + sb.append(" expiryMonth: ").append(toIndentedString(expiryMonth)).append("\n"); + sb.append(" expiryYear: ").append(toIndentedString(expiryYear)).append("\n"); + sb.append(" holderName: ").append(toIndentedString(holderName)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" storedPaymentMethodId: ") + .append(toIndentedString(storedPaymentMethodId)) + .append("\n"); + sb.append(" subtype: ").append(toIndentedString(subtype)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ExternalTokenDetails given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExternalTokenDetails + * @throws JsonProcessingException if the JSON string is invalid with respect to + * ExternalTokenDetails + */ + public static ExternalTokenDetails fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ExternalTokenDetails.class); + } + + /** + * Convert an instance of ExternalTokenDetails to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/FastlaneDetails.java b/src/main/java/com/adyen/model/checkout/FastlaneDetails.java index 032b9261e..c922f4d19 100644 --- a/src/main/java/com/adyen/model/checkout/FastlaneDetails.java +++ b/src/main/java/com/adyen/model/checkout/FastlaneDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class FastlaneDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_FASTLANE_DATA = "fastlaneData"; private String fastlaneData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFastlaneData = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **fastlane** */ public enum TypeEnum { FASTLANE(String.valueOf("fastlane")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FastlaneDetails() {} /** @@ -99,6 +125,7 @@ public FastlaneDetails() {} */ public FastlaneDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public FastlaneDetails fastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set return this; } @@ -155,6 +184,7 @@ public String getFastlaneData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFastlaneData(String fastlaneData) { this.fastlaneData = fastlaneData; + isSetFastlaneData = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setFastlaneData(String fastlaneData) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public FastlaneDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public FastlaneDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public FastlaneDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public FastlaneDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FastlaneDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FastlaneDetails object is equal to o. */ @@ -319,22 +377,36 @@ public boolean equals(Object o) { } FastlaneDetails fastlaneDetails = (FastlaneDetails) o; return Objects.equals(this.checkoutAttemptId, fastlaneDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, fastlaneDetails.isSetCheckoutAttemptId) && Objects.equals(this.fastlaneData, fastlaneDetails.fastlaneData) + && Objects.equals(this.isSetFastlaneData, fastlaneDetails.isSetFastlaneData) && Objects.equals(this.recurringDetailReference, fastlaneDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, fastlaneDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, fastlaneDetails.sdkData) + && Objects.equals(this.isSetSdkData, fastlaneDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, fastlaneDetails.storedPaymentMethodId) - && Objects.equals(this.type, fastlaneDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, fastlaneDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, fastlaneDetails.type) + && Objects.equals(this.isSetType, fastlaneDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, fastlaneData, + isSetFastlaneData, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -365,6 +437,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFastlaneData) { + addIfNull(nulls, JSON_PROPERTY_FASTLANE_DATA, this.fastlaneData); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FastlaneDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ForexQuote.java b/src/main/java/com/adyen/model/checkout/ForexQuote.java index 79fb4567a..279a8546e 100644 --- a/src/main/java/com/adyen/model/checkout/ForexQuote.java +++ b/src/main/java/com/adyen/model/checkout/ForexQuote.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,39 +39,81 @@ public class ForexQuote { public static final String JSON_PROPERTY_ACCOUNT = "account"; private String account; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccount = false; + public static final String JSON_PROPERTY_ACCOUNT_TYPE = "accountType"; private String accountType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountType = false; + public static final String JSON_PROPERTY_BASE_AMOUNT = "baseAmount"; private Amount baseAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBaseAmount = false; + public static final String JSON_PROPERTY_BASE_POINTS = "basePoints"; private Integer basePoints; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBasePoints = false; + public static final String JSON_PROPERTY_BUY = "buy"; private Amount buy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBuy = false; + public static final String JSON_PROPERTY_INTERBANK = "interbank"; private Amount interbank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInterbank = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SELL = "sell"; private Amount sell; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSell = false; + public static final String JSON_PROPERTY_SIGNATURE = "signature"; private String signature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSignature = false; + public static final String JSON_PROPERTY_SOURCE = "source"; private String source; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSource = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALID_TILL = "validTill"; private OffsetDateTime validTill; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValidTill = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ForexQuote() {} /** @@ -80,6 +124,7 @@ public ForexQuote() {} */ public ForexQuote account(String account) { this.account = account; + isSetAccount = true; // mark as set return this; } @@ -103,6 +148,7 @@ public String getAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccount(String account) { this.account = account; + isSetAccount = true; // mark as set } /** @@ -113,6 +159,7 @@ public void setAccount(String account) { */ public ForexQuote accountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set return this; } @@ -136,6 +183,7 @@ public String getAccountType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountType(String accountType) { this.accountType = accountType; + isSetAccountType = true; // mark as set } /** @@ -146,6 +194,7 @@ public void setAccountType(String accountType) { */ public ForexQuote baseAmount(Amount baseAmount) { this.baseAmount = baseAmount; + isSetBaseAmount = true; // mark as set return this; } @@ -169,6 +218,7 @@ public Amount getBaseAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBaseAmount(Amount baseAmount) { this.baseAmount = baseAmount; + isSetBaseAmount = true; // mark as set } /** @@ -179,6 +229,7 @@ public void setBaseAmount(Amount baseAmount) { */ public ForexQuote basePoints(Integer basePoints) { this.basePoints = basePoints; + isSetBasePoints = true; // mark as set return this; } @@ -202,6 +253,7 @@ public Integer getBasePoints() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBasePoints(Integer basePoints) { this.basePoints = basePoints; + isSetBasePoints = true; // mark as set } /** @@ -212,6 +264,7 @@ public void setBasePoints(Integer basePoints) { */ public ForexQuote buy(Amount buy) { this.buy = buy; + isSetBuy = true; // mark as set return this; } @@ -235,6 +288,7 @@ public Amount getBuy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBuy(Amount buy) { this.buy = buy; + isSetBuy = true; // mark as set } /** @@ -245,6 +299,7 @@ public void setBuy(Amount buy) { */ public ForexQuote interbank(Amount interbank) { this.interbank = interbank; + isSetInterbank = true; // mark as set return this; } @@ -268,6 +323,7 @@ public Amount getInterbank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInterbank(Amount interbank) { this.interbank = interbank; + isSetInterbank = true; // mark as set } /** @@ -278,6 +334,7 @@ public void setInterbank(Amount interbank) { */ public ForexQuote reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -301,6 +358,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -311,6 +369,7 @@ public void setReference(String reference) { */ public ForexQuote sell(Amount sell) { this.sell = sell; + isSetSell = true; // mark as set return this; } @@ -334,6 +393,7 @@ public Amount getSell() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSell(Amount sell) { this.sell = sell; + isSetSell = true; // mark as set } /** @@ -344,6 +404,7 @@ public void setSell(Amount sell) { */ public ForexQuote signature(String signature) { this.signature = signature; + isSetSignature = true; // mark as set return this; } @@ -367,6 +428,7 @@ public String getSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSignature(String signature) { this.signature = signature; + isSetSignature = true; // mark as set } /** @@ -377,6 +439,7 @@ public void setSignature(String signature) { */ public ForexQuote source(String source) { this.source = source; + isSetSource = true; // mark as set return this; } @@ -400,6 +463,7 @@ public String getSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSource(String source) { this.source = source; + isSetSource = true; // mark as set } /** @@ -410,6 +474,7 @@ public void setSource(String source) { */ public ForexQuote type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -433,6 +498,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -443,6 +509,7 @@ public void setType(String type) { */ public ForexQuote validTill(OffsetDateTime validTill) { this.validTill = validTill; + isSetValidTill = true; // mark as set return this; } @@ -466,6 +533,27 @@ public OffsetDateTime getValidTill() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValidTill(OffsetDateTime validTill) { this.validTill = validTill; + isSetValidTill = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ForexQuote includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ForexQuote object is equal to o. */ @@ -479,34 +567,58 @@ public boolean equals(Object o) { } ForexQuote forexQuote = (ForexQuote) o; return Objects.equals(this.account, forexQuote.account) + && Objects.equals(this.isSetAccount, forexQuote.isSetAccount) && Objects.equals(this.accountType, forexQuote.accountType) + && Objects.equals(this.isSetAccountType, forexQuote.isSetAccountType) && Objects.equals(this.baseAmount, forexQuote.baseAmount) + && Objects.equals(this.isSetBaseAmount, forexQuote.isSetBaseAmount) && Objects.equals(this.basePoints, forexQuote.basePoints) + && Objects.equals(this.isSetBasePoints, forexQuote.isSetBasePoints) && Objects.equals(this.buy, forexQuote.buy) + && Objects.equals(this.isSetBuy, forexQuote.isSetBuy) && Objects.equals(this.interbank, forexQuote.interbank) + && Objects.equals(this.isSetInterbank, forexQuote.isSetInterbank) && Objects.equals(this.reference, forexQuote.reference) + && Objects.equals(this.isSetReference, forexQuote.isSetReference) && Objects.equals(this.sell, forexQuote.sell) + && Objects.equals(this.isSetSell, forexQuote.isSetSell) && Objects.equals(this.signature, forexQuote.signature) + && Objects.equals(this.isSetSignature, forexQuote.isSetSignature) && Objects.equals(this.source, forexQuote.source) + && Objects.equals(this.isSetSource, forexQuote.isSetSource) && Objects.equals(this.type, forexQuote.type) - && Objects.equals(this.validTill, forexQuote.validTill); + && Objects.equals(this.isSetType, forexQuote.isSetType) + && Objects.equals(this.validTill, forexQuote.validTill) + && Objects.equals(this.isSetValidTill, forexQuote.isSetValidTill); } @Override public int hashCode() { return Objects.hash( account, + isSetAccount, accountType, + isSetAccountType, baseAmount, + isSetBaseAmount, basePoints, + isSetBasePoints, buy, + isSetBuy, interbank, + isSetInterbank, reference, + isSetReference, sell, + isSetSell, signature, + isSetSignature, source, + isSetSource, type, - validTill); + isSetType, + validTill, + isSetValidTill); } @Override @@ -539,6 +651,63 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccount) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT, this.account); + } + if (isSetAccountType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_TYPE, this.accountType); + } + if (isSetBaseAmount) { + addIfNull(nulls, JSON_PROPERTY_BASE_AMOUNT, this.baseAmount); + } + if (isSetBasePoints) { + addIfNull(nulls, JSON_PROPERTY_BASE_POINTS, this.basePoints); + } + if (isSetBuy) { + addIfNull(nulls, JSON_PROPERTY_BUY, this.buy); + } + if (isSetInterbank) { + addIfNull(nulls, JSON_PROPERTY_INTERBANK, this.interbank); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSell) { + addIfNull(nulls, JSON_PROPERTY_SELL, this.sell); + } + if (isSetSignature) { + addIfNull(nulls, JSON_PROPERTY_SIGNATURE, this.signature); + } + if (isSetSource) { + addIfNull(nulls, JSON_PROPERTY_SOURCE, this.source); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValidTill) { + addIfNull(nulls, JSON_PROPERTY_VALID_TILL, this.validTill); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ForexQuote given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/FraudCheckResult.java b/src/main/java/com/adyen/model/checkout/FraudCheckResult.java index 03fde128b..b89c1ddeb 100644 --- a/src/main/java/com/adyen/model/checkout/FraudCheckResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudCheckResult.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class FraudCheckResult { public static final String JSON_PROPERTY_ACCOUNT_SCORE = "accountScore"; private Integer accountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountScore = false; + public static final String JSON_PROPERTY_CHECK_ID = "checkId"; private Integer checkId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FraudCheckResult() {} /** @@ -43,6 +60,7 @@ public FraudCheckResult() {} */ public FraudCheckResult accountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set return this; } @@ -66,6 +84,7 @@ public Integer getAccountScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setAccountScore(Integer accountScore) { */ public FraudCheckResult checkId(Integer checkId) { this.checkId = checkId; + isSetCheckId = true; // mark as set return this; } @@ -99,6 +119,7 @@ public Integer getCheckId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckId(Integer checkId) { this.checkId = checkId; + isSetCheckId = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setCheckId(Integer checkId) { */ public FraudCheckResult name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FraudCheckResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FraudCheckResult object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } FraudCheckResult fraudCheckResult = (FraudCheckResult) o; return Objects.equals(this.accountScore, fraudCheckResult.accountScore) + && Objects.equals(this.isSetAccountScore, fraudCheckResult.isSetAccountScore) && Objects.equals(this.checkId, fraudCheckResult.checkId) - && Objects.equals(this.name, fraudCheckResult.name); + && Objects.equals(this.isSetCheckId, fraudCheckResult.isSetCheckId) + && Objects.equals(this.name, fraudCheckResult.name) + && Objects.equals(this.isSetName, fraudCheckResult.isSetName); } @Override public int hashCode() { - return Objects.hash(accountScore, checkId, name); + return Objects.hash(accountScore, isSetAccountScore, checkId, isSetCheckId, name, isSetName); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountScore) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_SCORE, this.accountScore); + } + if (isSetCheckId) { + addIfNull(nulls, JSON_PROPERTY_CHECK_ID, this.checkId); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FraudCheckResult given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/FraudResult.java b/src/main/java/com/adyen/model/checkout/FraudResult.java index 31cdaa0eb..85acd3fad 100644 --- a/src/main/java/com/adyen/model/checkout/FraudResult.java +++ b/src/main/java/com/adyen/model/checkout/FraudResult.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,9 +27,21 @@ public class FraudResult { public static final String JSON_PROPERTY_ACCOUNT_SCORE = "accountScore"; private Integer accountScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountScore = false; + public static final String JSON_PROPERTY_RESULTS = "results"; private List results; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResults = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FraudResult() {} /** @@ -38,6 +52,7 @@ public FraudResult() {} */ public FraudResult accountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set return this; } @@ -61,6 +76,7 @@ public Integer getAccountScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountScore(Integer accountScore) { this.accountScore = accountScore; + isSetAccountScore = true; // mark as set } /** @@ -71,6 +87,7 @@ public void setAccountScore(Integer accountScore) { */ public FraudResult results(List results) { this.results = results; + isSetResults = true; // mark as set return this; } @@ -102,6 +119,27 @@ public List getResults() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResults(List results) { this.results = results; + isSetResults = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FraudResult includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FraudResult object is equal to o. */ @@ -115,12 +153,14 @@ public boolean equals(Object o) { } FraudResult fraudResult = (FraudResult) o; return Objects.equals(this.accountScore, fraudResult.accountScore) - && Objects.equals(this.results, fraudResult.results); + && Objects.equals(this.isSetAccountScore, fraudResult.isSetAccountScore) + && Objects.equals(this.results, fraudResult.results) + && Objects.equals(this.isSetResults, fraudResult.isSetResults); } @Override public int hashCode() { - return Objects.hash(accountScore, results); + return Objects.hash(accountScore, isSetAccountScore, results, isSetResults); } @Override @@ -143,6 +183,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountScore) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_SCORE, this.accountScore); + } + if (isSetResults) { + addIfNull(nulls, JSON_PROPERTY_RESULTS, this.results); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FraudResult given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/FundOrigin.java b/src/main/java/com/adyen/model/checkout/FundOrigin.java index a1355a9b5..7cd1880d1 100644 --- a/src/main/java/com/adyen/model/checkout/FundOrigin.java +++ b/src/main/java/com/adyen/model/checkout/FundOrigin.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class FundOrigin { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_WALLET_IDENTIFIER = "walletIdentifier"; private String walletIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletIdentifier = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FundOrigin() {} /** @@ -51,6 +74,7 @@ public FundOrigin() {} */ public FundOrigin billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -74,6 +98,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -84,6 +109,7 @@ public void setBillingAddress(Address billingAddress) { */ public FundOrigin shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -107,6 +133,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -117,6 +144,7 @@ public void setShopperEmail(String shopperEmail) { */ public FundOrigin shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -140,6 +168,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -150,6 +179,7 @@ public void setShopperName(Name shopperName) { */ public FundOrigin telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -173,6 +203,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -183,6 +214,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public FundOrigin walletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set return this; } @@ -206,6 +238,27 @@ public String getWalletIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundOrigin includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FundOrigin object is equal to o. */ @@ -219,16 +272,30 @@ public boolean equals(Object o) { } FundOrigin fundOrigin = (FundOrigin) o; return Objects.equals(this.billingAddress, fundOrigin.billingAddress) + && Objects.equals(this.isSetBillingAddress, fundOrigin.isSetBillingAddress) && Objects.equals(this.shopperEmail, fundOrigin.shopperEmail) + && Objects.equals(this.isSetShopperEmail, fundOrigin.isSetShopperEmail) && Objects.equals(this.shopperName, fundOrigin.shopperName) + && Objects.equals(this.isSetShopperName, fundOrigin.isSetShopperName) && Objects.equals(this.telephoneNumber, fundOrigin.telephoneNumber) - && Objects.equals(this.walletIdentifier, fundOrigin.walletIdentifier); + && Objects.equals(this.isSetTelephoneNumber, fundOrigin.isSetTelephoneNumber) + && Objects.equals(this.walletIdentifier, fundOrigin.walletIdentifier) + && Objects.equals(this.isSetWalletIdentifier, fundOrigin.isSetWalletIdentifier); } @Override public int hashCode() { return Objects.hash( - billingAddress, shopperEmail, shopperName, telephoneNumber, walletIdentifier); + billingAddress, + isSetBillingAddress, + shopperEmail, + isSetShopperEmail, + shopperName, + isSetShopperName, + telephoneNumber, + isSetTelephoneNumber, + walletIdentifier, + isSetWalletIdentifier); } @Override @@ -254,6 +321,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetWalletIdentifier) { + addIfNull(nulls, JSON_PROPERTY_WALLET_IDENTIFIER, this.walletIdentifier); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FundOrigin given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/FundRecipient.java b/src/main/java/com/adyen/model/checkout/FundRecipient.java index 37e1d3aae..f58ea6dfc 100644 --- a/src/main/java/com/adyen/model/checkout/FundRecipient.java +++ b/src/main/java/com/adyen/model/checkout/FundRecipient.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,36 +42,69 @@ public class FundRecipient { public static final String JSON_PROPERTY_I_B_A_N = "IBAN"; private String IBAN; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIBAN = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private CardDetails paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUB_MERCHANT = "subMerchant"; private SubMerchant subMerchant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchant = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_WALLET_IDENTIFIER = "walletIdentifier"; private String walletIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletIdentifier = false; + public static final String JSON_PROPERTY_WALLET_OWNER_TAX_ID = "walletOwnerTaxId"; private String walletOwnerTaxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletOwnerTaxId = false; + /** The purpose of a digital wallet transaction. */ public enum WalletPurposeEnum { IDENTIFIEDBOLETO(String.valueOf("identifiedBoleto")), @@ -120,6 +155,15 @@ public static WalletPurposeEnum fromValue(String value) { public static final String JSON_PROPERTY_WALLET_PURPOSE = "walletPurpose"; private WalletPurposeEnum walletPurpose; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWalletPurpose = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public FundRecipient() {} /** @@ -130,6 +174,7 @@ public FundRecipient() {} */ public FundRecipient IBAN(String IBAN) { this.IBAN = IBAN; + isSetIBAN = true; // mark as set return this; } @@ -153,6 +198,7 @@ public String getIBAN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIBAN(String IBAN) { this.IBAN = IBAN; + isSetIBAN = true; // mark as set } /** @@ -163,6 +209,7 @@ public void setIBAN(String IBAN) { */ public FundRecipient billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -186,6 +233,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -196,6 +244,7 @@ public void setBillingAddress(Address billingAddress) { */ public FundRecipient paymentMethod(CardDetails paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -219,6 +268,7 @@ public CardDetails getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(CardDetails paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -229,6 +279,7 @@ public void setPaymentMethod(CardDetails paymentMethod) { */ public FundRecipient shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -252,6 +303,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -262,6 +314,7 @@ public void setShopperEmail(String shopperEmail) { */ public FundRecipient shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -285,6 +338,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -301,6 +355,7 @@ public void setShopperName(Name shopperName) { */ public FundRecipient shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -336,6 +391,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -348,6 +404,7 @@ public void setShopperReference(String shopperReference) { */ public FundRecipient storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -375,6 +432,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -385,6 +443,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public FundRecipient subMerchant(SubMerchant subMerchant) { this.subMerchant = subMerchant; + isSetSubMerchant = true; // mark as set return this; } @@ -408,6 +467,7 @@ public SubMerchant getSubMerchant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchant(SubMerchant subMerchant) { this.subMerchant = subMerchant; + isSetSubMerchant = true; // mark as set } /** @@ -418,6 +478,7 @@ public void setSubMerchant(SubMerchant subMerchant) { */ public FundRecipient telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -441,6 +502,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -453,6 +515,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public FundRecipient walletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set return this; } @@ -480,6 +543,7 @@ public String getWalletIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletIdentifier(String walletIdentifier) { this.walletIdentifier = walletIdentifier; + isSetWalletIdentifier = true; // mark as set } /** @@ -490,6 +554,7 @@ public void setWalletIdentifier(String walletIdentifier) { */ public FundRecipient walletOwnerTaxId(String walletOwnerTaxId) { this.walletOwnerTaxId = walletOwnerTaxId; + isSetWalletOwnerTaxId = true; // mark as set return this; } @@ -513,6 +578,7 @@ public String getWalletOwnerTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletOwnerTaxId(String walletOwnerTaxId) { this.walletOwnerTaxId = walletOwnerTaxId; + isSetWalletOwnerTaxId = true; // mark as set } /** @@ -523,6 +589,7 @@ public void setWalletOwnerTaxId(String walletOwnerTaxId) { */ public FundRecipient walletPurpose(WalletPurposeEnum walletPurpose) { this.walletPurpose = walletPurpose; + isSetWalletPurpose = true; // mark as set return this; } @@ -546,6 +613,27 @@ public WalletPurposeEnum getWalletPurpose() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWalletPurpose(WalletPurposeEnum walletPurpose) { this.walletPurpose = walletPurpose; + isSetWalletPurpose = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public FundRecipient includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this FundRecipient object is equal to o. */ @@ -559,34 +647,58 @@ public boolean equals(Object o) { } FundRecipient fundRecipient = (FundRecipient) o; return Objects.equals(this.IBAN, fundRecipient.IBAN) + && Objects.equals(this.isSetIBAN, fundRecipient.isSetIBAN) && Objects.equals(this.billingAddress, fundRecipient.billingAddress) + && Objects.equals(this.isSetBillingAddress, fundRecipient.isSetBillingAddress) && Objects.equals(this.paymentMethod, fundRecipient.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, fundRecipient.isSetPaymentMethod) && Objects.equals(this.shopperEmail, fundRecipient.shopperEmail) + && Objects.equals(this.isSetShopperEmail, fundRecipient.isSetShopperEmail) && Objects.equals(this.shopperName, fundRecipient.shopperName) + && Objects.equals(this.isSetShopperName, fundRecipient.isSetShopperName) && Objects.equals(this.shopperReference, fundRecipient.shopperReference) + && Objects.equals(this.isSetShopperReference, fundRecipient.isSetShopperReference) && Objects.equals(this.storedPaymentMethodId, fundRecipient.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, fundRecipient.isSetStoredPaymentMethodId) && Objects.equals(this.subMerchant, fundRecipient.subMerchant) + && Objects.equals(this.isSetSubMerchant, fundRecipient.isSetSubMerchant) && Objects.equals(this.telephoneNumber, fundRecipient.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, fundRecipient.isSetTelephoneNumber) && Objects.equals(this.walletIdentifier, fundRecipient.walletIdentifier) + && Objects.equals(this.isSetWalletIdentifier, fundRecipient.isSetWalletIdentifier) && Objects.equals(this.walletOwnerTaxId, fundRecipient.walletOwnerTaxId) - && Objects.equals(this.walletPurpose, fundRecipient.walletPurpose); + && Objects.equals(this.isSetWalletOwnerTaxId, fundRecipient.isSetWalletOwnerTaxId) + && Objects.equals(this.walletPurpose, fundRecipient.walletPurpose) + && Objects.equals(this.isSetWalletPurpose, fundRecipient.isSetWalletPurpose); } @Override public int hashCode() { return Objects.hash( IBAN, + isSetIBAN, billingAddress, + isSetBillingAddress, paymentMethod, + isSetPaymentMethod, shopperEmail, + isSetShopperEmail, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, storedPaymentMethodId, + isSetStoredPaymentMethodId, subMerchant, + isSetSubMerchant, telephoneNumber, + isSetTelephoneNumber, walletIdentifier, + isSetWalletIdentifier, walletOwnerTaxId, - walletPurpose); + isSetWalletOwnerTaxId, + walletPurpose, + isSetWalletPurpose); } @Override @@ -621,6 +733,63 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIBAN) { + addIfNull(nulls, JSON_PROPERTY_I_B_A_N, this.IBAN); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubMerchant) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT, this.subMerchant); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetWalletIdentifier) { + addIfNull(nulls, JSON_PROPERTY_WALLET_IDENTIFIER, this.walletIdentifier); + } + if (isSetWalletOwnerTaxId) { + addIfNull(nulls, JSON_PROPERTY_WALLET_OWNER_TAX_ID, this.walletOwnerTaxId); + } + if (isSetWalletPurpose) { + addIfNull(nulls, JSON_PROPERTY_WALLET_PURPOSE, this.walletPurpose); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of FundRecipient given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java index fac91915d..65cb63248 100644 --- a/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/GenericIssuerPaymentMethodDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class GenericIssuerPaymentMethodDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **genericissuer** */ public enum TypeEnum { ONLINEBANKING_PL(String.valueOf("onlineBanking_PL")), @@ -97,6 +114,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GenericIssuerPaymentMethodDetails() {} /** @@ -108,6 +134,7 @@ public GenericIssuerPaymentMethodDetails() {} */ public GenericIssuerPaymentMethodDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -131,6 +158,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -142,6 +170,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public GenericIssuerPaymentMethodDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -165,6 +194,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -181,6 +211,7 @@ public void setIssuer(String issuer) { public GenericIssuerPaymentMethodDetails recurringDetailReference( String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -212,6 +243,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -223,6 +255,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public GenericIssuerPaymentMethodDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -247,6 +280,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -260,6 +294,7 @@ public void setSdkData(String sdkData) { */ public GenericIssuerPaymentMethodDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -287,6 +322,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -298,6 +334,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public GenericIssuerPaymentMethodDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -321,6 +358,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GenericIssuerPaymentMethodDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GenericIssuerPaymentMethodDetails object is equal to o. */ @@ -336,20 +394,42 @@ public boolean equals(Object o) { (GenericIssuerPaymentMethodDetails) o; return Objects.equals( this.checkoutAttemptId, genericIssuerPaymentMethodDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, genericIssuerPaymentMethodDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, genericIssuerPaymentMethodDetails.issuer) + && Objects.equals(this.isSetIssuer, genericIssuerPaymentMethodDetails.isSetIssuer) && Objects.equals( this.recurringDetailReference, genericIssuerPaymentMethodDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + genericIssuerPaymentMethodDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, genericIssuerPaymentMethodDetails.sdkData) + && Objects.equals(this.isSetSdkData, genericIssuerPaymentMethodDetails.isSetSdkData) && Objects.equals( this.storedPaymentMethodId, genericIssuerPaymentMethodDetails.storedPaymentMethodId) - && Objects.equals(this.type, genericIssuerPaymentMethodDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, + genericIssuerPaymentMethodDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, genericIssuerPaymentMethodDetails.type) + && Objects.equals(this.isSetType, genericIssuerPaymentMethodDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, issuer, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -380,6 +460,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GenericIssuerPaymentMethodDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java index deb73e02a..777ea33c4 100644 --- a/src/main/java/com/adyen/model/checkout/GooglePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/GooglePayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,6 +39,9 @@ public class GooglePayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -44,7 +49,9 @@ public class GooglePayDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -84,25 +91,46 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_CARD_NETWORK = "googlePayCardNetwork"; private String googlePayCardNetwork; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayCardNetwork = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **googlepay**, **paywithgoogle** */ public enum TypeEnum { GOOGLEPAY(String.valueOf("googlepay")); @@ -145,6 +173,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GooglePayDetails() {} /** @@ -155,6 +192,7 @@ public GooglePayDetails() {} */ public GooglePayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -178,6 +216,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +230,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public GooglePayDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -220,6 +260,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +271,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public GooglePayDetails googlePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set return this; } @@ -253,6 +295,7 @@ public String getGooglePayCardNetwork() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set } /** @@ -267,6 +310,7 @@ public void setGooglePayCardNetwork(String googlePayCardNetwork) { */ public GooglePayDetails googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -298,6 +342,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -312,6 +357,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public GooglePayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -343,6 +389,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -353,6 +400,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public GooglePayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -377,6 +425,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -389,6 +438,7 @@ public void setSdkData(String sdkData) { */ public GooglePayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -416,6 +466,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -427,6 +478,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public GooglePayDetails threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -452,6 +504,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -462,6 +515,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public GooglePayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -485,6 +539,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GooglePayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GooglePayDetails object is equal to o. */ @@ -498,28 +573,49 @@ public boolean equals(Object o) { } GooglePayDetails googlePayDetails = (GooglePayDetails) o; return Objects.equals(this.checkoutAttemptId, googlePayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, googlePayDetails.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, googlePayDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, googlePayDetails.isSetFundingSource) && Objects.equals(this.googlePayCardNetwork, googlePayDetails.googlePayCardNetwork) + && Objects.equals( + this.isSetGooglePayCardNetwork, googlePayDetails.isSetGooglePayCardNetwork) && Objects.equals(this.googlePayToken, googlePayDetails.googlePayToken) + && Objects.equals(this.isSetGooglePayToken, googlePayDetails.isSetGooglePayToken) && Objects.equals(this.recurringDetailReference, googlePayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, googlePayDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, googlePayDetails.sdkData) + && Objects.equals(this.isSetSdkData, googlePayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, googlePayDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, googlePayDetails.isSetStoredPaymentMethodId) && Objects.equals(this.threeDS2SdkVersion, googlePayDetails.threeDS2SdkVersion) - && Objects.equals(this.type, googlePayDetails.type); + && Objects.equals(this.isSetThreeDS2SdkVersion, googlePayDetails.isSetThreeDS2SdkVersion) + && Objects.equals(this.type, googlePayDetails.type) + && Objects.equals(this.isSetType, googlePayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, googlePayCardNetwork, + isSetGooglePayCardNetwork, googlePayToken, + isSetGooglePayToken, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, threeDS2SdkVersion, - type); + isSetThreeDS2SdkVersion, + type, + isSetType); } @Override @@ -555,6 +651,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayCardNetwork) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_CARD_NETWORK, this.googlePayCardNetwork); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GooglePayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/GooglePayDonations.java b/src/main/java/com/adyen/model/checkout/GooglePayDonations.java index 825b39743..90892f87a 100644 --- a/src/main/java/com/adyen/model/checkout/GooglePayDonations.java +++ b/src/main/java/com/adyen/model/checkout/GooglePayDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,6 +39,9 @@ public class GooglePayDonations { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -44,7 +49,9 @@ public class GooglePayDonations { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -84,25 +91,46 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_CARD_NETWORK = "googlePayCardNetwork"; private String googlePayCardNetwork; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayCardNetwork = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **googlepay**, **paywithgoogle** */ public enum TypeEnum { GOOGLEPAY(String.valueOf("googlepay")); @@ -145,6 +173,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public GooglePayDonations() {} /** @@ -155,6 +192,7 @@ public GooglePayDonations() {} */ public GooglePayDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -178,6 +216,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +230,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public GooglePayDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -220,6 +260,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +271,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public GooglePayDonations googlePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set return this; } @@ -253,6 +295,7 @@ public String getGooglePayCardNetwork() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayCardNetwork(String googlePayCardNetwork) { this.googlePayCardNetwork = googlePayCardNetwork; + isSetGooglePayCardNetwork = true; // mark as set } /** @@ -267,6 +310,7 @@ public void setGooglePayCardNetwork(String googlePayCardNetwork) { */ public GooglePayDonations googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -298,6 +342,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -312,6 +357,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public GooglePayDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -343,6 +389,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -353,6 +400,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public GooglePayDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -377,6 +425,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -389,6 +438,7 @@ public void setSdkData(String sdkData) { */ public GooglePayDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -416,6 +466,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -427,6 +478,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public GooglePayDonations threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -452,6 +504,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -462,6 +515,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public GooglePayDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -485,6 +539,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public GooglePayDonations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this GooglePayDonations object is equal to o. */ @@ -498,29 +573,50 @@ public boolean equals(Object o) { } GooglePayDonations googlePayDonations = (GooglePayDonations) o; return Objects.equals(this.checkoutAttemptId, googlePayDonations.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, googlePayDonations.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, googlePayDonations.fundingSource) + && Objects.equals(this.isSetFundingSource, googlePayDonations.isSetFundingSource) && Objects.equals(this.googlePayCardNetwork, googlePayDonations.googlePayCardNetwork) + && Objects.equals( + this.isSetGooglePayCardNetwork, googlePayDonations.isSetGooglePayCardNetwork) && Objects.equals(this.googlePayToken, googlePayDonations.googlePayToken) + && Objects.equals(this.isSetGooglePayToken, googlePayDonations.isSetGooglePayToken) && Objects.equals( this.recurringDetailReference, googlePayDonations.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, googlePayDonations.isSetRecurringDetailReference) && Objects.equals(this.sdkData, googlePayDonations.sdkData) + && Objects.equals(this.isSetSdkData, googlePayDonations.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, googlePayDonations.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, googlePayDonations.isSetStoredPaymentMethodId) && Objects.equals(this.threeDS2SdkVersion, googlePayDonations.threeDS2SdkVersion) - && Objects.equals(this.type, googlePayDonations.type); + && Objects.equals(this.isSetThreeDS2SdkVersion, googlePayDonations.isSetThreeDS2SdkVersion) + && Objects.equals(this.type, googlePayDonations.type) + && Objects.equals(this.isSetType, googlePayDonations.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, googlePayCardNetwork, + isSetGooglePayCardNetwork, googlePayToken, + isSetGooglePayToken, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, threeDS2SdkVersion, - type); + isSetThreeDS2SdkVersion, + type, + isSetType); } @Override @@ -556,6 +652,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayCardNetwork) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_CARD_NETWORK, this.googlePayCardNetwork); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of GooglePayDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/IdealDetails.java b/src/main/java/com/adyen/model/checkout/IdealDetails.java index 02327e6fe..6c152cc09 100644 --- a/src/main/java/com/adyen/model/checkout/IdealDetails.java +++ b/src/main/java/com/adyen/model/checkout/IdealDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class IdealDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ideal** */ public enum TypeEnum { IDEAL(String.valueOf("ideal")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IdealDetails() {} /** @@ -99,6 +125,7 @@ public IdealDetails() {} */ public IdealDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -134,6 +162,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public IdealDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -161,6 +190,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -175,6 +205,7 @@ public void setIssuer(String issuer) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public IdealDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -206,6 +237,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -216,6 +248,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public IdealDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -252,6 +286,7 @@ public void setSdkData(String sdkData) { */ public IdealDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -279,6 +314,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -289,6 +325,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public IdealDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -312,6 +349,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IdealDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IdealDetails object is equal to o. */ @@ -325,17 +383,35 @@ public boolean equals(Object o) { } IdealDetails idealDetails = (IdealDetails) o; return Objects.equals(this.checkoutAttemptId, idealDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, idealDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, idealDetails.issuer) + && Objects.equals(this.isSetIssuer, idealDetails.isSetIssuer) && Objects.equals(this.recurringDetailReference, idealDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, idealDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, idealDetails.sdkData) + && Objects.equals(this.isSetSdkData, idealDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, idealDetails.storedPaymentMethodId) - && Objects.equals(this.type, idealDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, idealDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, idealDetails.type) + && Objects.equals(this.isSetType, idealDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, issuer, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -366,6 +442,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IdealDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/IdealDonations.java b/src/main/java/com/adyen/model/checkout/IdealDonations.java index 9db35edf2..4f6e93576 100644 --- a/src/main/java/com/adyen/model/checkout/IdealDonations.java +++ b/src/main/java/com/adyen/model/checkout/IdealDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class IdealDonations { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ideal** */ public enum TypeEnum { IDEAL(String.valueOf("ideal")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public IdealDonations() {} /** @@ -99,6 +125,7 @@ public IdealDonations() {} */ public IdealDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -134,6 +162,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public IdealDonations issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -161,6 +190,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -175,6 +205,7 @@ public void setIssuer(String issuer) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public IdealDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -206,6 +237,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -216,6 +248,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public IdealDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -252,6 +286,7 @@ public void setSdkData(String sdkData) { */ public IdealDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -279,6 +314,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -289,6 +325,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public IdealDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -312,6 +349,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public IdealDonations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this IdealDonations object is equal to o. */ @@ -325,17 +383,36 @@ public boolean equals(Object o) { } IdealDonations idealDonations = (IdealDonations) o; return Objects.equals(this.checkoutAttemptId, idealDonations.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, idealDonations.isSetCheckoutAttemptId) && Objects.equals(this.issuer, idealDonations.issuer) + && Objects.equals(this.isSetIssuer, idealDonations.isSetIssuer) && Objects.equals(this.recurringDetailReference, idealDonations.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, idealDonations.isSetRecurringDetailReference) && Objects.equals(this.sdkData, idealDonations.sdkData) + && Objects.equals(this.isSetSdkData, idealDonations.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, idealDonations.storedPaymentMethodId) - && Objects.equals(this.type, idealDonations.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, idealDonations.isSetStoredPaymentMethodId) + && Objects.equals(this.type, idealDonations.type) + && Objects.equals(this.isSetType, idealDonations.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, issuer, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -366,6 +443,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of IdealDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/InputDetail.java b/src/main/java/com/adyen/model/checkout/InputDetail.java index efb11c939..ec6195fd2 100644 --- a/src/main/java/com/adyen/model/checkout/InputDetail.java +++ b/src/main/java/com/adyen/model/checkout/InputDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,31 +39,64 @@ public class InputDetail { public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private Map configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_DETAILS = "details"; private List details; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetails = false; + public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails"; @Deprecated // deprecated private List inputDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputDetails = false; + public static final String JSON_PROPERTY_ITEM_SEARCH_URL = "itemSearchUrl"; private String itemSearchUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemSearchUrl = false; + public static final String JSON_PROPERTY_ITEMS = "items"; private List items; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItems = false; + public static final String JSON_PROPERTY_KEY = "key"; private String key; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKey = false; + public static final String JSON_PROPERTY_OPTIONAL = "optional"; private Boolean optional; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOptional = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InputDetail() {} /** @@ -72,6 +107,7 @@ public InputDetail() {} */ public InputDetail configuration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -103,6 +139,7 @@ public Map getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -113,6 +150,7 @@ public void setConfiguration(Map configuration) { */ public InputDetail details(List details) { this.details = details; + isSetDetails = true; // mark as set return this; } @@ -144,6 +182,7 @@ public List getDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetails(List details) { this.details = details; + isSetDetails = true; // mark as set } /** @@ -156,6 +195,7 @@ public void setDetails(List details) { @Deprecated // deprecated public InputDetail inputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set return this; } @@ -191,6 +231,7 @@ public List getInputDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set } /** @@ -201,6 +242,7 @@ public void setInputDetails(List inputDetails) { */ public InputDetail itemSearchUrl(String itemSearchUrl) { this.itemSearchUrl = itemSearchUrl; + isSetItemSearchUrl = true; // mark as set return this; } @@ -224,6 +266,7 @@ public String getItemSearchUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemSearchUrl(String itemSearchUrl) { this.itemSearchUrl = itemSearchUrl; + isSetItemSearchUrl = true; // mark as set } /** @@ -234,6 +277,7 @@ public void setItemSearchUrl(String itemSearchUrl) { */ public InputDetail items(List items) { this.items = items; + isSetItems = true; // mark as set return this; } @@ -265,6 +309,7 @@ public List getItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItems(List items) { this.items = items; + isSetItems = true; // mark as set } /** @@ -275,6 +320,7 @@ public void setItems(List items) { */ public InputDetail key(String key) { this.key = key; + isSetKey = true; // mark as set return this; } @@ -298,6 +344,7 @@ public String getKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setKey(String key) { this.key = key; + isSetKey = true; // mark as set } /** @@ -308,6 +355,7 @@ public void setKey(String key) { */ public InputDetail optional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set return this; } @@ -331,6 +379,7 @@ public Boolean getOptional() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOptional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set } /** @@ -341,6 +390,7 @@ public void setOptional(Boolean optional) { */ public InputDetail type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -364,6 +414,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -374,6 +425,7 @@ public void setType(String type) { */ public InputDetail value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -397,6 +449,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InputDetail includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InputDetail object is equal to o. */ @@ -410,20 +483,46 @@ public boolean equals(Object o) { } InputDetail inputDetail = (InputDetail) o; return Objects.equals(this.configuration, inputDetail.configuration) + && Objects.equals(this.isSetConfiguration, inputDetail.isSetConfiguration) && Objects.equals(this.details, inputDetail.details) + && Objects.equals(this.isSetDetails, inputDetail.isSetDetails) && Objects.equals(this.inputDetails, inputDetail.inputDetails) + && Objects.equals(this.isSetInputDetails, inputDetail.isSetInputDetails) && Objects.equals(this.itemSearchUrl, inputDetail.itemSearchUrl) + && Objects.equals(this.isSetItemSearchUrl, inputDetail.isSetItemSearchUrl) && Objects.equals(this.items, inputDetail.items) + && Objects.equals(this.isSetItems, inputDetail.isSetItems) && Objects.equals(this.key, inputDetail.key) + && Objects.equals(this.isSetKey, inputDetail.isSetKey) && Objects.equals(this.optional, inputDetail.optional) + && Objects.equals(this.isSetOptional, inputDetail.isSetOptional) && Objects.equals(this.type, inputDetail.type) - && Objects.equals(this.value, inputDetail.value); + && Objects.equals(this.isSetType, inputDetail.isSetType) + && Objects.equals(this.value, inputDetail.value) + && Objects.equals(this.isSetValue, inputDetail.isSetValue); } @Override public int hashCode() { return Objects.hash( - configuration, details, inputDetails, itemSearchUrl, items, key, optional, type, value); + configuration, + isSetConfiguration, + details, + isSetDetails, + inputDetails, + isSetInputDetails, + itemSearchUrl, + isSetItemSearchUrl, + items, + isSetItems, + key, + isSetKey, + optional, + isSetOptional, + type, + isSetType, + value, + isSetValue); } @Override @@ -453,6 +552,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetDetails) { + addIfNull(nulls, JSON_PROPERTY_DETAILS, this.details); + } + if (isSetInputDetails) { + addIfNull(nulls, JSON_PROPERTY_INPUT_DETAILS, this.inputDetails); + } + if (isSetItemSearchUrl) { + addIfNull(nulls, JSON_PROPERTY_ITEM_SEARCH_URL, this.itemSearchUrl); + } + if (isSetItems) { + addIfNull(nulls, JSON_PROPERTY_ITEMS, this.items); + } + if (isSetKey) { + addIfNull(nulls, JSON_PROPERTY_KEY, this.key); + } + if (isSetOptional) { + addIfNull(nulls, JSON_PROPERTY_OPTIONAL, this.optional); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InputDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/InstallmentOption.java b/src/main/java/com/adyen/model/checkout/InstallmentOption.java index 93ecc477e..b25e42f32 100644 --- a/src/main/java/com/adyen/model/checkout/InstallmentOption.java +++ b/src/main/java/com/adyen/model/checkout/InstallmentOption.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,6 +36,9 @@ public class InstallmentOption { public static final String JSON_PROPERTY_MAX_VALUE = "maxValue"; private Integer maxValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaxValue = false; + /** Gets or Sets plans */ public enum PlansEnum { BONUS(String.valueOf("bonus")), @@ -94,12 +99,27 @@ public static PlansEnum fromValue(String value) { public static final String JSON_PROPERTY_PLANS = "plans"; private List plans; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlans = false; + public static final String JSON_PROPERTY_PRESELECTED_VALUE = "preselectedValue"; private Integer preselectedValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreselectedValue = false; + public static final String JSON_PROPERTY_VALUES = "values"; private List values; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValues = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InstallmentOption() {} /** @@ -110,6 +130,7 @@ public InstallmentOption() {} */ public InstallmentOption maxValue(Integer maxValue) { this.maxValue = maxValue; + isSetMaxValue = true; // mark as set return this; } @@ -133,6 +154,7 @@ public Integer getMaxValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxValue(Integer maxValue) { this.maxValue = maxValue; + isSetMaxValue = true; // mark as set } /** @@ -145,6 +167,7 @@ public void setMaxValue(Integer maxValue) { */ public InstallmentOption plans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set return this; } @@ -180,6 +203,7 @@ public List getPlans() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlans(List plans) { this.plans = plans; + isSetPlans = true; // mark as set } /** @@ -190,6 +214,7 @@ public void setPlans(List plans) { */ public InstallmentOption preselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set return this; } @@ -213,6 +238,7 @@ public Integer getPreselectedValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreselectedValue(Integer preselectedValue) { this.preselectedValue = preselectedValue; + isSetPreselectedValue = true; // mark as set } /** @@ -225,6 +251,7 @@ public void setPreselectedValue(Integer preselectedValue) { */ public InstallmentOption values(List values) { this.values = values; + isSetValues = true; // mark as set return this; } @@ -260,6 +287,27 @@ public List getValues() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValues(List values) { this.values = values; + isSetValues = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InstallmentOption includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InstallmentOption object is equal to o. */ @@ -273,14 +321,26 @@ public boolean equals(Object o) { } InstallmentOption installmentOption = (InstallmentOption) o; return Objects.equals(this.maxValue, installmentOption.maxValue) + && Objects.equals(this.isSetMaxValue, installmentOption.isSetMaxValue) && Objects.equals(this.plans, installmentOption.plans) + && Objects.equals(this.isSetPlans, installmentOption.isSetPlans) && Objects.equals(this.preselectedValue, installmentOption.preselectedValue) - && Objects.equals(this.values, installmentOption.values); + && Objects.equals(this.isSetPreselectedValue, installmentOption.isSetPreselectedValue) + && Objects.equals(this.values, installmentOption.values) + && Objects.equals(this.isSetValues, installmentOption.isSetValues); } @Override public int hashCode() { - return Objects.hash(maxValue, plans, preselectedValue, values); + return Objects.hash( + maxValue, + isSetMaxValue, + plans, + isSetPlans, + preselectedValue, + isSetPreselectedValue, + values, + isSetValues); } @Override @@ -305,6 +365,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMaxValue) { + addIfNull(nulls, JSON_PROPERTY_MAX_VALUE, this.maxValue); + } + if (isSetPlans) { + addIfNull(nulls, JSON_PROPERTY_PLANS, this.plans); + } + if (isSetPreselectedValue) { + addIfNull(nulls, JSON_PROPERTY_PRESELECTED_VALUE, this.preselectedValue); + } + if (isSetValues) { + addIfNull(nulls, JSON_PROPERTY_VALUES, this.values); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InstallmentOption given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Installments.java b/src/main/java/com/adyen/model/checkout/Installments.java index aadb2e868..807ef8379 100644 --- a/src/main/java/com/adyen/model/checkout/Installments.java +++ b/src/main/java/com/adyen/model/checkout/Installments.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class Installments { public static final String JSON_PROPERTY_EXTRA = "extra"; private Integer extra; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExtra = false; + /** * The installment plan, used for [card installments in * Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). @@ -97,9 +102,21 @@ public static PlanEnum fromValue(String value) { public static final String JSON_PROPERTY_PLAN = "plan"; private PlanEnum plan; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlan = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Integer value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Installments() {} /** @@ -114,6 +131,7 @@ public Installments() {} */ public Installments extra(Integer extra) { this.extra = extra; + isSetExtra = true; // mark as set return this; } @@ -145,6 +163,7 @@ public Integer getExtra() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtra(Integer extra) { this.extra = extra; + isSetExtra = true; // mark as set } /** @@ -163,6 +182,7 @@ public void setExtra(Integer extra) { */ public Installments plan(PlanEnum plan) { this.plan = plan; + isSetPlan = true; // mark as set return this; } @@ -202,6 +222,7 @@ public PlanEnum getPlan() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlan(PlanEnum plan) { this.plan = plan; + isSetPlan = true; // mark as set } /** @@ -218,6 +239,7 @@ public void setPlan(PlanEnum plan) { */ public Installments value(Integer value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -253,6 +275,27 @@ public Integer getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Integer value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Installments includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Installments object is equal to o. */ @@ -266,13 +309,16 @@ public boolean equals(Object o) { } Installments installments = (Installments) o; return Objects.equals(this.extra, installments.extra) + && Objects.equals(this.isSetExtra, installments.isSetExtra) && Objects.equals(this.plan, installments.plan) - && Objects.equals(this.value, installments.value); + && Objects.equals(this.isSetPlan, installments.isSetPlan) + && Objects.equals(this.value, installments.value) + && Objects.equals(this.isSetValue, installments.isSetValue); } @Override public int hashCode() { - return Objects.hash(extra, plan, value); + return Objects.hash(extra, isSetExtra, plan, isSetPlan, value, isSetValue); } @Override @@ -296,6 +342,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetExtra) { + addIfNull(nulls, JSON_PROPERTY_EXTRA, this.extra); + } + if (isSetPlan) { + addIfNull(nulls, JSON_PROPERTY_PLAN, this.plan); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Installments given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/InvalidField.java b/src/main/java/com/adyen/model/checkout/InvalidField.java index 715211f87..799f9f6b3 100644 --- a/src/main/java/com/adyen/model/checkout/InvalidField.java +++ b/src/main/java/com/adyen/model/checkout/InvalidField.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class InvalidField { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public InvalidField() {} /** @@ -43,6 +60,7 @@ public InvalidField() {} */ public InvalidField name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setName(String name) { */ public InvalidField value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setValue(String value) { */ public InvalidField message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this InvalidField object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } InvalidField invalidField = (InvalidField) o; return Objects.equals(this.name, invalidField.name) + && Objects.equals(this.isSetName, invalidField.isSetName) && Objects.equals(this.value, invalidField.value) - && Objects.equals(this.message, invalidField.message); + && Objects.equals(this.isSetValue, invalidField.isSetValue) + && Objects.equals(this.message, invalidField.message) + && Objects.equals(this.isSetMessage, invalidField.isSetMessage); } @Override public int hashCode() { - return Objects.hash(name, value, message); + return Objects.hash(name, isSetName, value, isSetValue, message, isSetMessage); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of InvalidField given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Item.java b/src/main/java/com/adyen/model/checkout/Item.java index 49ba2aae0..e6e026015 100644 --- a/src/main/java/com/adyen/model/checkout/Item.java +++ b/src/main/java/com/adyen/model/checkout/Item.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Item { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Item() {} /** @@ -36,6 +50,7 @@ public Item() {} */ public Item id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setId(String id) { */ public Item name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Item includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Item object is equal to o. */ @@ -104,12 +142,15 @@ public boolean equals(Object o) { return false; } Item item = (Item) o; - return Objects.equals(this.id, item.id) && Objects.equals(this.name, item.name); + return Objects.equals(this.id, item.id) + && Objects.equals(this.isSetId, item.isSetId) + && Objects.equals(this.name, item.name) + && Objects.equals(this.isSetName, item.isSetName); } @Override public int hashCode() { - return Objects.hash(id, name); + return Objects.hash(id, isSetId, name, isSetName); } @Override @@ -132,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Item given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ItemDetailLine.java b/src/main/java/com/adyen/model/checkout/ItemDetailLine.java new file mode 100644 index 000000000..cea39d685 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/ItemDetailLine.java @@ -0,0 +1,664 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** ItemDetailLine */ +@JsonPropertyOrder({ + ItemDetailLine.JSON_PROPERTY_COMMODITY_CODE, + ItemDetailLine.JSON_PROPERTY_DESCRIPTION, + ItemDetailLine.JSON_PROPERTY_DISCOUNT_AMOUNT, + ItemDetailLine.JSON_PROPERTY_PRODUCT_CODE, + ItemDetailLine.JSON_PROPERTY_QUANTITY, + ItemDetailLine.JSON_PROPERTY_TOTAL_AMOUNT, + ItemDetailLine.JSON_PROPERTY_UNIT_OF_MEASURE, + ItemDetailLine.JSON_PROPERTY_UNIT_PRICE +}) +public class ItemDetailLine { + public static final String JSON_PROPERTY_COMMODITY_CODE = "commodityCode"; + private String commodityCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCommodityCode = false; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + + public static final String JSON_PROPERTY_DISCOUNT_AMOUNT = "discountAmount"; + private Long discountAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDiscountAmount = false; + + public static final String JSON_PROPERTY_PRODUCT_CODE = "productCode"; + private String productCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProductCode = false; + + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Long quantity; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetQuantity = false; + + public static final String JSON_PROPERTY_TOTAL_AMOUNT = "totalAmount"; + private Long totalAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalAmount = false; + + public static final String JSON_PROPERTY_UNIT_OF_MEASURE = "unitOfMeasure"; + private String unitOfMeasure; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnitOfMeasure = false; + + public static final String JSON_PROPERTY_UNIT_PRICE = "unitPrice"; + private Long unitPrice; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUnitPrice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public ItemDetailLine() {} + + /** + * The code that identifies the item in a standardized commodity coding scheme. There are + * different commodity coding schemes: * [UNSPSC commodity + * codes](https://www.ungm.org/public/unspsc) * [HS commodity + * codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity + * codes](https://www.census.gov/naics/) * [NAPCS commodity + * codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * + * Must not start with a space or be all spaces. * Must not be all zeros. + * + * @param commodityCode The code that identifies the item in a standardized commodity coding + * scheme. There are different commodity coding schemes: * [UNSPSC commodity + * codes](https://www.ungm.org/public/unspsc) * [HS commodity + * codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity + * codes](https://www.census.gov/naics/) * [NAPCS commodity + * codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * + * Must not start with a space or be all spaces. * Must not be all zeros. + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine commodityCode(String commodityCode) { + this.commodityCode = commodityCode; + isSetCommodityCode = true; // mark as set + return this; + } + + /** + * The code that identifies the item in a standardized commodity coding scheme. There are + * different commodity coding schemes: * [UNSPSC commodity + * codes](https://www.ungm.org/public/unspsc) * [HS commodity + * codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity + * codes](https://www.census.gov/naics/) * [NAPCS commodity + * codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * + * Must not start with a space or be all spaces. * Must not be all zeros. + * + * @return commodityCode The code that identifies the item in a standardized commodity coding + * scheme. There are different commodity coding schemes: * [UNSPSC commodity + * codes](https://www.ungm.org/public/unspsc) * [HS commodity + * codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity + * codes](https://www.census.gov/naics/) * [NAPCS commodity + * codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * + * Must not start with a space or be all spaces. * Must not be all zeros. + */ + @JsonProperty(JSON_PROPERTY_COMMODITY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCommodityCode() { + return commodityCode; + } + + /** + * The code that identifies the item in a standardized commodity coding scheme. There are + * different commodity coding schemes: * [UNSPSC commodity + * codes](https://www.ungm.org/public/unspsc) * [HS commodity + * codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity + * codes](https://www.census.gov/naics/) * [NAPCS commodity + * codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * + * Must not start with a space or be all spaces. * Must not be all zeros. + * + * @param commodityCode The code that identifies the item in a standardized commodity coding + * scheme. There are different commodity coding schemes: * [UNSPSC commodity + * codes](https://www.ungm.org/public/unspsc) * [HS commodity + * codes](https://www.wcoomd.org/en/topics/nomenclature/overview.aspx) * [NAICS commodity + * codes](https://www.census.gov/naics/) * [NAPCS commodity + * codes](https://www.census.gov/naics/napcs/) * Encoding: ASCII * Max length: 12 characters * + * Must not start with a space or be all spaces. * Must not be all zeros. + */ + @JsonProperty(JSON_PROPERTY_COMMODITY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + isSetCommodityCode = true; // mark as set + } + + /** + * A description of the item, that provides details about the purchase. For Visa transactions with + * level 3 ESD, the description must not be the same or very similar to your merchant name, or, + * consist only of common words like \"product\", or \"service\". * Encoding: + * ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must + * not be all special characters. * Must not start with a space or be all spaces. * Must not be + * all zeros. + * + * @param description A description of the item, that provides details about the purchase. For + * Visa transactions with level 3 ESD, the description must not be the same or very similar to + * your merchant name, or, consist only of common words like \"product\", or + * \"service\". * Encoding: ASCII * Max length: 26 characters * Must not be a single + * character. * Must not be blank. * Must not be all special characters. * Must not start with + * a space or be all spaces. * Must not be all zeros. + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine description(String description) { + this.description = description; + isSetDescription = true; // mark as set + return this; + } + + /** + * A description of the item, that provides details about the purchase. For Visa transactions with + * level 3 ESD, the description must not be the same or very similar to your merchant name, or, + * consist only of common words like \"product\", or \"service\". * Encoding: + * ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must + * not be all special characters. * Must not start with a space or be all spaces. * Must not be + * all zeros. + * + * @return description A description of the item, that provides details about the purchase. For + * Visa transactions with level 3 ESD, the description must not be the same or very similar to + * your merchant name, or, consist only of common words like \"product\", or + * \"service\". * Encoding: ASCII * Max length: 26 characters * Must not be a single + * character. * Must not be blank. * Must not be all special characters. * Must not start with + * a space or be all spaces. * Must not be all zeros. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + /** + * A description of the item, that provides details about the purchase. For Visa transactions with + * level 3 ESD, the description must not be the same or very similar to your merchant name, or, + * consist only of common words like \"product\", or \"service\". * Encoding: + * ASCII * Max length: 26 characters * Must not be a single character. * Must not be blank. * Must + * not be all special characters. * Must not start with a space or be all spaces. * Must not be + * all zeros. + * + * @param description A description of the item, that provides details about the purchase. For + * Visa transactions with level 3 ESD, the description must not be the same or very similar to + * your merchant name, or, consist only of common words like \"product\", or + * \"service\". * Encoding: ASCII * Max length: 26 characters * Must not be a single + * character. * Must not be blank. * Must not be all special characters. * Must not start with + * a space or be all spaces. * Must not be all zeros. + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDescription(String description) { + this.description = description; + isSetDescription = true; // mark as set + } + + /** + * The discount amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param discountAmount The discount amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine discountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + isSetDiscountAmount = true; // mark as set + return this; + } + + /** + * The discount amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @return discountAmount The discount amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_DISCOUNT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDiscountAmount() { + return discountAmount; + } + + /** + * The discount amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param discountAmount The discount amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_DISCOUNT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + isSetDiscountAmount = true; // mark as set + } + + /** + * The product code. Must be a unique product code associated with the item or service. This can + * be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * + * Max length: 12 characters + * + * @param productCode The product code. Must be a unique product code associated with the item or + * service. This can be your unique code for the item, or the manufacturer's product code. + * * Encoding: ASCII. * Max length: 12 characters + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine productCode(String productCode) { + this.productCode = productCode; + isSetProductCode = true; // mark as set + return this; + } + + /** + * The product code. Must be a unique product code associated with the item or service. This can + * be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * + * Max length: 12 characters + * + * @return productCode The product code. Must be a unique product code associated with the item or + * service. This can be your unique code for the item, or the manufacturer's product code. + * * Encoding: ASCII. * Max length: 12 characters + */ + @JsonProperty(JSON_PROPERTY_PRODUCT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProductCode() { + return productCode; + } + + /** + * The product code. Must be a unique product code associated with the item or service. This can + * be your unique code for the item, or the manufacturer's product code. * Encoding: ASCII. * + * Max length: 12 characters + * + * @param productCode The product code. Must be a unique product code associated with the item or + * service. This can be your unique code for the item, or the manufacturer's product code. + * * Encoding: ASCII. * Max length: 12 characters + */ + @JsonProperty(JSON_PROPERTY_PRODUCT_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProductCode(String productCode) { + this.productCode = productCode; + isSetProductCode = true; // mark as set + } + + /** + * The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max value: + * 9999 + * + * @param quantity The number of items. Must be an integer greater than zero. * Encoding: Numeric + * * Max value: 9999 + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine quantity(Long quantity) { + this.quantity = quantity; + isSetQuantity = true; // mark as set + return this; + } + + /** + * The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max value: + * 9999 + * + * @return quantity The number of items. Must be an integer greater than zero. * Encoding: Numeric + * * Max value: 9999 + */ + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getQuantity() { + return quantity; + } + + /** + * The number of items. Must be an integer greater than zero. * Encoding: Numeric * Max value: + * 9999 + * + * @param quantity The number of items. Must be an integer greater than zero. * Encoding: Numeric + * * Max value: 9999 + */ + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Long quantity) { + this.quantity = quantity; + isSetQuantity = true; // mark as set + } + + /** + * The total amount for the line item, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 See [Amount requirements for level 2/3 + * ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) + * to learn more about how to calculate the line item total. + * + * @param totalAmount The total amount for the line item, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 See [Amount requirements for + * level 2/3 + * ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) + * to learn more about how to calculate the line item total. + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine totalAmount(Long totalAmount) { + this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set + return this; + } + + /** + * The total amount for the line item, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 See [Amount requirements for level 2/3 + * ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) + * to learn more about how to calculate the line item total. + * + * @return totalAmount The total amount for the line item, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 See [Amount requirements for + * level 2/3 + * ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) + * to learn more about how to calculate the line item total. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalAmount() { + return totalAmount; + } + + /** + * The total amount for the line item, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 See [Amount requirements for level 2/3 + * ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) + * to learn more about how to calculate the line item total. + * + * @param totalAmount The total amount for the line item, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 See [Amount requirements for + * level 2/3 + * ESD](https://docs.adyen.com//payment-methods/cards/enhanced-scheme-data/l2-l3#amount-requirements) + * to learn more about how to calculate the line item total. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalAmount(Long totalAmount) { + this.totalAmount = totalAmount; + isSetTotalAmount = true; // mark as set + } + + /** + * The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters + * + * @param unitOfMeasure The unit of measurement for an item. * Encoding: ASCII * Max length: 3 + * characters + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine unitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + isSetUnitOfMeasure = true; // mark as set + return this; + } + + /** + * The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters + * + * @return unitOfMeasure The unit of measurement for an item. * Encoding: ASCII * Max length: 3 + * characters + */ + @JsonProperty(JSON_PROPERTY_UNIT_OF_MEASURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUnitOfMeasure() { + return unitOfMeasure; + } + + /** + * The unit of measurement for an item. * Encoding: ASCII * Max length: 3 characters + * + * @param unitOfMeasure The unit of measurement for an item. * Encoding: ASCII * Max length: 3 + * characters + */ + @JsonProperty(JSON_PROPERTY_UNIT_OF_MEASURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + isSetUnitOfMeasure = true; // mark as set + } + + /** + * The unit price, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * * For example, 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param unitPrice The unit price, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * @return the current {@code ItemDetailLine} instance, allowing for method chaining + */ + public ItemDetailLine unitPrice(Long unitPrice) { + this.unitPrice = unitPrice; + isSetUnitPrice = true; // mark as set + return this; + } + + /** + * The unit price, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * * For example, 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @return unitPrice The unit price, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_UNIT_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getUnitPrice() { + return unitPrice; + } + + /** + * The unit price, in [minor units](https://docs.adyen.com/development-resources/currency-codes). + * * For example, 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param unitPrice The unit price, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_UNIT_PRICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUnitPrice(Long unitPrice) { + this.unitPrice = unitPrice; + isSetUnitPrice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ItemDetailLine includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this ItemDetailLine object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ItemDetailLine itemDetailLine = (ItemDetailLine) o; + return Objects.equals(this.commodityCode, itemDetailLine.commodityCode) + && Objects.equals(this.isSetCommodityCode, itemDetailLine.isSetCommodityCode) + && Objects.equals(this.description, itemDetailLine.description) + && Objects.equals(this.isSetDescription, itemDetailLine.isSetDescription) + && Objects.equals(this.discountAmount, itemDetailLine.discountAmount) + && Objects.equals(this.isSetDiscountAmount, itemDetailLine.isSetDiscountAmount) + && Objects.equals(this.productCode, itemDetailLine.productCode) + && Objects.equals(this.isSetProductCode, itemDetailLine.isSetProductCode) + && Objects.equals(this.quantity, itemDetailLine.quantity) + && Objects.equals(this.isSetQuantity, itemDetailLine.isSetQuantity) + && Objects.equals(this.totalAmount, itemDetailLine.totalAmount) + && Objects.equals(this.isSetTotalAmount, itemDetailLine.isSetTotalAmount) + && Objects.equals(this.unitOfMeasure, itemDetailLine.unitOfMeasure) + && Objects.equals(this.isSetUnitOfMeasure, itemDetailLine.isSetUnitOfMeasure) + && Objects.equals(this.unitPrice, itemDetailLine.unitPrice) + && Objects.equals(this.isSetUnitPrice, itemDetailLine.isSetUnitPrice); + } + + @Override + public int hashCode() { + return Objects.hash( + commodityCode, + isSetCommodityCode, + description, + isSetDescription, + discountAmount, + isSetDiscountAmount, + productCode, + isSetProductCode, + quantity, + isSetQuantity, + totalAmount, + isSetTotalAmount, + unitOfMeasure, + isSetUnitOfMeasure, + unitPrice, + isSetUnitPrice); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ItemDetailLine {\n"); + sb.append(" commodityCode: ").append(toIndentedString(commodityCode)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" discountAmount: ").append(toIndentedString(discountAmount)).append("\n"); + sb.append(" productCode: ").append(toIndentedString(productCode)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" totalAmount: ").append(toIndentedString(totalAmount)).append("\n"); + sb.append(" unitOfMeasure: ").append(toIndentedString(unitOfMeasure)).append("\n"); + sb.append(" unitPrice: ").append(toIndentedString(unitPrice)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCommodityCode) { + addIfNull(nulls, JSON_PROPERTY_COMMODITY_CODE, this.commodityCode); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetDiscountAmount) { + addIfNull(nulls, JSON_PROPERTY_DISCOUNT_AMOUNT, this.discountAmount); + } + if (isSetProductCode) { + addIfNull(nulls, JSON_PROPERTY_PRODUCT_CODE, this.productCode); + } + if (isSetQuantity) { + addIfNull(nulls, JSON_PROPERTY_QUANTITY, this.quantity); + } + if (isSetTotalAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_AMOUNT, this.totalAmount); + } + if (isSetUnitOfMeasure) { + addIfNull(nulls, JSON_PROPERTY_UNIT_OF_MEASURE, this.unitOfMeasure); + } + if (isSetUnitPrice) { + addIfNull(nulls, JSON_PROPERTY_UNIT_PRICE, this.unitPrice); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of ItemDetailLine given an JSON string + * + * @param jsonString JSON string + * @return An instance of ItemDetailLine + * @throws JsonProcessingException if the JSON string is invalid with respect to ItemDetailLine + */ + public static ItemDetailLine fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, ItemDetailLine.class); + } + + /** + * Convert an instance of ItemDetailLine to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java index 8ce91db46..743e29ae4 100644 --- a/src/main/java/com/adyen/model/checkout/KlarnaDetails.java +++ b/src/main/java/com/adyen/model/checkout/KlarnaDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,28 +39,52 @@ public class KlarnaDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** **klarna** */ public enum TypeEnum { KLARNA(String.valueOf("klarna")), @@ -113,6 +139,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public KlarnaDetails() {} /** @@ -123,6 +158,7 @@ public KlarnaDetails() {} */ public KlarnaDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -146,6 +182,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -156,6 +193,7 @@ public void setBillingAddress(String billingAddress) { */ public KlarnaDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -179,6 +217,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -189,6 +228,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public KlarnaDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -212,6 +252,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -222,6 +263,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public KlarnaDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -245,6 +287,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -259,6 +302,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public KlarnaDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -290,6 +334,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -300,6 +345,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public KlarnaDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -324,6 +370,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -336,6 +383,7 @@ public void setSdkData(String sdkData) { */ public KlarnaDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -363,6 +411,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -373,6 +422,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public KlarnaDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -396,6 +446,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -406,6 +457,7 @@ public void setSubtype(String subtype) { */ public KlarnaDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -429,6 +481,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public KlarnaDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this KlarnaDetails object is equal to o. */ @@ -442,28 +515,47 @@ public boolean equals(Object o) { } KlarnaDetails klarnaDetails = (KlarnaDetails) o; return Objects.equals(this.billingAddress, klarnaDetails.billingAddress) + && Objects.equals(this.isSetBillingAddress, klarnaDetails.isSetBillingAddress) && Objects.equals(this.checkoutAttemptId, klarnaDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, klarnaDetails.isSetCheckoutAttemptId) && Objects.equals(this.deliveryAddress, klarnaDetails.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, klarnaDetails.isSetDeliveryAddress) && Objects.equals(this.personalDetails, klarnaDetails.personalDetails) + && Objects.equals(this.isSetPersonalDetails, klarnaDetails.isSetPersonalDetails) && Objects.equals(this.recurringDetailReference, klarnaDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, klarnaDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, klarnaDetails.sdkData) + && Objects.equals(this.isSetSdkData, klarnaDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, klarnaDetails.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, klarnaDetails.isSetStoredPaymentMethodId) && Objects.equals(this.subtype, klarnaDetails.subtype) - && Objects.equals(this.type, klarnaDetails.type); + && Objects.equals(this.isSetSubtype, klarnaDetails.isSetSubtype) + && Objects.equals(this.type, klarnaDetails.type) + && Objects.equals(this.isSetType, klarnaDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingAddress, + isSetBillingAddress, checkoutAttemptId, + isSetCheckoutAttemptId, deliveryAddress, + isSetDeliveryAddress, personalDetails, + isSetPersonalDetails, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, subtype, - type); + isSetSubtype, + type, + isSetType); } @Override @@ -497,6 +589,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of KlarnaDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Leg.java b/src/main/java/com/adyen/model/checkout/Leg.java index ded1d82ab..4ef8ab63f 100644 --- a/src/main/java/com/adyen/model/checkout/Leg.java +++ b/src/main/java/com/adyen/model/checkout/Leg.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,30 +36,63 @@ public class Leg { public static final String JSON_PROPERTY_CARRIER_CODE = "carrierCode"; private String carrierCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCarrierCode = false; + public static final String JSON_PROPERTY_CLASS_OF_TRAVEL = "classOfTravel"; private String classOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClassOfTravel = false; + public static final String JSON_PROPERTY_DATE_OF_TRAVEL = "dateOfTravel"; private OffsetDateTime dateOfTravel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfTravel = false; + public static final String JSON_PROPERTY_DEPARTURE_AIRPORT_CODE = "departureAirportCode"; private String departureAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureAirportCode = false; + public static final String JSON_PROPERTY_DEPARTURE_TAX = "departureTax"; private Long departureTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDepartureTax = false; + public static final String JSON_PROPERTY_DESTINATION_AIRPORT_CODE = "destinationAirportCode"; private String destinationAirportCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDestinationAirportCode = false; + public static final String JSON_PROPERTY_FARE_BASIS_CODE = "fareBasisCode"; private String fareBasisCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFareBasisCode = false; + public static final String JSON_PROPERTY_FLIGHT_NUMBER = "flightNumber"; private String flightNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFlightNumber = false; + public static final String JSON_PROPERTY_STOP_OVER_CODE = "stopOverCode"; private String stopOverCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStopOverCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Leg() {} /** @@ -74,6 +109,7 @@ public Leg() {} */ public Leg carrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set return this; } @@ -109,6 +145,7 @@ public String getCarrierCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCarrierCode(String carrierCode) { this.carrierCode = carrierCode; + isSetCarrierCode = true; // mark as set } /** @@ -124,6 +161,7 @@ public void setCarrierCode(String carrierCode) { */ public Leg classOfTravel(String classOfTravel) { this.classOfTravel = classOfTravel; + isSetClassOfTravel = true; // mark as set return this; } @@ -157,6 +195,7 @@ public String getClassOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClassOfTravel(String classOfTravel) { this.classOfTravel = classOfTravel; + isSetClassOfTravel = true; // mark as set } /** @@ -169,6 +208,7 @@ public void setClassOfTravel(String classOfTravel) { */ public Leg dateOfTravel(OffsetDateTime dateOfTravel) { this.dateOfTravel = dateOfTravel; + isSetDateOfTravel = true; // mark as set return this; } @@ -196,6 +236,7 @@ public OffsetDateTime getDateOfTravel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfTravel(OffsetDateTime dateOfTravel) { this.dateOfTravel = dateOfTravel; + isSetDateOfTravel = true; // mark as set } /** @@ -213,6 +254,7 @@ public void setDateOfTravel(OffsetDateTime dateOfTravel) { */ public Leg departureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set return this; } @@ -250,6 +292,7 @@ public String getDepartureAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureAirportCode(String departureAirportCode) { this.departureAirportCode = departureAirportCode; + isSetDepartureAirportCode = true; // mark as set } /** @@ -264,6 +307,7 @@ public void setDepartureAirportCode(String departureAirportCode) { */ public Leg departureTax(Long departureTax) { this.departureTax = departureTax; + isSetDepartureTax = true; // mark as set return this; } @@ -295,6 +339,7 @@ public Long getDepartureTax() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDepartureTax(Long departureTax) { this.departureTax = departureTax; + isSetDepartureTax = true; // mark as set } /** @@ -312,6 +357,7 @@ public void setDepartureTax(Long departureTax) { */ public Leg destinationAirportCode(String destinationAirportCode) { this.destinationAirportCode = destinationAirportCode; + isSetDestinationAirportCode = true; // mark as set return this; } @@ -349,6 +395,7 @@ public String getDestinationAirportCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDestinationAirportCode(String destinationAirportCode) { this.destinationAirportCode = destinationAirportCode; + isSetDestinationAirportCode = true; // mark as set } /** @@ -363,6 +410,7 @@ public void setDestinationAirportCode(String destinationAirportCode) { */ public Leg fareBasisCode(String fareBasisCode) { this.fareBasisCode = fareBasisCode; + isSetFareBasisCode = true; // mark as set return this; } @@ -394,6 +442,7 @@ public String getFareBasisCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFareBasisCode(String fareBasisCode) { this.fareBasisCode = fareBasisCode; + isSetFareBasisCode = true; // mark as set } /** @@ -406,6 +455,7 @@ public void setFareBasisCode(String fareBasisCode) { */ public Leg flightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set return this; } @@ -433,6 +483,7 @@ public String getFlightNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFlightNumber(String flightNumber) { this.flightNumber = flightNumber; + isSetFlightNumber = true; // mark as set } /** @@ -447,6 +498,7 @@ public void setFlightNumber(String flightNumber) { */ public Leg stopOverCode(String stopOverCode) { this.stopOverCode = stopOverCode; + isSetStopOverCode = true; // mark as set return this; } @@ -478,6 +530,27 @@ public String getStopOverCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStopOverCode(String stopOverCode) { this.stopOverCode = stopOverCode; + isSetStopOverCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Leg includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Leg object is equal to o. */ @@ -491,28 +564,46 @@ public boolean equals(Object o) { } Leg leg = (Leg) o; return Objects.equals(this.carrierCode, leg.carrierCode) + && Objects.equals(this.isSetCarrierCode, leg.isSetCarrierCode) && Objects.equals(this.classOfTravel, leg.classOfTravel) + && Objects.equals(this.isSetClassOfTravel, leg.isSetClassOfTravel) && Objects.equals(this.dateOfTravel, leg.dateOfTravel) + && Objects.equals(this.isSetDateOfTravel, leg.isSetDateOfTravel) && Objects.equals(this.departureAirportCode, leg.departureAirportCode) + && Objects.equals(this.isSetDepartureAirportCode, leg.isSetDepartureAirportCode) && Objects.equals(this.departureTax, leg.departureTax) + && Objects.equals(this.isSetDepartureTax, leg.isSetDepartureTax) && Objects.equals(this.destinationAirportCode, leg.destinationAirportCode) + && Objects.equals(this.isSetDestinationAirportCode, leg.isSetDestinationAirportCode) && Objects.equals(this.fareBasisCode, leg.fareBasisCode) + && Objects.equals(this.isSetFareBasisCode, leg.isSetFareBasisCode) && Objects.equals(this.flightNumber, leg.flightNumber) - && Objects.equals(this.stopOverCode, leg.stopOverCode); + && Objects.equals(this.isSetFlightNumber, leg.isSetFlightNumber) + && Objects.equals(this.stopOverCode, leg.stopOverCode) + && Objects.equals(this.isSetStopOverCode, leg.isSetStopOverCode); } @Override public int hashCode() { return Objects.hash( carrierCode, + isSetCarrierCode, classOfTravel, + isSetClassOfTravel, dateOfTravel, + isSetDateOfTravel, departureAirportCode, + isSetDepartureAirportCode, departureTax, + isSetDepartureTax, destinationAirportCode, + isSetDestinationAirportCode, fareBasisCode, + isSetFareBasisCode, flightNumber, - stopOverCode); + isSetFlightNumber, + stopOverCode, + isSetStopOverCode); } @Override @@ -546,6 +637,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCarrierCode) { + addIfNull(nulls, JSON_PROPERTY_CARRIER_CODE, this.carrierCode); + } + if (isSetClassOfTravel) { + addIfNull(nulls, JSON_PROPERTY_CLASS_OF_TRAVEL, this.classOfTravel); + } + if (isSetDateOfTravel) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_TRAVEL, this.dateOfTravel); + } + if (isSetDepartureAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_AIRPORT_CODE, this.departureAirportCode); + } + if (isSetDepartureTax) { + addIfNull(nulls, JSON_PROPERTY_DEPARTURE_TAX, this.departureTax); + } + if (isSetDestinationAirportCode) { + addIfNull(nulls, JSON_PROPERTY_DESTINATION_AIRPORT_CODE, this.destinationAirportCode); + } + if (isSetFareBasisCode) { + addIfNull(nulls, JSON_PROPERTY_FARE_BASIS_CODE, this.fareBasisCode); + } + if (isSetFlightNumber) { + addIfNull(nulls, JSON_PROPERTY_FLIGHT_NUMBER, this.flightNumber); + } + if (isSetStopOverCode) { + addIfNull(nulls, JSON_PROPERTY_STOP_OVER_CODE, this.stopOverCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Leg given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/LevelTwoThree.java b/src/main/java/com/adyen/model/checkout/LevelTwoThree.java new file mode 100644 index 000000000..7740af423 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/LevelTwoThree.java @@ -0,0 +1,621 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.time.LocalDate; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** LevelTwoThree */ +@JsonPropertyOrder({ + LevelTwoThree.JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER, + LevelTwoThree.JSON_PROPERTY_DESTINATION, + LevelTwoThree.JSON_PROPERTY_DUTY_AMOUNT, + LevelTwoThree.JSON_PROPERTY_FREIGHT_AMOUNT, + LevelTwoThree.JSON_PROPERTY_ITEM_DETAIL_LINES, + LevelTwoThree.JSON_PROPERTY_ORDER_DATE, + LevelTwoThree.JSON_PROPERTY_SHIP_FROM_POSTAL_CODE, + LevelTwoThree.JSON_PROPERTY_TOTAL_TAX_AMOUNT +}) +public class LevelTwoThree { + public static final String JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER = "customerReferenceNumber"; + private String customerReferenceNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomerReferenceNumber = false; + + public static final String JSON_PROPERTY_DESTINATION = "destination"; + private Destination destination; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDestination = false; + + public static final String JSON_PROPERTY_DUTY_AMOUNT = "dutyAmount"; + private Long dutyAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDutyAmount = false; + + public static final String JSON_PROPERTY_FREIGHT_AMOUNT = "freightAmount"; + private Long freightAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFreightAmount = false; + + public static final String JSON_PROPERTY_ITEM_DETAIL_LINES = "itemDetailLines"; + private List itemDetailLines; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemDetailLines = false; + + public static final String JSON_PROPERTY_ORDER_DATE = "orderDate"; + private LocalDate orderDate; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderDate = false; + + public static final String JSON_PROPERTY_SHIP_FROM_POSTAL_CODE = "shipFromPostalCode"; + private String shipFromPostalCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipFromPostalCode = false; + + public static final String JSON_PROPERTY_TOTAL_TAX_AMOUNT = "totalTaxAmount"; + private Long totalTaxAmount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTotalTaxAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public LevelTwoThree() {} + + /** + * The reference number to identify the customer and their order. * Format: ASCII * Max length: 25 + * characters * Must not start with a space or be all spaces. * Must not be all zeros. + * + * @param customerReferenceNumber The reference number to identify the customer and their order. * + * Format: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * + * Must not be all zeros. + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree customerReferenceNumber(String customerReferenceNumber) { + this.customerReferenceNumber = customerReferenceNumber; + isSetCustomerReferenceNumber = true; // mark as set + return this; + } + + /** + * The reference number to identify the customer and their order. * Format: ASCII * Max length: 25 + * characters * Must not start with a space or be all spaces. * Must not be all zeros. + * + * @return customerReferenceNumber The reference number to identify the customer and their order. + * * Format: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. + * * Must not be all zeros. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomerReferenceNumber() { + return customerReferenceNumber; + } + + /** + * The reference number to identify the customer and their order. * Format: ASCII * Max length: 25 + * characters * Must not start with a space or be all spaces. * Must not be all zeros. + * + * @param customerReferenceNumber The reference number to identify the customer and their order. * + * Format: ASCII * Max length: 25 characters * Must not start with a space or be all spaces. * + * Must not be all zeros. + */ + @JsonProperty(JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCustomerReferenceNumber(String customerReferenceNumber) { + this.customerReferenceNumber = customerReferenceNumber; + isSetCustomerReferenceNumber = true; // mark as set + } + + /** + * destination + * + * @param destination + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree destination(Destination destination) { + this.destination = destination; + isSetDestination = true; // mark as set + return this; + } + + /** + * Get destination + * + * @return destination + */ + @JsonProperty(JSON_PROPERTY_DESTINATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Destination getDestination() { + return destination; + } + + /** + * destination + * + * @param destination + */ + @JsonProperty(JSON_PROPERTY_DESTINATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDestination(Destination destination) { + this.destination = destination; + isSetDestination = true; // mark as set + } + + /** + * The duty tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param dutyAmount The duty tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree dutyAmount(Long dutyAmount) { + this.dutyAmount = dutyAmount; + isSetDutyAmount = true; // mark as set + return this; + } + + /** + * The duty tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @return dutyAmount The duty tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_DUTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDutyAmount() { + return dutyAmount; + } + + /** + * The duty tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param dutyAmount The duty tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_DUTY_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDutyAmount(Long dutyAmount) { + this.dutyAmount = dutyAmount; + isSetDutyAmount = true; // mark as set + } + + /** + * The shipping amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param freightAmount The shipping amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree freightAmount(Long freightAmount) { + this.freightAmount = freightAmount; + isSetFreightAmount = true; // mark as set + return this; + } + + /** + * The shipping amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @return freightAmount The shipping amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_FREIGHT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFreightAmount() { + return freightAmount; + } + + /** + * The shipping amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 means + * USD 20.00. * Encoding: Numeric * Max value: 10000000000 + * + * @param freightAmount The shipping amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes). * For example, 2000 + * means USD 20.00. * Encoding: Numeric * Max value: 10000000000 + */ + @JsonProperty(JSON_PROPERTY_FREIGHT_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFreightAmount(Long freightAmount) { + this.freightAmount = freightAmount; + isSetFreightAmount = true; // mark as set + } + + /** + * The list of item detail lines. + * + * @param itemDetailLines The list of item detail lines. + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree itemDetailLines(List itemDetailLines) { + this.itemDetailLines = itemDetailLines; + isSetItemDetailLines = true; // mark as set + return this; + } + + public LevelTwoThree addItemDetailLinesItem(ItemDetailLine itemDetailLinesItem) { + if (this.itemDetailLines == null) { + this.itemDetailLines = new ArrayList<>(); + } + this.itemDetailLines.add(itemDetailLinesItem); + return this; + } + + /** + * The list of item detail lines. + * + * @return itemDetailLines The list of item detail lines. + */ + @JsonProperty(JSON_PROPERTY_ITEM_DETAIL_LINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getItemDetailLines() { + return itemDetailLines; + } + + /** + * The list of item detail lines. + * + * @param itemDetailLines The list of item detail lines. + */ + @JsonProperty(JSON_PROPERTY_ITEM_DETAIL_LINES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setItemDetailLines(List itemDetailLines) { + this.itemDetailLines = itemDetailLines; + isSetItemDetailLines = true; // mark as set + } + + /** + * The date of the order. * Min Length: 10 characters * Max Length: 10 characters * Format [ISO + * 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + * + * @param orderDate The date of the order. * Min Length: 10 characters * Max Length: 10 characters + * * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree orderDate(LocalDate orderDate) { + this.orderDate = orderDate; + isSetOrderDate = true; // mark as set + return this; + } + + /** + * The date of the order. * Min Length: 10 characters * Max Length: 10 characters * Format [ISO + * 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + * + * @return orderDate The date of the order. * Min Length: 10 characters * Max Length: 10 + * characters * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + */ + @JsonProperty(JSON_PROPERTY_ORDER_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public LocalDate getOrderDate() { + return orderDate; + } + + /** + * The date of the order. * Min Length: 10 characters * Max Length: 10 characters * Format [ISO + * 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + * + * @param orderDate The date of the order. * Min Length: 10 characters * Max Length: 10 characters + * * Format [ISO 8601](https://www.w3.org/TR/NOTE-datetime): yyyy-MM-dd + */ + @JsonProperty(JSON_PROPERTY_ORDER_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrderDate(LocalDate orderDate) { + this.orderDate = orderDate; + isSetOrderDate = true; // mark as set + } + + /** + * The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: + * 10 characters * For the US, it must be in five or nine digits format. For example, 10001 or + * 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. + * + * @param shipFromPostalCode The postal code of the address where the item is shipped from. * + * Encoding: ASCII * Max length: 10 characters * For the US, it must be in five or nine digits + * format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For + * example, M4B 1G5. + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree shipFromPostalCode(String shipFromPostalCode) { + this.shipFromPostalCode = shipFromPostalCode; + isSetShipFromPostalCode = true; // mark as set + return this; + } + + /** + * The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: + * 10 characters * For the US, it must be in five or nine digits format. For example, 10001 or + * 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. + * + * @return shipFromPostalCode The postal code of the address where the item is shipped from. * + * Encoding: ASCII * Max length: 10 characters * For the US, it must be in five or nine digits + * format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For + * example, M4B 1G5. + */ + @JsonProperty(JSON_PROPERTY_SHIP_FROM_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getShipFromPostalCode() { + return shipFromPostalCode; + } + + /** + * The postal code of the address where the item is shipped from. * Encoding: ASCII * Max length: + * 10 characters * For the US, it must be in five or nine digits format. For example, 10001 or + * 10001-0000. * For Canada, it must be in 6 digits format. For example, M4B 1G5. + * + * @param shipFromPostalCode The postal code of the address where the item is shipped from. * + * Encoding: ASCII * Max length: 10 characters * For the US, it must be in five or nine digits + * format. For example, 10001 or 10001-0000. * For Canada, it must be in 6 digits format. For + * example, M4B 1G5. + */ + @JsonProperty(JSON_PROPERTY_SHIP_FROM_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipFromPostalCode(String shipFromPostalCode) { + this.shipFromPostalCode = shipFromPostalCode; + isSetShipFromPostalCode = true; // mark as set + } + + /** + * The amount of state or provincial [tax included in the total transaction + * amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), + * in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, + * 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 * For L2 data: must not be + * all zeroes. * For L3 data: can be zero. + * + * @param totalTaxAmount The amount of state or provincial [tax included in the total transaction + * amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), + * in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For + * example, 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 * For L2 data: + * must not be all zeroes. * For L3 data: can be zero. + * @return the current {@code LevelTwoThree} instance, allowing for method chaining + */ + public LevelTwoThree totalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + isSetTotalTaxAmount = true; // mark as set + return this; + } + + /** + * The amount of state or provincial [tax included in the total transaction + * amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), + * in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, + * 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 * For L2 data: must not be + * all zeroes. * For L3 data: can be zero. + * + * @return totalTaxAmount The amount of state or provincial [tax included in the total transaction + * amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), + * in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For + * example, 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 * For L2 data: + * must not be all zeroes. * For L3 data: can be zero. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_TAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTotalTaxAmount() { + return totalTaxAmount; + } + + /** + * The amount of state or provincial [tax included in the total transaction + * amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), + * in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For example, + * 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 * For L2 data: must not be + * all zeroes. * For L3 data: can be zero. + * + * @param totalTaxAmount The amount of state or provincial [tax included in the total transaction + * amount](https://docs.adyen.com/payment-methods/cards/enhanced-scheme-data/l2-l3#requirements-to-send-level-2-3-esd), + * in [minor units](https://docs.adyen.com/development-resources/currency-codes). * For + * example, 2000 means USD 20.00. * Encoding: Numeric * Max value: 10000000000 * For L2 data: + * must not be all zeroes. * For L3 data: can be zero. + */ + @JsonProperty(JSON_PROPERTY_TOTAL_TAX_AMOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + isSetTotalTaxAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LevelTwoThree includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this LevelTwoThree object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LevelTwoThree levelTwoThree = (LevelTwoThree) o; + return Objects.equals(this.customerReferenceNumber, levelTwoThree.customerReferenceNumber) + && Objects.equals( + this.isSetCustomerReferenceNumber, levelTwoThree.isSetCustomerReferenceNumber) + && Objects.equals(this.destination, levelTwoThree.destination) + && Objects.equals(this.isSetDestination, levelTwoThree.isSetDestination) + && Objects.equals(this.dutyAmount, levelTwoThree.dutyAmount) + && Objects.equals(this.isSetDutyAmount, levelTwoThree.isSetDutyAmount) + && Objects.equals(this.freightAmount, levelTwoThree.freightAmount) + && Objects.equals(this.isSetFreightAmount, levelTwoThree.isSetFreightAmount) + && Objects.equals(this.itemDetailLines, levelTwoThree.itemDetailLines) + && Objects.equals(this.isSetItemDetailLines, levelTwoThree.isSetItemDetailLines) + && Objects.equals(this.orderDate, levelTwoThree.orderDate) + && Objects.equals(this.isSetOrderDate, levelTwoThree.isSetOrderDate) + && Objects.equals(this.shipFromPostalCode, levelTwoThree.shipFromPostalCode) + && Objects.equals(this.isSetShipFromPostalCode, levelTwoThree.isSetShipFromPostalCode) + && Objects.equals(this.totalTaxAmount, levelTwoThree.totalTaxAmount) + && Objects.equals(this.isSetTotalTaxAmount, levelTwoThree.isSetTotalTaxAmount); + } + + @Override + public int hashCode() { + return Objects.hash( + customerReferenceNumber, + isSetCustomerReferenceNumber, + destination, + isSetDestination, + dutyAmount, + isSetDutyAmount, + freightAmount, + isSetFreightAmount, + itemDetailLines, + isSetItemDetailLines, + orderDate, + isSetOrderDate, + shipFromPostalCode, + isSetShipFromPostalCode, + totalTaxAmount, + isSetTotalTaxAmount); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LevelTwoThree {\n"); + sb.append(" customerReferenceNumber: ") + .append(toIndentedString(customerReferenceNumber)) + .append("\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" dutyAmount: ").append(toIndentedString(dutyAmount)).append("\n"); + sb.append(" freightAmount: ").append(toIndentedString(freightAmount)).append("\n"); + sb.append(" itemDetailLines: ").append(toIndentedString(itemDetailLines)).append("\n"); + sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n"); + sb.append(" shipFromPostalCode: ").append(toIndentedString(shipFromPostalCode)).append("\n"); + sb.append(" totalTaxAmount: ").append(toIndentedString(totalTaxAmount)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCustomerReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_CUSTOMER_REFERENCE_NUMBER, this.customerReferenceNumber); + } + if (isSetDestination) { + addIfNull(nulls, JSON_PROPERTY_DESTINATION, this.destination); + } + if (isSetDutyAmount) { + addIfNull(nulls, JSON_PROPERTY_DUTY_AMOUNT, this.dutyAmount); + } + if (isSetFreightAmount) { + addIfNull(nulls, JSON_PROPERTY_FREIGHT_AMOUNT, this.freightAmount); + } + if (isSetItemDetailLines) { + addIfNull(nulls, JSON_PROPERTY_ITEM_DETAIL_LINES, this.itemDetailLines); + } + if (isSetOrderDate) { + addIfNull(nulls, JSON_PROPERTY_ORDER_DATE, this.orderDate); + } + if (isSetShipFromPostalCode) { + addIfNull(nulls, JSON_PROPERTY_SHIP_FROM_POSTAL_CODE, this.shipFromPostalCode); + } + if (isSetTotalTaxAmount) { + addIfNull(nulls, JSON_PROPERTY_TOTAL_TAX_AMOUNT, this.totalTaxAmount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of LevelTwoThree given an JSON string + * + * @param jsonString JSON string + * @return An instance of LevelTwoThree + * @throws JsonProcessingException if the JSON string is invalid with respect to LevelTwoThree + */ + public static LevelTwoThree fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, LevelTwoThree.class); + } + + /** + * Convert an instance of LevelTwoThree to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/LineItem.java b/src/main/java/com/adyen/model/checkout/LineItem.java index 69b792684..e933270f6 100644 --- a/src/main/java/com/adyen/model/checkout/LineItem.java +++ b/src/main/java/com/adyen/model/checkout/LineItem.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,74 +44,139 @@ public class LineItem { public static final String JSON_PROPERTY_AMOUNT_EXCLUDING_TAX = "amountExcludingTax"; private Long amountExcludingTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountExcludingTax = false; + public static final String JSON_PROPERTY_AMOUNT_INCLUDING_TAX = "amountIncludingTax"; private Long amountIncludingTax; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountIncludingTax = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_COLOR = "color"; private String color; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetColor = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_IMAGE_URL = "imageUrl"; private String imageUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetImageUrl = false; + public static final String JSON_PROPERTY_ITEM_CATEGORY = "itemCategory"; private String itemCategory; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItemCategory = false; + public static final String JSON_PROPERTY_MANUFACTURER = "manufacturer"; private String manufacturer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManufacturer = false; + public static final String JSON_PROPERTY_MARKETPLACE_SELLER_ID = "marketplaceSellerId"; private String marketplaceSellerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMarketplaceSellerId = false; + public static final String JSON_PROPERTY_PRODUCT_URL = "productUrl"; private String productUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProductUrl = false; + public static final String JSON_PROPERTY_QUANTITY = "quantity"; private Long quantity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetQuantity = false; + public static final String JSON_PROPERTY_RECEIVER_EMAIL = "receiverEmail"; private String receiverEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceiverEmail = false; + public static final String JSON_PROPERTY_SIZE = "size"; private String size; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSize = false; + public static final String JSON_PROPERTY_SKU = "sku"; private String sku; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSku = false; + public static final String JSON_PROPERTY_TAX_AMOUNT = "taxAmount"; private Long taxAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxAmount = false; + public static final String JSON_PROPERTY_TAX_PERCENTAGE = "taxPercentage"; private Long taxPercentage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxPercentage = false; + public static final String JSON_PROPERTY_UPC = "upc"; private String upc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpc = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public LineItem() {} /** - * Item amount excluding the tax, in minor units. + * Item amount excluding the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @param amountExcludingTax Item amount excluding the tax, in minor units. + * @param amountExcludingTax Item amount excluding the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * @return the current {@code LineItem} instance, allowing for method chaining */ public LineItem amountExcludingTax(Long amountExcludingTax) { this.amountExcludingTax = amountExcludingTax; + isSetAmountExcludingTax = true; // mark as set return this; } /** - * Item amount excluding the tax, in minor units. + * Item amount excluding the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @return amountExcludingTax Item amount excluding the tax, in minor units. + * @return amountExcludingTax Item amount excluding the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). */ @JsonProperty(JSON_PROPERTY_AMOUNT_EXCLUDING_TAX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -118,31 +185,39 @@ public Long getAmountExcludingTax() { } /** - * Item amount excluding the tax, in minor units. + * Item amount excluding the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @param amountExcludingTax Item amount excluding the tax, in minor units. + * @param amountExcludingTax Item amount excluding the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). */ @JsonProperty(JSON_PROPERTY_AMOUNT_EXCLUDING_TAX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountExcludingTax(Long amountExcludingTax) { this.amountExcludingTax = amountExcludingTax; + isSetAmountExcludingTax = true; // mark as set } /** - * Item amount including the tax, in minor units. + * Item amount including the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @param amountIncludingTax Item amount including the tax, in minor units. + * @param amountIncludingTax Item amount including the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * @return the current {@code LineItem} instance, allowing for method chaining */ public LineItem amountIncludingTax(Long amountIncludingTax) { this.amountIncludingTax = amountIncludingTax; + isSetAmountIncludingTax = true; // mark as set return this; } /** - * Item amount including the tax, in minor units. + * Item amount including the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @return amountIncludingTax Item amount including the tax, in minor units. + * @return amountIncludingTax Item amount including the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). */ @JsonProperty(JSON_PROPERTY_AMOUNT_INCLUDING_TAX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -151,14 +226,17 @@ public Long getAmountIncludingTax() { } /** - * Item amount including the tax, in minor units. + * Item amount including the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @param amountIncludingTax Item amount including the tax, in minor units. + * @param amountIncludingTax Item amount including the tax, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). */ @JsonProperty(JSON_PROPERTY_AMOUNT_INCLUDING_TAX) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountIncludingTax(Long amountIncludingTax) { this.amountIncludingTax = amountIncludingTax; + isSetAmountIncludingTax = true; // mark as set } /** @@ -169,6 +247,7 @@ public void setAmountIncludingTax(Long amountIncludingTax) { */ public LineItem brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -192,6 +271,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -202,6 +282,7 @@ public void setBrand(String brand) { */ public LineItem color(String color) { this.color = color; + isSetColor = true; // mark as set return this; } @@ -225,6 +306,7 @@ public String getColor() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setColor(String color) { this.color = color; + isSetColor = true; // mark as set } /** @@ -235,6 +317,7 @@ public void setColor(String color) { */ public LineItem description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -258,6 +341,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -268,6 +352,7 @@ public void setDescription(String description) { */ public LineItem id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -291,6 +376,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -301,6 +387,7 @@ public void setId(String id) { */ public LineItem imageUrl(String imageUrl) { this.imageUrl = imageUrl; + isSetImageUrl = true; // mark as set return this; } @@ -324,6 +411,7 @@ public String getImageUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setImageUrl(String imageUrl) { this.imageUrl = imageUrl; + isSetImageUrl = true; // mark as set } /** @@ -334,6 +422,7 @@ public void setImageUrl(String imageUrl) { */ public LineItem itemCategory(String itemCategory) { this.itemCategory = itemCategory; + isSetItemCategory = true; // mark as set return this; } @@ -357,6 +446,7 @@ public String getItemCategory() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItemCategory(String itemCategory) { this.itemCategory = itemCategory; + isSetItemCategory = true; // mark as set } /** @@ -367,6 +457,7 @@ public void setItemCategory(String itemCategory) { */ public LineItem manufacturer(String manufacturer) { this.manufacturer = manufacturer; + isSetManufacturer = true; // mark as set return this; } @@ -390,6 +481,7 @@ public String getManufacturer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManufacturer(String manufacturer) { this.manufacturer = manufacturer; + isSetManufacturer = true; // mark as set } /** @@ -400,6 +492,7 @@ public void setManufacturer(String manufacturer) { */ public LineItem marketplaceSellerId(String marketplaceSellerId) { this.marketplaceSellerId = marketplaceSellerId; + isSetMarketplaceSellerId = true; // mark as set return this; } @@ -423,6 +516,7 @@ public String getMarketplaceSellerId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMarketplaceSellerId(String marketplaceSellerId) { this.marketplaceSellerId = marketplaceSellerId; + isSetMarketplaceSellerId = true; // mark as set } /** @@ -433,6 +527,7 @@ public void setMarketplaceSellerId(String marketplaceSellerId) { */ public LineItem productUrl(String productUrl) { this.productUrl = productUrl; + isSetProductUrl = true; // mark as set return this; } @@ -456,6 +551,7 @@ public String getProductUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProductUrl(String productUrl) { this.productUrl = productUrl; + isSetProductUrl = true; // mark as set } /** @@ -466,6 +562,7 @@ public void setProductUrl(String productUrl) { */ public LineItem quantity(Long quantity) { this.quantity = quantity; + isSetQuantity = true; // mark as set return this; } @@ -489,6 +586,7 @@ public Long getQuantity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setQuantity(Long quantity) { this.quantity = quantity; + isSetQuantity = true; // mark as set } /** @@ -500,6 +598,7 @@ public void setQuantity(Long quantity) { */ public LineItem receiverEmail(String receiverEmail) { this.receiverEmail = receiverEmail; + isSetReceiverEmail = true; // mark as set return this; } @@ -525,6 +624,7 @@ public String getReceiverEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceiverEmail(String receiverEmail) { this.receiverEmail = receiverEmail; + isSetReceiverEmail = true; // mark as set } /** @@ -535,6 +635,7 @@ public void setReceiverEmail(String receiverEmail) { */ public LineItem size(String size) { this.size = size; + isSetSize = true; // mark as set return this; } @@ -558,6 +659,7 @@ public String getSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSize(String size) { this.size = size; + isSetSize = true; // mark as set } /** @@ -568,6 +670,7 @@ public void setSize(String size) { */ public LineItem sku(String sku) { this.sku = sku; + isSetSku = true; // mark as set return this; } @@ -591,23 +694,29 @@ public String getSku() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSku(String sku) { this.sku = sku; + isSetSku = true; // mark as set } /** - * Tax amount, in minor units. + * Tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @param taxAmount Tax amount, in minor units. + * @param taxAmount Tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * @return the current {@code LineItem} instance, allowing for method chaining */ public LineItem taxAmount(Long taxAmount) { this.taxAmount = taxAmount; + isSetTaxAmount = true; // mark as set return this; } /** - * Tax amount, in minor units. + * Tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @return taxAmount Tax amount, in minor units. + * @return taxAmount Tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). */ @JsonProperty(JSON_PROPERTY_TAX_AMOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -616,31 +725,43 @@ public Long getTaxAmount() { } /** - * Tax amount, in minor units. + * Tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). * - * @param taxAmount Tax amount, in minor units. + * @param taxAmount Tax amount, in [minor + * units](https://docs.adyen.com/development-resources/currency-codes/#minor-units). */ @JsonProperty(JSON_PROPERTY_TAX_AMOUNT) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxAmount(Long taxAmount) { this.taxAmount = taxAmount; + isSetTaxAmount = true; // mark as set } /** - * Tax percentage, in minor units. + * Tax percentage, represented as a [basis point](https://en.wikipedia.org/wiki/Basis_point) + * integer. For example: - **530** for 5.3% (five point three percent) - **2100** for 21% + * (twenty-one percent) * - * @param taxPercentage Tax percentage, in minor units. + * @param taxPercentage Tax percentage, represented as a [basis + * point](https://en.wikipedia.org/wiki/Basis_point) integer. For example: - **530** for 5.3% + * (five point three percent) - **2100** for 21% (twenty-one percent) * @return the current {@code LineItem} instance, allowing for method chaining */ public LineItem taxPercentage(Long taxPercentage) { this.taxPercentage = taxPercentage; + isSetTaxPercentage = true; // mark as set return this; } /** - * Tax percentage, in minor units. + * Tax percentage, represented as a [basis point](https://en.wikipedia.org/wiki/Basis_point) + * integer. For example: - **530** for 5.3% (five point three percent) - **2100** for 21% + * (twenty-one percent) * - * @return taxPercentage Tax percentage, in minor units. + * @return taxPercentage Tax percentage, represented as a [basis + * point](https://en.wikipedia.org/wiki/Basis_point) integer. For example: - **530** for 5.3% + * (five point three percent) - **2100** for 21% (twenty-one percent) */ @JsonProperty(JSON_PROPERTY_TAX_PERCENTAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -649,14 +770,19 @@ public Long getTaxPercentage() { } /** - * Tax percentage, in minor units. + * Tax percentage, represented as a [basis point](https://en.wikipedia.org/wiki/Basis_point) + * integer. For example: - **530** for 5.3% (five point three percent) - **2100** for 21% + * (twenty-one percent) * - * @param taxPercentage Tax percentage, in minor units. + * @param taxPercentage Tax percentage, represented as a [basis + * point](https://en.wikipedia.org/wiki/Basis_point) integer. For example: - **530** for 5.3% + * (five point three percent) - **2100** for 21% (twenty-one percent) */ @JsonProperty(JSON_PROPERTY_TAX_PERCENTAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxPercentage(Long taxPercentage) { this.taxPercentage = taxPercentage; + isSetTaxPercentage = true; // mark as set } /** @@ -667,6 +793,7 @@ public void setTaxPercentage(Long taxPercentage) { */ public LineItem upc(String upc) { this.upc = upc; + isSetUpc = true; // mark as set return this; } @@ -690,6 +817,27 @@ public String getUpc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpc(String upc) { this.upc = upc; + isSetUpc = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public LineItem includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this LineItem object is equal to o. */ @@ -703,46 +851,82 @@ public boolean equals(Object o) { } LineItem lineItem = (LineItem) o; return Objects.equals(this.amountExcludingTax, lineItem.amountExcludingTax) + && Objects.equals(this.isSetAmountExcludingTax, lineItem.isSetAmountExcludingTax) && Objects.equals(this.amountIncludingTax, lineItem.amountIncludingTax) + && Objects.equals(this.isSetAmountIncludingTax, lineItem.isSetAmountIncludingTax) && Objects.equals(this.brand, lineItem.brand) + && Objects.equals(this.isSetBrand, lineItem.isSetBrand) && Objects.equals(this.color, lineItem.color) + && Objects.equals(this.isSetColor, lineItem.isSetColor) && Objects.equals(this.description, lineItem.description) + && Objects.equals(this.isSetDescription, lineItem.isSetDescription) && Objects.equals(this.id, lineItem.id) + && Objects.equals(this.isSetId, lineItem.isSetId) && Objects.equals(this.imageUrl, lineItem.imageUrl) + && Objects.equals(this.isSetImageUrl, lineItem.isSetImageUrl) && Objects.equals(this.itemCategory, lineItem.itemCategory) + && Objects.equals(this.isSetItemCategory, lineItem.isSetItemCategory) && Objects.equals(this.manufacturer, lineItem.manufacturer) + && Objects.equals(this.isSetManufacturer, lineItem.isSetManufacturer) && Objects.equals(this.marketplaceSellerId, lineItem.marketplaceSellerId) + && Objects.equals(this.isSetMarketplaceSellerId, lineItem.isSetMarketplaceSellerId) && Objects.equals(this.productUrl, lineItem.productUrl) + && Objects.equals(this.isSetProductUrl, lineItem.isSetProductUrl) && Objects.equals(this.quantity, lineItem.quantity) + && Objects.equals(this.isSetQuantity, lineItem.isSetQuantity) && Objects.equals(this.receiverEmail, lineItem.receiverEmail) + && Objects.equals(this.isSetReceiverEmail, lineItem.isSetReceiverEmail) && Objects.equals(this.size, lineItem.size) + && Objects.equals(this.isSetSize, lineItem.isSetSize) && Objects.equals(this.sku, lineItem.sku) + && Objects.equals(this.isSetSku, lineItem.isSetSku) && Objects.equals(this.taxAmount, lineItem.taxAmount) + && Objects.equals(this.isSetTaxAmount, lineItem.isSetTaxAmount) && Objects.equals(this.taxPercentage, lineItem.taxPercentage) - && Objects.equals(this.upc, lineItem.upc); + && Objects.equals(this.isSetTaxPercentage, lineItem.isSetTaxPercentage) + && Objects.equals(this.upc, lineItem.upc) + && Objects.equals(this.isSetUpc, lineItem.isSetUpc); } @Override public int hashCode() { return Objects.hash( amountExcludingTax, + isSetAmountExcludingTax, amountIncludingTax, + isSetAmountIncludingTax, brand, + isSetBrand, color, + isSetColor, description, + isSetDescription, id, + isSetId, imageUrl, + isSetImageUrl, itemCategory, + isSetItemCategory, manufacturer, + isSetManufacturer, marketplaceSellerId, + isSetMarketplaceSellerId, productUrl, + isSetProductUrl, quantity, + isSetQuantity, receiverEmail, + isSetReceiverEmail, size, + isSetSize, sku, + isSetSku, taxAmount, + isSetTaxAmount, taxPercentage, - upc); + isSetTaxPercentage, + upc, + isSetUpc); } @Override @@ -783,6 +967,81 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmountExcludingTax) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_EXCLUDING_TAX, this.amountExcludingTax); + } + if (isSetAmountIncludingTax) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_INCLUDING_TAX, this.amountIncludingTax); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetColor) { + addIfNull(nulls, JSON_PROPERTY_COLOR, this.color); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetImageUrl) { + addIfNull(nulls, JSON_PROPERTY_IMAGE_URL, this.imageUrl); + } + if (isSetItemCategory) { + addIfNull(nulls, JSON_PROPERTY_ITEM_CATEGORY, this.itemCategory); + } + if (isSetManufacturer) { + addIfNull(nulls, JSON_PROPERTY_MANUFACTURER, this.manufacturer); + } + if (isSetMarketplaceSellerId) { + addIfNull(nulls, JSON_PROPERTY_MARKETPLACE_SELLER_ID, this.marketplaceSellerId); + } + if (isSetProductUrl) { + addIfNull(nulls, JSON_PROPERTY_PRODUCT_URL, this.productUrl); + } + if (isSetQuantity) { + addIfNull(nulls, JSON_PROPERTY_QUANTITY, this.quantity); + } + if (isSetReceiverEmail) { + addIfNull(nulls, JSON_PROPERTY_RECEIVER_EMAIL, this.receiverEmail); + } + if (isSetSize) { + addIfNull(nulls, JSON_PROPERTY_SIZE, this.size); + } + if (isSetSku) { + addIfNull(nulls, JSON_PROPERTY_SKU, this.sku); + } + if (isSetTaxAmount) { + addIfNull(nulls, JSON_PROPERTY_TAX_AMOUNT, this.taxAmount); + } + if (isSetTaxPercentage) { + addIfNull(nulls, JSON_PROPERTY_TAX_PERCENTAGE, this.taxPercentage); + } + if (isSetUpc) { + addIfNull(nulls, JSON_PROPERTY_UPC, this.upc); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of LineItem given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java index 1ef85f60a..6a2ca29f7 100644 --- a/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/ListStoredPaymentMethodsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,12 +31,27 @@ public class ListStoredPaymentMethodsResponse { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHODS = "storedPaymentMethods"; private List storedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethods = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ListStoredPaymentMethodsResponse() {} /** @@ -46,6 +63,7 @@ public ListStoredPaymentMethodsResponse() {} */ public ListStoredPaymentMethodsResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -69,6 +87,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -84,6 +103,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ListStoredPaymentMethodsResponse shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -115,6 +135,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setShopperReference(String shopperReference) { public ListStoredPaymentMethodsResponse storedPaymentMethods( List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set return this; } @@ -159,6 +181,27 @@ public List getStoredPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethods(List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ListStoredPaymentMethodsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ListStoredPaymentMethodsResponse object is equal to o. */ @@ -173,14 +216,27 @@ public boolean equals(Object o) { ListStoredPaymentMethodsResponse listStoredPaymentMethodsResponse = (ListStoredPaymentMethodsResponse) o; return Objects.equals(this.merchantAccount, listStoredPaymentMethodsResponse.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, listStoredPaymentMethodsResponse.isSetMerchantAccount) && Objects.equals(this.shopperReference, listStoredPaymentMethodsResponse.shopperReference) && Objects.equals( - this.storedPaymentMethods, listStoredPaymentMethodsResponse.storedPaymentMethods); + this.isSetShopperReference, listStoredPaymentMethodsResponse.isSetShopperReference) + && Objects.equals( + this.storedPaymentMethods, listStoredPaymentMethodsResponse.storedPaymentMethods) + && Objects.equals( + this.isSetStoredPaymentMethods, + listStoredPaymentMethodsResponse.isSetStoredPaymentMethods); } @Override public int hashCode() { - return Objects.hash(merchantAccount, shopperReference, storedPaymentMethods); + return Objects.hash( + merchantAccount, + isSetMerchantAccount, + shopperReference, + isSetShopperReference, + storedPaymentMethods, + isSetStoredPaymentMethods); } @Override @@ -206,6 +262,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetStoredPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHODS, this.storedPaymentMethods); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ListStoredPaymentMethodsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Mandate.java b/src/main/java/com/adyen/model/checkout/Mandate.java index c632e63e0..8f0a7a11e 100644 --- a/src/main/java/com/adyen/model/checkout/Mandate.java +++ b/src/main/java/com/adyen/model/checkout/Mandate.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,6 +39,9 @@ public class Mandate { public static final String JSON_PROPERTY_AMOUNT = "amount"; private String amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The limitation rule of the billing amount. Possible values: * **max**: The transaction amount * can not exceed the `amount`. * **exact**: The transaction amount should be the same @@ -85,6 +90,9 @@ public static AmountRuleEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_RULE = "amountRule"; private AmountRuleEnum amountRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountRule = false; + /** * The rule to specify the period, within which the recurring debit can happen, relative to the * mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and @@ -135,15 +143,27 @@ public static BillingAttemptsRuleEnum fromValue(String value) { public static final String JSON_PROPERTY_BILLING_ATTEMPTS_RULE = "billingAttemptsRule"; private BillingAttemptsRuleEnum billingAttemptsRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAttemptsRule = false; + public static final String JSON_PROPERTY_BILLING_DAY = "billingDay"; private String billingDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingDay = false; + public static final String JSON_PROPERTY_COUNT = "count"; private String count; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCount = false; + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; private String endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + /** * The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, * **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. @@ -203,12 +223,27 @@ public static FrequencyEnum fromValue(String value) { public static final String JSON_PROPERTY_FREQUENCY = "frequency"; private FrequencyEnum frequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFrequency = false; + public static final String JSON_PROPERTY_REMARKS = "remarks"; private String remarks; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemarks = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private String startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Mandate() {} /** @@ -219,6 +254,7 @@ public Mandate() {} */ public Mandate amount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -242,6 +278,7 @@ public String getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -256,6 +293,7 @@ public void setAmount(String amount) { */ public Mandate amountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set return this; } @@ -287,6 +325,7 @@ public AmountRuleEnum getAmountRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set } /** @@ -302,6 +341,7 @@ public void setAmountRule(AmountRuleEnum amountRule) { */ public Mandate billingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set return this; } @@ -335,6 +375,7 @@ public BillingAttemptsRuleEnum getBillingAttemptsRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set } /** @@ -349,6 +390,7 @@ public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) */ public Mandate billingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set return this; } @@ -380,6 +422,7 @@ public String getBillingDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set } /** @@ -390,6 +433,7 @@ public void setBillingDay(String billingDay) { */ public Mandate count(String count) { this.count = count; + isSetCount = true; // mark as set return this; } @@ -413,6 +457,7 @@ public String getCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCount(String count) { this.count = count; + isSetCount = true; // mark as set } /** @@ -423,6 +468,7 @@ public void setCount(String count) { */ public Mandate endsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -446,6 +492,7 @@ public String getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -459,6 +506,7 @@ public void setEndsAt(String endsAt) { */ public Mandate frequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set return this; } @@ -488,6 +536,7 @@ public FrequencyEnum getFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set } /** @@ -498,6 +547,7 @@ public void setFrequency(FrequencyEnum frequency) { */ public Mandate remarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set return this; } @@ -521,6 +571,7 @@ public String getRemarks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set } /** @@ -532,6 +583,7 @@ public void setRemarks(String remarks) { */ public Mandate startsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -557,6 +609,27 @@ public String getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Mandate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Mandate object is equal to o. */ @@ -570,28 +643,46 @@ public boolean equals(Object o) { } Mandate mandate = (Mandate) o; return Objects.equals(this.amount, mandate.amount) + && Objects.equals(this.isSetAmount, mandate.isSetAmount) && Objects.equals(this.amountRule, mandate.amountRule) + && Objects.equals(this.isSetAmountRule, mandate.isSetAmountRule) && Objects.equals(this.billingAttemptsRule, mandate.billingAttemptsRule) + && Objects.equals(this.isSetBillingAttemptsRule, mandate.isSetBillingAttemptsRule) && Objects.equals(this.billingDay, mandate.billingDay) + && Objects.equals(this.isSetBillingDay, mandate.isSetBillingDay) && Objects.equals(this.count, mandate.count) + && Objects.equals(this.isSetCount, mandate.isSetCount) && Objects.equals(this.endsAt, mandate.endsAt) + && Objects.equals(this.isSetEndsAt, mandate.isSetEndsAt) && Objects.equals(this.frequency, mandate.frequency) + && Objects.equals(this.isSetFrequency, mandate.isSetFrequency) && Objects.equals(this.remarks, mandate.remarks) - && Objects.equals(this.startsAt, mandate.startsAt); + && Objects.equals(this.isSetRemarks, mandate.isSetRemarks) + && Objects.equals(this.startsAt, mandate.startsAt) + && Objects.equals(this.isSetStartsAt, mandate.isSetStartsAt); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, amountRule, + isSetAmountRule, billingAttemptsRule, + isSetBillingAttemptsRule, billingDay, + isSetBillingDay, count, + isSetCount, endsAt, + isSetEndsAt, frequency, + isSetFrequency, remarks, - startsAt); + isSetRemarks, + startsAt, + isSetStartsAt); } @Override @@ -623,6 +714,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountRule) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_RULE, this.amountRule); + } + if (isSetBillingAttemptsRule) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ATTEMPTS_RULE, this.billingAttemptsRule); + } + if (isSetBillingDay) { + addIfNull(nulls, JSON_PROPERTY_BILLING_DAY, this.billingDay); + } + if (isSetCount) { + addIfNull(nulls, JSON_PROPERTY_COUNT, this.count); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetFrequency) { + addIfNull(nulls, JSON_PROPERTY_FREQUENCY, this.frequency); + } + if (isSetRemarks) { + addIfNull(nulls, JSON_PROPERTY_REMARKS, this.remarks); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Mandate given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MasterpassDetails.java b/src/main/java/com/adyen/model/checkout/MasterpassDetails.java index 43f4d35e1..f7785a8c0 100644 --- a/src/main/java/com/adyen/model/checkout/MasterpassDetails.java +++ b/src/main/java/com/adyen/model/checkout/MasterpassDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class MasterpassDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -40,7 +45,9 @@ public class MasterpassDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -80,12 +87,21 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_MASTERPASS_TRANSACTION_ID = "masterpassTransactionId"; private String masterpassTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMasterpassTransactionId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **masterpass** */ public enum TypeEnum { MASTERPASS(String.valueOf("masterpass")); @@ -128,6 +144,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MasterpassDetails() {} /** @@ -138,6 +163,7 @@ public MasterpassDetails() {} */ public MasterpassDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -161,6 +187,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -174,6 +201,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MasterpassDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -203,6 +231,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -213,6 +242,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public MasterpassDetails masterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set return this; } @@ -236,6 +266,7 @@ public String getMasterpassTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMasterpassTransactionId(String masterpassTransactionId) { this.masterpassTransactionId = masterpassTransactionId; + isSetMasterpassTransactionId = true; // mark as set } /** @@ -246,6 +277,7 @@ public void setMasterpassTransactionId(String masterpassTransactionId) { */ public MasterpassDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -270,6 +302,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -280,6 +313,7 @@ public void setSdkData(String sdkData) { */ public MasterpassDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +337,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MasterpassDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MasterpassDetails object is equal to o. */ @@ -316,15 +371,31 @@ public boolean equals(Object o) { } MasterpassDetails masterpassDetails = (MasterpassDetails) o; return Objects.equals(this.checkoutAttemptId, masterpassDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, masterpassDetails.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, masterpassDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, masterpassDetails.isSetFundingSource) && Objects.equals(this.masterpassTransactionId, masterpassDetails.masterpassTransactionId) + && Objects.equals( + this.isSetMasterpassTransactionId, masterpassDetails.isSetMasterpassTransactionId) && Objects.equals(this.sdkData, masterpassDetails.sdkData) - && Objects.equals(this.type, masterpassDetails.type); + && Objects.equals(this.isSetSdkData, masterpassDetails.isSetSdkData) + && Objects.equals(this.type, masterpassDetails.type) + && Objects.equals(this.isSetType, masterpassDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, fundingSource, masterpassTransactionId, sdkData, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + fundingSource, + isSetFundingSource, + masterpassTransactionId, + isSetMasterpassTransactionId, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -352,6 +423,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetMasterpassTransactionId) { + addIfNull(nulls, JSON_PROPERTY_MASTERPASS_TRANSACTION_ID, this.masterpassTransactionId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MasterpassDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MbwayDetails.java b/src/main/java/com/adyen/model/checkout/MbwayDetails.java index 93fde7b67..ef5cc7d2d 100644 --- a/src/main/java/com/adyen/model/checkout/MbwayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MbwayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class MbwayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + /** **mbway** */ public enum TypeEnum { MBWAY(String.valueOf("mbway")); @@ -84,6 +98,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MbwayDetails() {} /** @@ -94,6 +117,7 @@ public MbwayDetails() {} */ public MbwayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -127,6 +152,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MbwayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -151,6 +177,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -159,6 +186,7 @@ public void setSdkData(String sdkData) { */ public MbwayDetails shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -178,6 +206,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -186,6 +215,7 @@ public void setShopperEmail(String shopperEmail) { */ public MbwayDetails telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -205,6 +235,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -215,6 +246,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public MbwayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -238,6 +270,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MbwayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MbwayDetails object is equal to o. */ @@ -251,15 +304,30 @@ public boolean equals(Object o) { } MbwayDetails mbwayDetails = (MbwayDetails) o; return Objects.equals(this.checkoutAttemptId, mbwayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, mbwayDetails.isSetCheckoutAttemptId) && Objects.equals(this.sdkData, mbwayDetails.sdkData) + && Objects.equals(this.isSetSdkData, mbwayDetails.isSetSdkData) && Objects.equals(this.shopperEmail, mbwayDetails.shopperEmail) + && Objects.equals(this.isSetShopperEmail, mbwayDetails.isSetShopperEmail) && Objects.equals(this.telephoneNumber, mbwayDetails.telephoneNumber) - && Objects.equals(this.type, mbwayDetails.type); + && Objects.equals(this.isSetTelephoneNumber, mbwayDetails.isSetTelephoneNumber) + && Objects.equals(this.type, mbwayDetails.type) + && Objects.equals(this.isSetType, mbwayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, sdkData, shopperEmail, telephoneNumber, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + sdkData, + isSetSdkData, + shopperEmail, + isSetShopperEmail, + telephoneNumber, + isSetTelephoneNumber, + type, + isSetType); } @Override @@ -285,6 +353,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MbwayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MerchantDevice.java b/src/main/java/com/adyen/model/checkout/MerchantDevice.java index 6e6841e2d..1d8c4715c 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantDevice.java +++ b/src/main/java/com/adyen/model/checkout/MerchantDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class MerchantDevice { public static final String JSON_PROPERTY_OS = "os"; private String os; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOs = false; + public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; private String osVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsVersion = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantDevice() {} /** @@ -43,6 +60,7 @@ public MerchantDevice() {} */ public MerchantDevice os(String os) { this.os = os; + isSetOs = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getOs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOs(String os) { this.os = os; + isSetOs = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setOs(String os) { */ public MerchantDevice osVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getOsVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setOsVersion(String osVersion) { */ public MerchantDevice reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantDevice includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantDevice object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } MerchantDevice merchantDevice = (MerchantDevice) o; return Objects.equals(this.os, merchantDevice.os) + && Objects.equals(this.isSetOs, merchantDevice.isSetOs) && Objects.equals(this.osVersion, merchantDevice.osVersion) - && Objects.equals(this.reference, merchantDevice.reference); + && Objects.equals(this.isSetOsVersion, merchantDevice.isSetOsVersion) + && Objects.equals(this.reference, merchantDevice.reference) + && Objects.equals(this.isSetReference, merchantDevice.isSetReference); } @Override public int hashCode() { - return Objects.hash(os, osVersion, reference); + return Objects.hash(os, isSetOs, osVersion, isSetOsVersion, reference, isSetReference); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOs) { + addIfNull(nulls, JSON_PROPERTY_OS, this.os); + } + if (isSetOsVersion) { + addIfNull(nulls, JSON_PROPERTY_OS_VERSION, this.osVersion); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantDevice given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java index b6486931a..e6cd056e3 100644 --- a/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java +++ b/src/main/java/com/adyen/model/checkout/MerchantRiskIndicator.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,6 +45,9 @@ public class MerchantRiskIndicator { public static final String JSON_PROPERTY_ADDRESS_MATCH = "addressMatch"; private Boolean addressMatch; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddressMatch = false; + /** * Indicator regarding the delivery address. Allowed values: * `shipToBillingAddress` * * `shipToVerifiedAddress` * `shipToNewAddress` * `shipToStore` * @@ -102,13 +107,22 @@ public static DeliveryAddressIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_DELIVERY_ADDRESS_INDICATOR = "deliveryAddressIndicator"; private DeliveryAddressIndicatorEnum deliveryAddressIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddressIndicator = false; + public static final String JSON_PROPERTY_DELIVERY_EMAIL = "deliveryEmail"; @Deprecated // deprecated since Adyen Checkout API v68: Use `deliveryEmailAddress` instead. private String deliveryEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryEmail = false; + public static final String JSON_PROPERTY_DELIVERY_EMAIL_ADDRESS = "deliveryEmailAddress"; private String deliveryEmailAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryEmailAddress = false; + /** * The estimated delivery time for the shopper to receive the goods. Allowed values: * * `electronicDelivery` * `sameDayShipping` * `overnightShipping` * @@ -161,33 +175,69 @@ public static DeliveryTimeframeEnum fromValue(String value) { public static final String JSON_PROPERTY_DELIVERY_TIMEFRAME = "deliveryTimeframe"; private DeliveryTimeframeEnum deliveryTimeframe; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryTimeframe = false; + public static final String JSON_PROPERTY_GIFT_CARD_AMOUNT = "giftCardAmount"; private Amount giftCardAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGiftCardAmount = false; + public static final String JSON_PROPERTY_GIFT_CARD_COUNT = "giftCardCount"; private Integer giftCardCount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGiftCardCount = false; + public static final String JSON_PROPERTY_GIFT_CARD_CURR = "giftCardCurr"; private String giftCardCurr; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGiftCardCurr = false; + public static final String JSON_PROPERTY_PRE_ORDER_DATE = "preOrderDate"; private OffsetDateTime preOrderDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreOrderDate = false; + public static final String JSON_PROPERTY_PRE_ORDER_PURCHASE = "preOrderPurchase"; private Boolean preOrderPurchase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreOrderPurchase = false; + public static final String JSON_PROPERTY_PRE_ORDER_PURCHASE_IND = "preOrderPurchaseInd"; private String preOrderPurchaseInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPreOrderPurchaseInd = false; + public static final String JSON_PROPERTY_REORDER_ITEMS = "reorderItems"; private Boolean reorderItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReorderItems = false; + public static final String JSON_PROPERTY_REORDER_ITEMS_IND = "reorderItemsInd"; private String reorderItemsInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReorderItemsInd = false; + public static final String JSON_PROPERTY_SHIP_INDICATOR = "shipIndicator"; private String shipIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShipIndicator = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MerchantRiskIndicator() {} /** @@ -198,6 +248,7 @@ public MerchantRiskIndicator() {} */ public MerchantRiskIndicator addressMatch(Boolean addressMatch) { this.addressMatch = addressMatch; + isSetAddressMatch = true; // mark as set return this; } @@ -221,6 +272,7 @@ public Boolean getAddressMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddressMatch(Boolean addressMatch) { this.addressMatch = addressMatch; + isSetAddressMatch = true; // mark as set } /** @@ -237,6 +289,7 @@ public void setAddressMatch(Boolean addressMatch) { public MerchantRiskIndicator deliveryAddressIndicator( DeliveryAddressIndicatorEnum deliveryAddressIndicator) { this.deliveryAddressIndicator = deliveryAddressIndicator; + isSetDeliveryAddressIndicator = true; // mark as set return this; } @@ -270,6 +323,7 @@ public DeliveryAddressIndicatorEnum getDeliveryAddressIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddressIndicator(DeliveryAddressIndicatorEnum deliveryAddressIndicator) { this.deliveryAddressIndicator = deliveryAddressIndicator; + isSetDeliveryAddressIndicator = true; // mark as set } /** @@ -282,6 +336,7 @@ public void setDeliveryAddressIndicator(DeliveryAddressIndicatorEnum deliveryAdd @Deprecated // deprecated since Adyen Checkout API v68: Use `deliveryEmailAddress` instead. public MerchantRiskIndicator deliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; + isSetDeliveryEmail = true; // mark as set return this; } @@ -309,6 +364,7 @@ public String getDeliveryEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryEmail(String deliveryEmail) { this.deliveryEmail = deliveryEmail; + isSetDeliveryEmail = true; // mark as set } /** @@ -321,6 +377,7 @@ public void setDeliveryEmail(String deliveryEmail) { */ public MerchantRiskIndicator deliveryEmailAddress(String deliveryEmailAddress) { this.deliveryEmailAddress = deliveryEmailAddress; + isSetDeliveryEmailAddress = true; // mark as set return this; } @@ -348,6 +405,7 @@ public String getDeliveryEmailAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryEmailAddress(String deliveryEmailAddress) { this.deliveryEmailAddress = deliveryEmailAddress; + isSetDeliveryEmailAddress = true; // mark as set } /** @@ -362,6 +420,7 @@ public void setDeliveryEmailAddress(String deliveryEmailAddress) { */ public MerchantRiskIndicator deliveryTimeframe(DeliveryTimeframeEnum deliveryTimeframe) { this.deliveryTimeframe = deliveryTimeframe; + isSetDeliveryTimeframe = true; // mark as set return this; } @@ -393,6 +452,7 @@ public DeliveryTimeframeEnum getDeliveryTimeframe() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryTimeframe(DeliveryTimeframeEnum deliveryTimeframe) { this.deliveryTimeframe = deliveryTimeframe; + isSetDeliveryTimeframe = true; // mark as set } /** @@ -403,6 +463,7 @@ public void setDeliveryTimeframe(DeliveryTimeframeEnum deliveryTimeframe) { */ public MerchantRiskIndicator giftCardAmount(Amount giftCardAmount) { this.giftCardAmount = giftCardAmount; + isSetGiftCardAmount = true; // mark as set return this; } @@ -426,6 +487,7 @@ public Amount getGiftCardAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGiftCardAmount(Amount giftCardAmount) { this.giftCardAmount = giftCardAmount; + isSetGiftCardAmount = true; // mark as set } /** @@ -438,6 +500,7 @@ public void setGiftCardAmount(Amount giftCardAmount) { */ public MerchantRiskIndicator giftCardCount(Integer giftCardCount) { this.giftCardCount = giftCardCount; + isSetGiftCardCount = true; // mark as set return this; } @@ -465,6 +528,7 @@ public Integer getGiftCardCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGiftCardCount(Integer giftCardCount) { this.giftCardCount = giftCardCount; + isSetGiftCardCount = true; // mark as set } /** @@ -480,6 +544,7 @@ public void setGiftCardCount(Integer giftCardCount) { */ public MerchantRiskIndicator giftCardCurr(String giftCardCurr) { this.giftCardCurr = giftCardCurr; + isSetGiftCardCurr = true; // mark as set return this; } @@ -513,6 +578,7 @@ public String getGiftCardCurr() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGiftCardCurr(String giftCardCurr) { this.giftCardCurr = giftCardCurr; + isSetGiftCardCurr = true; // mark as set } /** @@ -524,6 +590,7 @@ public void setGiftCardCurr(String giftCardCurr) { */ public MerchantRiskIndicator preOrderDate(OffsetDateTime preOrderDate) { this.preOrderDate = preOrderDate; + isSetPreOrderDate = true; // mark as set return this; } @@ -549,6 +616,7 @@ public OffsetDateTime getPreOrderDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreOrderDate(OffsetDateTime preOrderDate) { this.preOrderDate = preOrderDate; + isSetPreOrderDate = true; // mark as set } /** @@ -559,6 +627,7 @@ public void setPreOrderDate(OffsetDateTime preOrderDate) { */ public MerchantRiskIndicator preOrderPurchase(Boolean preOrderPurchase) { this.preOrderPurchase = preOrderPurchase; + isSetPreOrderPurchase = true; // mark as set return this; } @@ -582,6 +651,7 @@ public Boolean getPreOrderPurchase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreOrderPurchase(Boolean preOrderPurchase) { this.preOrderPurchase = preOrderPurchase; + isSetPreOrderPurchase = true; // mark as set } /** @@ -594,6 +664,7 @@ public void setPreOrderPurchase(Boolean preOrderPurchase) { */ public MerchantRiskIndicator preOrderPurchaseInd(String preOrderPurchaseInd) { this.preOrderPurchaseInd = preOrderPurchaseInd; + isSetPreOrderPurchaseInd = true; // mark as set return this; } @@ -621,6 +692,7 @@ public String getPreOrderPurchaseInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPreOrderPurchaseInd(String preOrderPurchaseInd) { this.preOrderPurchaseInd = preOrderPurchaseInd; + isSetPreOrderPurchaseInd = true; // mark as set } /** @@ -632,6 +704,7 @@ public void setPreOrderPurchaseInd(String preOrderPurchaseInd) { */ public MerchantRiskIndicator reorderItems(Boolean reorderItems) { this.reorderItems = reorderItems; + isSetReorderItems = true; // mark as set return this; } @@ -657,6 +730,7 @@ public Boolean getReorderItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReorderItems(Boolean reorderItems) { this.reorderItems = reorderItems; + isSetReorderItems = true; // mark as set } /** @@ -668,6 +742,7 @@ public void setReorderItems(Boolean reorderItems) { */ public MerchantRiskIndicator reorderItemsInd(String reorderItemsInd) { this.reorderItemsInd = reorderItemsInd; + isSetReorderItemsInd = true; // mark as set return this; } @@ -693,6 +768,7 @@ public String getReorderItemsInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReorderItemsInd(String reorderItemsInd) { this.reorderItemsInd = reorderItemsInd; + isSetReorderItemsInd = true; // mark as set } /** @@ -703,6 +779,7 @@ public void setReorderItemsInd(String reorderItemsInd) { */ public MerchantRiskIndicator shipIndicator(String shipIndicator) { this.shipIndicator = shipIndicator; + isSetShipIndicator = true; // mark as set return this; } @@ -726,6 +803,27 @@ public String getShipIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShipIndicator(String shipIndicator) { this.shipIndicator = shipIndicator; + isSetShipIndicator = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MerchantRiskIndicator includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MerchantRiskIndicator object is equal to o. */ @@ -739,39 +837,70 @@ public boolean equals(Object o) { } MerchantRiskIndicator merchantRiskIndicator = (MerchantRiskIndicator) o; return Objects.equals(this.addressMatch, merchantRiskIndicator.addressMatch) + && Objects.equals(this.isSetAddressMatch, merchantRiskIndicator.isSetAddressMatch) && Objects.equals( this.deliveryAddressIndicator, merchantRiskIndicator.deliveryAddressIndicator) + && Objects.equals( + this.isSetDeliveryAddressIndicator, merchantRiskIndicator.isSetDeliveryAddressIndicator) && Objects.equals(this.deliveryEmail, merchantRiskIndicator.deliveryEmail) + && Objects.equals(this.isSetDeliveryEmail, merchantRiskIndicator.isSetDeliveryEmail) && Objects.equals(this.deliveryEmailAddress, merchantRiskIndicator.deliveryEmailAddress) + && Objects.equals( + this.isSetDeliveryEmailAddress, merchantRiskIndicator.isSetDeliveryEmailAddress) && Objects.equals(this.deliveryTimeframe, merchantRiskIndicator.deliveryTimeframe) + && Objects.equals(this.isSetDeliveryTimeframe, merchantRiskIndicator.isSetDeliveryTimeframe) && Objects.equals(this.giftCardAmount, merchantRiskIndicator.giftCardAmount) + && Objects.equals(this.isSetGiftCardAmount, merchantRiskIndicator.isSetGiftCardAmount) && Objects.equals(this.giftCardCount, merchantRiskIndicator.giftCardCount) + && Objects.equals(this.isSetGiftCardCount, merchantRiskIndicator.isSetGiftCardCount) && Objects.equals(this.giftCardCurr, merchantRiskIndicator.giftCardCurr) + && Objects.equals(this.isSetGiftCardCurr, merchantRiskIndicator.isSetGiftCardCurr) && Objects.equals(this.preOrderDate, merchantRiskIndicator.preOrderDate) + && Objects.equals(this.isSetPreOrderDate, merchantRiskIndicator.isSetPreOrderDate) && Objects.equals(this.preOrderPurchase, merchantRiskIndicator.preOrderPurchase) + && Objects.equals(this.isSetPreOrderPurchase, merchantRiskIndicator.isSetPreOrderPurchase) && Objects.equals(this.preOrderPurchaseInd, merchantRiskIndicator.preOrderPurchaseInd) + && Objects.equals( + this.isSetPreOrderPurchaseInd, merchantRiskIndicator.isSetPreOrderPurchaseInd) && Objects.equals(this.reorderItems, merchantRiskIndicator.reorderItems) + && Objects.equals(this.isSetReorderItems, merchantRiskIndicator.isSetReorderItems) && Objects.equals(this.reorderItemsInd, merchantRiskIndicator.reorderItemsInd) - && Objects.equals(this.shipIndicator, merchantRiskIndicator.shipIndicator); + && Objects.equals(this.isSetReorderItemsInd, merchantRiskIndicator.isSetReorderItemsInd) + && Objects.equals(this.shipIndicator, merchantRiskIndicator.shipIndicator) + && Objects.equals(this.isSetShipIndicator, merchantRiskIndicator.isSetShipIndicator); } @Override public int hashCode() { return Objects.hash( addressMatch, + isSetAddressMatch, deliveryAddressIndicator, + isSetDeliveryAddressIndicator, deliveryEmail, + isSetDeliveryEmail, deliveryEmailAddress, + isSetDeliveryEmailAddress, deliveryTimeframe, + isSetDeliveryTimeframe, giftCardAmount, + isSetGiftCardAmount, giftCardCount, + isSetGiftCardCount, giftCardCurr, + isSetGiftCardCurr, preOrderDate, + isSetPreOrderDate, preOrderPurchase, + isSetPreOrderPurchase, preOrderPurchaseInd, + isSetPreOrderPurchaseInd, reorderItems, + isSetReorderItems, reorderItemsInd, - shipIndicator); + isSetReorderItemsInd, + shipIndicator, + isSetShipIndicator); } @Override @@ -812,6 +941,69 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddressMatch) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS_MATCH, this.addressMatch); + } + if (isSetDeliveryAddressIndicator) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS_INDICATOR, this.deliveryAddressIndicator); + } + if (isSetDeliveryEmail) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_EMAIL, this.deliveryEmail); + } + if (isSetDeliveryEmailAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_EMAIL_ADDRESS, this.deliveryEmailAddress); + } + if (isSetDeliveryTimeframe) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_TIMEFRAME, this.deliveryTimeframe); + } + if (isSetGiftCardAmount) { + addIfNull(nulls, JSON_PROPERTY_GIFT_CARD_AMOUNT, this.giftCardAmount); + } + if (isSetGiftCardCount) { + addIfNull(nulls, JSON_PROPERTY_GIFT_CARD_COUNT, this.giftCardCount); + } + if (isSetGiftCardCurr) { + addIfNull(nulls, JSON_PROPERTY_GIFT_CARD_CURR, this.giftCardCurr); + } + if (isSetPreOrderDate) { + addIfNull(nulls, JSON_PROPERTY_PRE_ORDER_DATE, this.preOrderDate); + } + if (isSetPreOrderPurchase) { + addIfNull(nulls, JSON_PROPERTY_PRE_ORDER_PURCHASE, this.preOrderPurchase); + } + if (isSetPreOrderPurchaseInd) { + addIfNull(nulls, JSON_PROPERTY_PRE_ORDER_PURCHASE_IND, this.preOrderPurchaseInd); + } + if (isSetReorderItems) { + addIfNull(nulls, JSON_PROPERTY_REORDER_ITEMS, this.reorderItems); + } + if (isSetReorderItemsInd) { + addIfNull(nulls, JSON_PROPERTY_REORDER_ITEMS_IND, this.reorderItemsInd); + } + if (isSetShipIndicator) { + addIfNull(nulls, JSON_PROPERTY_SHIP_INDICATOR, this.shipIndicator); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MerchantRiskIndicator given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MobilePayDetails.java b/src/main/java/com/adyen/model/checkout/MobilePayDetails.java index fbd744f13..d2b3cf8ac 100644 --- a/src/main/java/com/adyen/model/checkout/MobilePayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MobilePayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class MobilePayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **mobilepay** */ public enum TypeEnum { MOBILEPAY(String.valueOf("mobilepay")); @@ -76,6 +84,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MobilePayDetails() {} /** @@ -86,6 +103,7 @@ public MobilePayDetails() {} */ public MobilePayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -109,6 +127,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -119,6 +138,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MobilePayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -143,6 +163,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -153,6 +174,7 @@ public void setSdkData(String sdkData) { */ public MobilePayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -176,6 +198,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MobilePayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MobilePayDetails object is equal to o. */ @@ -189,13 +232,17 @@ public boolean equals(Object o) { } MobilePayDetails mobilePayDetails = (MobilePayDetails) o; return Objects.equals(this.checkoutAttemptId, mobilePayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, mobilePayDetails.isSetCheckoutAttemptId) && Objects.equals(this.sdkData, mobilePayDetails.sdkData) - && Objects.equals(this.type, mobilePayDetails.type); + && Objects.equals(this.isSetSdkData, mobilePayDetails.isSetSdkData) + && Objects.equals(this.type, mobilePayDetails.type) + && Objects.equals(this.isSetType, mobilePayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, sdkData, type); + return Objects.hash( + checkoutAttemptId, isSetCheckoutAttemptId, sdkData, isSetSdkData, type, isSetType); } @Override @@ -219,6 +266,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MobilePayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/MolPayDetails.java b/src/main/java/com/adyen/model/checkout/MolPayDetails.java index 510f3157b..fd814bd7c 100644 --- a/src/main/java/com/adyen/model/checkout/MolPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/MolPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class MolPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **molpay** */ public enum TypeEnum { MOLPAY_EBANKING_FPX_MY(String.valueOf("molpay_ebanking_fpx_MY")), @@ -82,6 +93,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public MolPayDetails() {} /** @@ -92,6 +112,7 @@ public MolPayDetails() {} */ public MolPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -115,6 +136,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -126,6 +148,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public MolPayDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -151,6 +174,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -161,6 +185,7 @@ public void setIssuer(String issuer) { */ public MolPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -185,6 +210,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -195,6 +221,7 @@ public void setSdkData(String sdkData) { */ public MolPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -218,6 +245,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public MolPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this MolPayDetails object is equal to o. */ @@ -231,14 +279,26 @@ public boolean equals(Object o) { } MolPayDetails molPayDetails = (MolPayDetails) o; return Objects.equals(this.checkoutAttemptId, molPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, molPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, molPayDetails.issuer) + && Objects.equals(this.isSetIssuer, molPayDetails.isSetIssuer) && Objects.equals(this.sdkData, molPayDetails.sdkData) - && Objects.equals(this.type, molPayDetails.type); + && Objects.equals(this.isSetSdkData, molPayDetails.isSetSdkData) + && Objects.equals(this.type, molPayDetails.type) + && Objects.equals(this.isSetType, molPayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, issuer, sdkData, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -263,6 +323,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of MolPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Name.java b/src/main/java/com/adyen/model/checkout/Name.java index 4c60fa238..abad3e192 100644 --- a/src/main/java/com/adyen/model/checkout/Name.java +++ b/src/main/java/com/adyen/model/checkout/Name.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Name { public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Name() {} /** @@ -36,6 +50,7 @@ public Name() {} */ public Name firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setFirstName(String firstName) { */ public Name lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Name includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Name object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } Name name = (Name) o; return Objects.equals(this.firstName, name.firstName) - && Objects.equals(this.lastName, name.lastName); + && Objects.equals(this.isSetFirstName, name.isSetFirstName) + && Objects.equals(this.lastName, name.lastName) + && Objects.equals(this.isSetLastName, name.isSetLastName); } @Override public int hashCode() { - return Objects.hash(firstName, lastName); + return Objects.hash(firstName, isSetFirstName, lastName, isSetLastName); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Name given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java index b022c35dc..6a9718b9c 100644 --- a/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java +++ b/src/main/java/com/adyen/model/checkout/OpenInvoiceDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,25 +38,46 @@ public class OpenInvoiceDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **openinvoice** */ public enum TypeEnum { OPENINVOICE(String.valueOf("openinvoice")), @@ -101,6 +124,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public OpenInvoiceDetails() {} /** @@ -111,6 +143,7 @@ public OpenInvoiceDetails() {} */ public OpenInvoiceDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -134,6 +167,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -144,6 +178,7 @@ public void setBillingAddress(String billingAddress) { */ public OpenInvoiceDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -167,6 +202,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -177,6 +213,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public OpenInvoiceDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -200,6 +237,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -210,6 +248,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public OpenInvoiceDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -233,6 +272,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -247,6 +287,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public OpenInvoiceDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -278,6 +319,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -288,6 +330,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public OpenInvoiceDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -312,6 +355,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -324,6 +368,7 @@ public void setSdkData(String sdkData) { */ public OpenInvoiceDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -351,6 +396,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -361,6 +407,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public OpenInvoiceDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -384,6 +431,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public OpenInvoiceDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this OpenInvoiceDetails object is equal to o. */ @@ -397,27 +465,45 @@ public boolean equals(Object o) { } OpenInvoiceDetails openInvoiceDetails = (OpenInvoiceDetails) o; return Objects.equals(this.billingAddress, openInvoiceDetails.billingAddress) + && Objects.equals(this.isSetBillingAddress, openInvoiceDetails.isSetBillingAddress) && Objects.equals(this.checkoutAttemptId, openInvoiceDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, openInvoiceDetails.isSetCheckoutAttemptId) && Objects.equals(this.deliveryAddress, openInvoiceDetails.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, openInvoiceDetails.isSetDeliveryAddress) && Objects.equals(this.personalDetails, openInvoiceDetails.personalDetails) + && Objects.equals(this.isSetPersonalDetails, openInvoiceDetails.isSetPersonalDetails) && Objects.equals( this.recurringDetailReference, openInvoiceDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, openInvoiceDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, openInvoiceDetails.sdkData) + && Objects.equals(this.isSetSdkData, openInvoiceDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, openInvoiceDetails.storedPaymentMethodId) - && Objects.equals(this.type, openInvoiceDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, openInvoiceDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, openInvoiceDetails.type) + && Objects.equals(this.isSetType, openInvoiceDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingAddress, + isSetBillingAddress, checkoutAttemptId, + isSetCheckoutAttemptId, deliveryAddress, + isSetDeliveryAddress, personalDetails, + isSetPersonalDetails, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -450,6 +536,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of OpenInvoiceDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Passenger.java b/src/main/java/com/adyen/model/checkout/Passenger.java index ebc966312..4402103d1 100644 --- a/src/main/java/com/adyen/model/checkout/Passenger.java +++ b/src/main/java/com/adyen/model/checkout/Passenger.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,18 +32,39 @@ public class Passenger { public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_TRAVELLER_TYPE = "travellerType"; private String travellerType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTravellerType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Passenger() {} /** @@ -54,6 +77,7 @@ public Passenger() {} */ public Passenger dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -81,6 +105,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -93,6 +118,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public Passenger firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -120,6 +146,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -132,6 +159,7 @@ public void setFirstName(String firstName) { */ public Passenger lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -159,6 +187,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -173,6 +202,7 @@ public void setLastName(String lastName) { */ public Passenger phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -204,6 +234,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -216,6 +247,7 @@ public void setPhoneNumber(String phoneNumber) { */ public Passenger travellerType(String travellerType) { this.travellerType = travellerType; + isSetTravellerType = true; // mark as set return this; } @@ -243,6 +275,27 @@ public String getTravellerType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTravellerType(String travellerType) { this.travellerType = travellerType; + isSetTravellerType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Passenger includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Passenger object is equal to o. */ @@ -256,15 +309,30 @@ public boolean equals(Object o) { } Passenger passenger = (Passenger) o; return Objects.equals(this.dateOfBirth, passenger.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, passenger.isSetDateOfBirth) && Objects.equals(this.firstName, passenger.firstName) + && Objects.equals(this.isSetFirstName, passenger.isSetFirstName) && Objects.equals(this.lastName, passenger.lastName) + && Objects.equals(this.isSetLastName, passenger.isSetLastName) && Objects.equals(this.phoneNumber, passenger.phoneNumber) - && Objects.equals(this.travellerType, passenger.travellerType); + && Objects.equals(this.isSetPhoneNumber, passenger.isSetPhoneNumber) + && Objects.equals(this.travellerType, passenger.travellerType) + && Objects.equals(this.isSetTravellerType, passenger.isSetTravellerType); } @Override public int hashCode() { - return Objects.hash(dateOfBirth, firstName, lastName, phoneNumber, travellerType); + return Objects.hash( + dateOfBirth, + isSetDateOfBirth, + firstName, + isSetFirstName, + lastName, + isSetLastName, + phoneNumber, + isSetPhoneNumber, + travellerType, + isSetTravellerType); } @Override @@ -290,6 +358,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetTravellerType) { + addIfNull(nulls, JSON_PROPERTY_TRAVELLER_TYPE, this.travellerType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Passenger given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java index 2bff1e433..acbebda7f 100644 --- a/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayByBankAISDirectDebitDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,16 +35,28 @@ public class PayByBankAISDirectDebitDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **paybybank_AIS_DD** */ public enum TypeEnum { PAYBYBANK_AIS_DD(String.valueOf("paybybank_AIS_DD")); @@ -85,6 +99,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayByBankAISDirectDebitDetails() {} /** @@ -96,6 +119,7 @@ public PayByBankAISDirectDebitDetails() {} */ public PayByBankAISDirectDebitDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -119,6 +143,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -134,6 +159,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayByBankAISDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -165,6 +191,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -176,6 +203,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayByBankAISDirectDebitDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -200,6 +228,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -213,6 +242,7 @@ public void setSdkData(String sdkData) { */ public PayByBankAISDirectDebitDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -240,6 +270,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -251,6 +282,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayByBankAISDirectDebitDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -274,6 +306,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayByBankAISDirectDebitDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayByBankAISDirectDebitDetails object is equal to o. */ @@ -288,18 +341,37 @@ public boolean equals(Object o) { PayByBankAISDirectDebitDetails payByBankAISDirectDebitDetails = (PayByBankAISDirectDebitDetails) o; return Objects.equals(this.checkoutAttemptId, payByBankAISDirectDebitDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, payByBankAISDirectDebitDetails.isSetCheckoutAttemptId) && Objects.equals( this.recurringDetailReference, payByBankAISDirectDebitDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + payByBankAISDirectDebitDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payByBankAISDirectDebitDetails.sdkData) + && Objects.equals(this.isSetSdkData, payByBankAISDirectDebitDetails.isSetSdkData) && Objects.equals( this.storedPaymentMethodId, payByBankAISDirectDebitDetails.storedPaymentMethodId) - && Objects.equals(this.type, payByBankAISDirectDebitDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, + payByBankAISDirectDebitDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, payByBankAISDirectDebitDetails.type) + && Objects.equals(this.isSetType, payByBankAISDirectDebitDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -329,6 +401,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayByBankAISDirectDebitDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayByBankDetails.java b/src/main/java/com/adyen/model/checkout/PayByBankDetails.java index fb3cb443c..6227a3b37 100644 --- a/src/main/java/com/adyen/model/checkout/PayByBankDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayByBankDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class PayByBankDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ISSUER = "issuer"; private String issuer; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuer = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **paybybank** */ public enum TypeEnum { PAYBYBANK(String.valueOf("paybybank")); @@ -80,6 +91,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayByBankDetails() {} /** @@ -90,6 +110,7 @@ public PayByBankDetails() {} */ public PayByBankDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -113,6 +134,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -123,6 +145,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayByBankDetails issuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set return this; } @@ -146,6 +169,7 @@ public String getIssuer() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuer(String issuer) { this.issuer = issuer; + isSetIssuer = true; // mark as set } /** @@ -156,6 +180,7 @@ public void setIssuer(String issuer) { */ public PayByBankDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -180,6 +205,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setSdkData(String sdkData) { */ public PayByBankDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -213,6 +240,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayByBankDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayByBankDetails object is equal to o. */ @@ -226,14 +274,26 @@ public boolean equals(Object o) { } PayByBankDetails payByBankDetails = (PayByBankDetails) o; return Objects.equals(this.checkoutAttemptId, payByBankDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, payByBankDetails.isSetCheckoutAttemptId) && Objects.equals(this.issuer, payByBankDetails.issuer) + && Objects.equals(this.isSetIssuer, payByBankDetails.isSetIssuer) && Objects.equals(this.sdkData, payByBankDetails.sdkData) - && Objects.equals(this.type, payByBankDetails.type); + && Objects.equals(this.isSetSdkData, payByBankDetails.isSetSdkData) + && Objects.equals(this.type, payByBankDetails.type) + && Objects.equals(this.isSetType, payByBankDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, issuer, sdkData, type); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + issuer, + isSetIssuer, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -258,6 +318,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetIssuer) { + addIfNull(nulls, JSON_PROPERTY_ISSUER, this.issuer); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayByBankDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayPalDetails.java b/src/main/java/com/adyen/model/checkout/PayPalDetails.java index 559905097..af24d0a9c 100644 --- a/src/main/java/com/adyen/model/checkout/PayPalDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayPalDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,28 +40,52 @@ public class PayPalDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_ORDER_I_D = "orderID"; private String orderID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderID = false; + public static final String JSON_PROPERTY_PAYEE_PREFERRED = "payeePreferred"; private String payeePreferred; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayeePreferred = false; + public static final String JSON_PROPERTY_PAYER_I_D = "payerID"; private String payerID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayerID = false; + public static final String JSON_PROPERTY_PAYER_SELECTED = "payerSelected"; private String payerSelected; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayerSelected = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** The type of flow to initiate. */ public enum SubtypeEnum { EXPRESS(String.valueOf("express")), @@ -106,6 +132,9 @@ public static SubtypeEnum fromValue(String value) { public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private SubtypeEnum subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** **paypal** */ public enum TypeEnum { PAYPAL(String.valueOf("paypal")); @@ -148,6 +177,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayPalDetails() {} /** @@ -158,6 +196,7 @@ public PayPalDetails() {} */ public PayPalDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -181,6 +220,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +231,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayPalDetails orderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set return this; } @@ -214,6 +255,7 @@ public String getOrderID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set } /** @@ -224,6 +266,7 @@ public void setOrderID(String orderID) { */ public PayPalDetails payeePreferred(String payeePreferred) { this.payeePreferred = payeePreferred; + isSetPayeePreferred = true; // mark as set return this; } @@ -247,6 +290,7 @@ public String getPayeePreferred() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayeePreferred(String payeePreferred) { this.payeePreferred = payeePreferred; + isSetPayeePreferred = true; // mark as set } /** @@ -257,6 +301,7 @@ public void setPayeePreferred(String payeePreferred) { */ public PayPalDetails payerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set return this; } @@ -280,6 +325,7 @@ public String getPayerID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set } /** @@ -290,6 +336,7 @@ public void setPayerID(String payerID) { */ public PayPalDetails payerSelected(String payerSelected) { this.payerSelected = payerSelected; + isSetPayerSelected = true; // mark as set return this; } @@ -313,6 +360,7 @@ public String getPayerSelected() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayerSelected(String payerSelected) { this.payerSelected = payerSelected; + isSetPayerSelected = true; // mark as set } /** @@ -327,6 +375,7 @@ public void setPayerSelected(String payerSelected) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayPalDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -358,6 +407,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -368,6 +418,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayPalDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -392,6 +443,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -404,6 +456,7 @@ public void setSdkData(String sdkData) { */ public PayPalDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -431,6 +484,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -441,6 +495,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayPalDetails subtype(SubtypeEnum subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -464,6 +519,7 @@ public SubtypeEnum getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(SubtypeEnum subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -474,6 +530,7 @@ public void setSubtype(SubtypeEnum subtype) { */ public PayPalDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -497,6 +554,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayPalDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayPalDetails object is equal to o. */ @@ -510,30 +588,51 @@ public boolean equals(Object o) { } PayPalDetails payPalDetails = (PayPalDetails) o; return Objects.equals(this.checkoutAttemptId, payPalDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, payPalDetails.isSetCheckoutAttemptId) && Objects.equals(this.orderID, payPalDetails.orderID) + && Objects.equals(this.isSetOrderID, payPalDetails.isSetOrderID) && Objects.equals(this.payeePreferred, payPalDetails.payeePreferred) + && Objects.equals(this.isSetPayeePreferred, payPalDetails.isSetPayeePreferred) && Objects.equals(this.payerID, payPalDetails.payerID) + && Objects.equals(this.isSetPayerID, payPalDetails.isSetPayerID) && Objects.equals(this.payerSelected, payPalDetails.payerSelected) + && Objects.equals(this.isSetPayerSelected, payPalDetails.isSetPayerSelected) && Objects.equals(this.recurringDetailReference, payPalDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, payPalDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payPalDetails.sdkData) + && Objects.equals(this.isSetSdkData, payPalDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, payPalDetails.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, payPalDetails.isSetStoredPaymentMethodId) && Objects.equals(this.subtype, payPalDetails.subtype) - && Objects.equals(this.type, payPalDetails.type); + && Objects.equals(this.isSetSubtype, payPalDetails.isSetSubtype) + && Objects.equals(this.type, payPalDetails.type) + && Objects.equals(this.isSetType, payPalDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, orderID, + isSetOrderID, payeePreferred, + isSetPayeePreferred, payerID, + isSetPayerID, payerSelected, + isSetPayerSelected, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, subtype, - type); + isSetSubtype, + type, + isSetType); } @Override @@ -568,6 +667,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetOrderID) { + addIfNull(nulls, JSON_PROPERTY_ORDER_I_D, this.orderID); + } + if (isSetPayeePreferred) { + addIfNull(nulls, JSON_PROPERTY_PAYEE_PREFERRED, this.payeePreferred); + } + if (isSetPayerID) { + addIfNull(nulls, JSON_PROPERTY_PAYER_I_D, this.payerID); + } + if (isSetPayerSelected) { + addIfNull(nulls, JSON_PROPERTY_PAYER_SELECTED, this.payerSelected); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayPalDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayPayDetails.java b/src/main/java/com/adyen/model/checkout/PayPayDetails.java index 5b6ba6a49..d020346fa 100644 --- a/src/main/java/com/adyen/model/checkout/PayPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,16 +35,28 @@ public class PayPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **paypay** */ public enum TypeEnum { PAYPAY(String.valueOf("paypay")); @@ -85,6 +99,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayPayDetails() {} /** @@ -95,6 +118,7 @@ public PayPayDetails() {} */ public PayPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -118,6 +142,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +157,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -163,6 +189,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -173,6 +200,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -197,6 +225,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -209,6 +238,7 @@ public void setSdkData(String sdkData) { */ public PayPayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -236,6 +266,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -246,6 +277,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -269,6 +301,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayPayDetails object is equal to o. */ @@ -282,16 +335,31 @@ public boolean equals(Object o) { } PayPayDetails payPayDetails = (PayPayDetails) o; return Objects.equals(this.checkoutAttemptId, payPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, payPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, payPayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, payPayDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payPayDetails.sdkData) + && Objects.equals(this.isSetSdkData, payPayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, payPayDetails.storedPaymentMethodId) - && Objects.equals(this.type, payPayDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, payPayDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, payPayDetails.type) + && Objects.equals(this.isSetType, payPayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -321,6 +389,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayToDetails.java b/src/main/java/com/adyen/model/checkout/PayToDetails.java index 92a6be26c..04adb6117 100644 --- a/src/main/java/com/adyen/model/checkout/PayToDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayToDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class PayToDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_ACCOUNT_IDENTIFIER = "shopperAccountIdentifier"; private String shopperAccountIdentifier; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperAccountIdentifier = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **payto** */ public enum TypeEnum { PAYTO(String.valueOf("payto")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayToDetails() {} /** @@ -99,6 +125,7 @@ public PayToDetails() {} */ public PayToDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayToDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayToDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -201,6 +232,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -212,6 +244,7 @@ public void setSdkData(String sdkData) { */ public PayToDetails shopperAccountIdentifier(String shopperAccountIdentifier) { this.shopperAccountIdentifier = shopperAccountIdentifier; + isSetShopperAccountIdentifier = true; // mark as set return this; } @@ -237,6 +270,7 @@ public String getShopperAccountIdentifier() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperAccountIdentifier(String shopperAccountIdentifier) { this.shopperAccountIdentifier = shopperAccountIdentifier; + isSetShopperAccountIdentifier = true; // mark as set } /** @@ -249,6 +283,7 @@ public void setShopperAccountIdentifier(String shopperAccountIdentifier) { */ public PayToDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -276,6 +311,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -286,6 +322,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayToDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -309,6 +346,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayToDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayToDetails object is equal to o. */ @@ -322,22 +380,36 @@ public boolean equals(Object o) { } PayToDetails payToDetails = (PayToDetails) o; return Objects.equals(this.checkoutAttemptId, payToDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, payToDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, payToDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, payToDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payToDetails.sdkData) + && Objects.equals(this.isSetSdkData, payToDetails.isSetSdkData) && Objects.equals(this.shopperAccountIdentifier, payToDetails.shopperAccountIdentifier) + && Objects.equals( + this.isSetShopperAccountIdentifier, payToDetails.isSetShopperAccountIdentifier) && Objects.equals(this.storedPaymentMethodId, payToDetails.storedPaymentMethodId) - && Objects.equals(this.type, payToDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, payToDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, payToDetails.type) + && Objects.equals(this.isSetType, payToDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperAccountIdentifier, + isSetShopperAccountIdentifier, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -370,6 +442,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperAccountIdentifier) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_ACCOUNT_IDENTIFIER, this.shopperAccountIdentifier); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayToDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java b/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java index c062dfc60..491a80522 100644 --- a/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PayToPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class PayToPaymentMethod extends ShopperIdPaymentMethod { public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayToPaymentMethod() {} /** @@ -46,6 +57,7 @@ public PayToPaymentMethod() {} */ public PayToPaymentMethod shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayToPaymentMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayToPaymentMethod object is equal to o. */ @@ -82,12 +115,13 @@ public boolean equals(Object o) { } PayToPaymentMethod payToPaymentMethod = (PayToPaymentMethod) o; return Objects.equals(this.shopperReference, payToPaymentMethod.shopperReference) + && Objects.equals(this.isSetShopperReference, payToPaymentMethod.isSetShopperReference) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(shopperReference, super.hashCode()); + return Objects.hash(shopperReference, isSetShopperReference, super.hashCode()); } @Override @@ -117,6 +151,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(PayToPaymentMethod.class, "type", mappings); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayToPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java index 178fe2a76..6217c5623 100644 --- a/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayUUpiDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,20 +37,35 @@ public class PayUUpiDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **payu_IN_upi** */ public enum TypeEnum { PAYU_IN_UPI(String.valueOf("payu_IN_upi")); @@ -91,9 +108,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS = "virtualPaymentAddress"; private String virtualPaymentAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVirtualPaymentAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayUUpiDetails() {} /** @@ -104,6 +133,7 @@ public PayUUpiDetails() {} */ public PayUUpiDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -127,6 +157,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -141,6 +172,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayUUpiDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -172,6 +204,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -182,6 +215,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayUUpiDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -206,6 +240,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -218,6 +253,7 @@ public void setSdkData(String sdkData) { */ public PayUUpiDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -245,6 +281,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -257,6 +294,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public PayUUpiDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -284,6 +322,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -294,6 +333,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayUUpiDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -317,6 +357,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -327,6 +368,7 @@ public void setType(TypeEnum type) { */ public PayUUpiDetails virtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set return this; } @@ -350,6 +392,27 @@ public String getVirtualPaymentAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayUUpiDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayUUpiDetails object is equal to o. */ @@ -363,25 +426,44 @@ public boolean equals(Object o) { } PayUUpiDetails payUUpiDetails = (PayUUpiDetails) o; return Objects.equals(this.checkoutAttemptId, payUUpiDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, payUUpiDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, payUUpiDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, payUUpiDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payUUpiDetails.sdkData) + && Objects.equals(this.isSetSdkData, payUUpiDetails.isSetSdkData) && Objects.equals( this.shopperNotificationReference, payUUpiDetails.shopperNotificationReference) + && Objects.equals( + this.isSetShopperNotificationReference, + payUUpiDetails.isSetShopperNotificationReference) && Objects.equals(this.storedPaymentMethodId, payUUpiDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, payUUpiDetails.isSetStoredPaymentMethodId) && Objects.equals(this.type, payUUpiDetails.type) - && Objects.equals(this.virtualPaymentAddress, payUUpiDetails.virtualPaymentAddress); + && Objects.equals(this.isSetType, payUUpiDetails.isSetType) + && Objects.equals(this.virtualPaymentAddress, payUUpiDetails.virtualPaymentAddress) + && Objects.equals( + this.isSetVirtualPaymentAddress, payUUpiDetails.isSetVirtualPaymentAddress); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperNotificationReference, + isSetShopperNotificationReference, storedPaymentMethodId, + isSetStoredPaymentMethodId, type, - virtualPaymentAddress); + isSetType, + virtualPaymentAddress, + isSetVirtualPaymentAddress); } @Override @@ -417,6 +499,49 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVirtualPaymentAddress) { + addIfNull(nulls, JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS, this.virtualPaymentAddress); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayUUpiDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java index 4f9b2dee9..5f1306244 100644 --- a/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java +++ b/src/main/java/com/adyen/model/checkout/PayWithGoogleDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,6 +38,9 @@ public class PayWithGoogleDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -43,7 +48,9 @@ public class PayWithGoogleDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -83,22 +90,40 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **paywithgoogle** */ public enum TypeEnum { PAYWITHGOOGLE(String.valueOf("paywithgoogle")); @@ -141,6 +166,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayWithGoogleDetails() {} /** @@ -151,6 +185,7 @@ public PayWithGoogleDetails() {} */ public PayWithGoogleDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -174,6 +209,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -187,6 +223,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayWithGoogleDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -216,6 +253,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +268,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PayWithGoogleDetails googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -261,6 +300,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -275,6 +315,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayWithGoogleDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -306,6 +347,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -316,6 +358,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayWithGoogleDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -340,6 +383,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -352,6 +396,7 @@ public void setSdkData(String sdkData) { */ public PayWithGoogleDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -379,6 +424,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -390,6 +436,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayWithGoogleDetails threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -415,6 +462,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -425,6 +473,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public PayWithGoogleDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -448,6 +497,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayWithGoogleDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayWithGoogleDetails object is equal to o. */ @@ -461,27 +531,46 @@ public boolean equals(Object o) { } PayWithGoogleDetails payWithGoogleDetails = (PayWithGoogleDetails) o; return Objects.equals(this.checkoutAttemptId, payWithGoogleDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, payWithGoogleDetails.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, payWithGoogleDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, payWithGoogleDetails.isSetFundingSource) && Objects.equals(this.googlePayToken, payWithGoogleDetails.googlePayToken) + && Objects.equals(this.isSetGooglePayToken, payWithGoogleDetails.isSetGooglePayToken) && Objects.equals( this.recurringDetailReference, payWithGoogleDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, payWithGoogleDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payWithGoogleDetails.sdkData) + && Objects.equals(this.isSetSdkData, payWithGoogleDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, payWithGoogleDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, payWithGoogleDetails.isSetStoredPaymentMethodId) && Objects.equals(this.threeDS2SdkVersion, payWithGoogleDetails.threeDS2SdkVersion) - && Objects.equals(this.type, payWithGoogleDetails.type); + && Objects.equals( + this.isSetThreeDS2SdkVersion, payWithGoogleDetails.isSetThreeDS2SdkVersion) + && Objects.equals(this.type, payWithGoogleDetails.type) + && Objects.equals(this.isSetType, payWithGoogleDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, googlePayToken, + isSetGooglePayToken, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, threeDS2SdkVersion, - type); + isSetThreeDS2SdkVersion, + type, + isSetType); } @Override @@ -514,6 +603,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayWithGoogleDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java b/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java index 465a84035..367e90426 100644 --- a/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java +++ b/src/main/java/com/adyen/model/checkout/PayWithGoogleDonations.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,6 +38,9 @@ public class PayWithGoogleDonations { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -43,7 +48,9 @@ public class PayWithGoogleDonations { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -83,22 +90,40 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_GOOGLE_PAY_TOKEN = "googlePayToken"; private String googlePayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGooglePayToken = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_THREE_D_S2_SDK_VERSION = "threeDS2SdkVersion"; private String threeDS2SdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2SdkVersion = false; + /** **paywithgoogle** */ public enum TypeEnum { PAYWITHGOOGLE(String.valueOf("paywithgoogle")); @@ -141,6 +166,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PayWithGoogleDonations() {} /** @@ -151,6 +185,7 @@ public PayWithGoogleDonations() {} */ public PayWithGoogleDonations checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -174,6 +209,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -187,6 +223,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PayWithGoogleDonations fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -216,6 +253,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -230,6 +268,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PayWithGoogleDonations googlePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set return this; } @@ -261,6 +300,7 @@ public String getGooglePayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGooglePayToken(String googlePayToken) { this.googlePayToken = googlePayToken; + isSetGooglePayToken = true; // mark as set } /** @@ -275,6 +315,7 @@ public void setGooglePayToken(String googlePayToken) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PayWithGoogleDonations recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -306,6 +347,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -316,6 +358,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PayWithGoogleDonations sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -340,6 +383,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -352,6 +396,7 @@ public void setSdkData(String sdkData) { */ public PayWithGoogleDonations storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -379,6 +424,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -390,6 +436,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PayWithGoogleDonations threeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set return this; } @@ -415,6 +462,7 @@ public String getThreeDS2SdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { this.threeDS2SdkVersion = threeDS2SdkVersion; + isSetThreeDS2SdkVersion = true; // mark as set } /** @@ -425,6 +473,7 @@ public void setThreeDS2SdkVersion(String threeDS2SdkVersion) { */ public PayWithGoogleDonations type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -448,6 +497,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PayWithGoogleDonations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PayWithGoogleDonations object is equal to o. */ @@ -461,27 +531,48 @@ public boolean equals(Object o) { } PayWithGoogleDonations payWithGoogleDonations = (PayWithGoogleDonations) o; return Objects.equals(this.checkoutAttemptId, payWithGoogleDonations.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, payWithGoogleDonations.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, payWithGoogleDonations.fundingSource) + && Objects.equals(this.isSetFundingSource, payWithGoogleDonations.isSetFundingSource) && Objects.equals(this.googlePayToken, payWithGoogleDonations.googlePayToken) + && Objects.equals(this.isSetGooglePayToken, payWithGoogleDonations.isSetGooglePayToken) && Objects.equals( this.recurringDetailReference, payWithGoogleDonations.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + payWithGoogleDonations.isSetRecurringDetailReference) && Objects.equals(this.sdkData, payWithGoogleDonations.sdkData) + && Objects.equals(this.isSetSdkData, payWithGoogleDonations.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, payWithGoogleDonations.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, payWithGoogleDonations.isSetStoredPaymentMethodId) && Objects.equals(this.threeDS2SdkVersion, payWithGoogleDonations.threeDS2SdkVersion) - && Objects.equals(this.type, payWithGoogleDonations.type); + && Objects.equals( + this.isSetThreeDS2SdkVersion, payWithGoogleDonations.isSetThreeDS2SdkVersion) + && Objects.equals(this.type, payWithGoogleDonations.type) + && Objects.equals(this.isSetType, payWithGoogleDonations.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, googlePayToken, + isSetGooglePayToken, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, threeDS2SdkVersion, - type); + isSetThreeDS2SdkVersion, + type, + isSetType); } @Override @@ -514,6 +605,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGooglePayToken) { + addIfNull(nulls, JSON_PROPERTY_GOOGLE_PAY_TOKEN, this.googlePayToken); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetThreeDS2SdkVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_SDK_VERSION, this.threeDS2SdkVersion); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PayWithGoogleDonations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Payment.java b/src/main/java/com/adyen/model/checkout/Payment.java index a304cdf30..680082ff9 100644 --- a/src/main/java/com/adyen/model/checkout/Payment.java +++ b/src/main/java/com/adyen/model/checkout/Payment.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,12 +34,21 @@ public class Payment { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private ResponsePaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -85,6 +96,15 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Payment() {} /** @@ -95,6 +115,7 @@ public Payment() {} */ public Payment amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -118,6 +139,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -128,6 +150,7 @@ public void setAmount(Amount amount) { */ public Payment paymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -151,6 +174,7 @@ public ResponsePaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -164,6 +188,7 @@ public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { */ public Payment pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -193,6 +218,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -209,6 +235,7 @@ public void setPspReference(String pspReference) { */ public Payment resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -244,6 +271,27 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Payment includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Payment object is equal to o. */ @@ -257,14 +305,26 @@ public boolean equals(Object o) { } Payment payment = (Payment) o; return Objects.equals(this.amount, payment.amount) + && Objects.equals(this.isSetAmount, payment.isSetAmount) && Objects.equals(this.paymentMethod, payment.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, payment.isSetPaymentMethod) && Objects.equals(this.pspReference, payment.pspReference) - && Objects.equals(this.resultCode, payment.resultCode); + && Objects.equals(this.isSetPspReference, payment.isSetPspReference) + && Objects.equals(this.resultCode, payment.resultCode) + && Objects.equals(this.isSetResultCode, payment.isSetResultCode); } @Override public int hashCode() { - return Objects.hash(amount, paymentMethod, pspReference, resultCode); + return Objects.hash( + amount, + isSetAmount, + paymentMethod, + isSetPaymentMethod, + pspReference, + isSetPspReference, + resultCode, + isSetResultCode); } @Override @@ -289,6 +349,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Payment given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java index 008fc7854..0fc121675 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,12 +40,21 @@ public class PaymentAmountUpdateRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + /** * The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * * **installment** @@ -93,18 +104,39 @@ public static IndustryUsageEnum fromValue(String value) { public static final String JSON_PROPERTY_INDUSTRY_USAGE = "industryUsage"; private IndustryUsageEnum industryUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryUsage = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentAmountUpdateRequest() {} /** @@ -115,6 +147,7 @@ public PaymentAmountUpdateRequest() {} */ public PaymentAmountUpdateRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -138,6 +171,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -148,6 +182,7 @@ public void setAmount(Amount amount) { */ public PaymentAmountUpdateRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -171,6 +206,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -181,6 +217,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentAmountUpdateRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -204,6 +241,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -216,6 +254,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentAmountUpdateRequest industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -243,6 +282,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -259,6 +299,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public PaymentAmountUpdateRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -302,6 +343,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -312,6 +354,7 @@ public void setLineItems(List lineItems) { */ public PaymentAmountUpdateRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -335,6 +378,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -345,6 +389,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentAmountUpdateRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -368,6 +413,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -384,6 +430,7 @@ public void setReference(String reference) { */ public PaymentAmountUpdateRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -427,6 +474,27 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAmountUpdateRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentAmountUpdateRequest object is equal to o. */ @@ -440,26 +508,45 @@ public boolean equals(Object o) { } PaymentAmountUpdateRequest paymentAmountUpdateRequest = (PaymentAmountUpdateRequest) o; return Objects.equals(this.amount, paymentAmountUpdateRequest.amount) + && Objects.equals(this.isSetAmount, paymentAmountUpdateRequest.isSetAmount) && Objects.equals(this.applicationInfo, paymentAmountUpdateRequest.applicationInfo) + && Objects.equals( + this.isSetApplicationInfo, paymentAmountUpdateRequest.isSetApplicationInfo) && Objects.equals(this.enhancedSchemeData, paymentAmountUpdateRequest.enhancedSchemeData) + && Objects.equals( + this.isSetEnhancedSchemeData, paymentAmountUpdateRequest.isSetEnhancedSchemeData) && Objects.equals(this.industryUsage, paymentAmountUpdateRequest.industryUsage) + && Objects.equals(this.isSetIndustryUsage, paymentAmountUpdateRequest.isSetIndustryUsage) && Objects.equals(this.lineItems, paymentAmountUpdateRequest.lineItems) + && Objects.equals(this.isSetLineItems, paymentAmountUpdateRequest.isSetLineItems) && Objects.equals(this.merchantAccount, paymentAmountUpdateRequest.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, paymentAmountUpdateRequest.isSetMerchantAccount) && Objects.equals(this.reference, paymentAmountUpdateRequest.reference) - && Objects.equals(this.splits, paymentAmountUpdateRequest.splits); + && Objects.equals(this.isSetReference, paymentAmountUpdateRequest.isSetReference) + && Objects.equals(this.splits, paymentAmountUpdateRequest.splits) + && Objects.equals(this.isSetSplits, paymentAmountUpdateRequest.isSetSplits); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, enhancedSchemeData, + isSetEnhancedSchemeData, industryUsage, + isSetIndustryUsage, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, reference, - splits); + isSetReference, + splits, + isSetSplits); } @Override @@ -488,6 +575,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentAmountUpdateRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java index 74d2ea74d..1605eb990 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentAmountUpdateResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,6 +41,9 @@ public class PaymentAmountUpdateResponse { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * * **installment** @@ -88,24 +93,45 @@ public static IndustryUsageEnum fromValue(String value) { public static final String JSON_PROPERTY_INDUSTRY_USAGE = "industryUsage"; private IndustryUsageEnum industryUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryUsage = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -148,6 +174,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentAmountUpdateResponse() {} /** @@ -158,6 +193,7 @@ public PaymentAmountUpdateResponse() {} */ public PaymentAmountUpdateResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -181,6 +217,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -193,6 +230,7 @@ public void setAmount(Amount amount) { */ public PaymentAmountUpdateResponse industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -220,6 +258,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -236,6 +275,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public PaymentAmountUpdateResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -279,6 +319,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -289,6 +330,7 @@ public void setLineItems(List lineItems) { */ public PaymentAmountUpdateResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -312,6 +354,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -326,6 +369,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentAmountUpdateResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -357,6 +401,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -368,6 +413,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentAmountUpdateResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -393,6 +439,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -403,6 +450,7 @@ public void setPspReference(String pspReference) { */ public PaymentAmountUpdateResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -426,6 +474,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -442,6 +491,7 @@ public void setReference(String reference) { */ public PaymentAmountUpdateResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -485,6 +535,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -495,6 +546,7 @@ public void setSplits(List splits) { */ public PaymentAmountUpdateResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -518,6 +570,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentAmountUpdateResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentAmountUpdateResponse object is equal to o. */ @@ -531,28 +604,48 @@ public boolean equals(Object o) { } PaymentAmountUpdateResponse paymentAmountUpdateResponse = (PaymentAmountUpdateResponse) o; return Objects.equals(this.amount, paymentAmountUpdateResponse.amount) + && Objects.equals(this.isSetAmount, paymentAmountUpdateResponse.isSetAmount) && Objects.equals(this.industryUsage, paymentAmountUpdateResponse.industryUsage) + && Objects.equals(this.isSetIndustryUsage, paymentAmountUpdateResponse.isSetIndustryUsage) && Objects.equals(this.lineItems, paymentAmountUpdateResponse.lineItems) + && Objects.equals(this.isSetLineItems, paymentAmountUpdateResponse.isSetLineItems) && Objects.equals(this.merchantAccount, paymentAmountUpdateResponse.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, paymentAmountUpdateResponse.isSetMerchantAccount) && Objects.equals(this.paymentPspReference, paymentAmountUpdateResponse.paymentPspReference) + && Objects.equals( + this.isSetPaymentPspReference, paymentAmountUpdateResponse.isSetPaymentPspReference) && Objects.equals(this.pspReference, paymentAmountUpdateResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentAmountUpdateResponse.isSetPspReference) && Objects.equals(this.reference, paymentAmountUpdateResponse.reference) + && Objects.equals(this.isSetReference, paymentAmountUpdateResponse.isSetReference) && Objects.equals(this.splits, paymentAmountUpdateResponse.splits) - && Objects.equals(this.status, paymentAmountUpdateResponse.status); + && Objects.equals(this.isSetSplits, paymentAmountUpdateResponse.isSetSplits) + && Objects.equals(this.status, paymentAmountUpdateResponse.status) + && Objects.equals(this.isSetStatus, paymentAmountUpdateResponse.isSetStatus); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, industryUsage, + isSetIndustryUsage, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, paymentPspReference, + isSetPaymentPspReference, pspReference, + isSetPspReference, reference, + isSetReference, splits, - status); + isSetSplits, + status, + isSetStatus); } @Override @@ -584,6 +677,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentAmountUpdateResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java b/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java index cbc66d8f2..591ef9e19 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCancelRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PaymentCancelRequest { public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCancelRequest() {} /** @@ -47,6 +67,7 @@ public PaymentCancelRequest() {} */ public PaymentCancelRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -70,6 +91,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentCancelRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -103,6 +126,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentCancelRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentCancelRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCancelRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentCancelRequest object is equal to o. */ @@ -182,14 +230,27 @@ public boolean equals(Object o) { } PaymentCancelRequest paymentCancelRequest = (PaymentCancelRequest) o; return Objects.equals(this.applicationInfo, paymentCancelRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentCancelRequest.isSetApplicationInfo) && Objects.equals(this.enhancedSchemeData, paymentCancelRequest.enhancedSchemeData) + && Objects.equals( + this.isSetEnhancedSchemeData, paymentCancelRequest.isSetEnhancedSchemeData) && Objects.equals(this.merchantAccount, paymentCancelRequest.merchantAccount) - && Objects.equals(this.reference, paymentCancelRequest.reference); + && Objects.equals(this.isSetMerchantAccount, paymentCancelRequest.isSetMerchantAccount) + && Objects.equals(this.reference, paymentCancelRequest.reference) + && Objects.equals(this.isSetReference, paymentCancelRequest.isSetReference); } @Override public int hashCode() { - return Objects.hash(applicationInfo, enhancedSchemeData, merchantAccount, reference); + return Objects.hash( + applicationInfo, + isSetApplicationInfo, + enhancedSchemeData, + isSetEnhancedSchemeData, + merchantAccount, + isSetMerchantAccount, + reference, + isSetReference); } @Override @@ -214,6 +275,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentCancelRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java b/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java index 87cf7cf9b..2712b88a7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCancelResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class PaymentCancelResponse { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -84,6 +98,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCancelResponse() {} /** @@ -94,6 +117,7 @@ public PaymentCancelResponse() {} */ public PaymentCancelResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -131,6 +156,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentCancelResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -162,6 +188,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -172,6 +199,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentCancelResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -195,6 +223,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -205,6 +234,7 @@ public void setPspReference(String pspReference) { */ public PaymentCancelResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -228,6 +258,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -238,6 +269,7 @@ public void setReference(String reference) { */ public PaymentCancelResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +293,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCancelResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentCancelResponse object is equal to o. */ @@ -274,15 +327,31 @@ public boolean equals(Object o) { } PaymentCancelResponse paymentCancelResponse = (PaymentCancelResponse) o; return Objects.equals(this.merchantAccount, paymentCancelResponse.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentCancelResponse.isSetMerchantAccount) && Objects.equals(this.paymentPspReference, paymentCancelResponse.paymentPspReference) + && Objects.equals( + this.isSetPaymentPspReference, paymentCancelResponse.isSetPaymentPspReference) && Objects.equals(this.pspReference, paymentCancelResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentCancelResponse.isSetPspReference) && Objects.equals(this.reference, paymentCancelResponse.reference) - && Objects.equals(this.status, paymentCancelResponse.status); + && Objects.equals(this.isSetReference, paymentCancelResponse.isSetReference) + && Objects.equals(this.status, paymentCancelResponse.status) + && Objects.equals(this.isSetStatus, paymentCancelResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(merchantAccount, paymentPspReference, pspReference, reference, status); + return Objects.hash( + merchantAccount, + isSetMerchantAccount, + paymentPspReference, + isSetPaymentPspReference, + pspReference, + isSetPspReference, + reference, + isSetReference, + status, + isSetStatus); } @Override @@ -310,6 +379,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentCancelResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java index 83a700282..81e2a8375 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,30 +37,63 @@ public class PaymentCaptureRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_SUB_MERCHANTS = "subMerchants"; private List subMerchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCaptureRequest() {} /** @@ -69,6 +104,7 @@ public PaymentCaptureRequest() {} */ public PaymentCaptureRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -92,6 +128,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -102,6 +139,7 @@ public void setAmount(Amount amount) { */ public PaymentCaptureRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -125,6 +163,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -135,6 +174,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentCaptureRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -158,6 +198,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -174,6 +215,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentCaptureRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -217,6 +259,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -227,6 +270,7 @@ public void setLineItems(List lineItems) { */ public PaymentCaptureRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -250,6 +294,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -261,6 +306,7 @@ public void setMerchantAccount(String merchantAccount) { public PaymentCaptureRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -284,6 +330,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -294,6 +341,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentCaptureRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -317,6 +365,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -333,6 +382,7 @@ public void setReference(String reference) { */ public PaymentCaptureRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -376,6 +426,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -386,6 +437,7 @@ public void setSplits(List splits) { */ public PaymentCaptureRequest subMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set return this; } @@ -417,6 +469,27 @@ public List getSubMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCaptureRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentCaptureRequest object is equal to o. */ @@ -430,29 +503,49 @@ public boolean equals(Object o) { } PaymentCaptureRequest paymentCaptureRequest = (PaymentCaptureRequest) o; return Objects.equals(this.amount, paymentCaptureRequest.amount) + && Objects.equals(this.isSetAmount, paymentCaptureRequest.isSetAmount) && Objects.equals(this.applicationInfo, paymentCaptureRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentCaptureRequest.isSetApplicationInfo) && Objects.equals(this.enhancedSchemeData, paymentCaptureRequest.enhancedSchemeData) + && Objects.equals( + this.isSetEnhancedSchemeData, paymentCaptureRequest.isSetEnhancedSchemeData) && Objects.equals(this.lineItems, paymentCaptureRequest.lineItems) + && Objects.equals(this.isSetLineItems, paymentCaptureRequest.isSetLineItems) && Objects.equals(this.merchantAccount, paymentCaptureRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentCaptureRequest.isSetMerchantAccount) && Objects.equals( this.platformChargebackLogic, paymentCaptureRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, paymentCaptureRequest.isSetPlatformChargebackLogic) && Objects.equals(this.reference, paymentCaptureRequest.reference) + && Objects.equals(this.isSetReference, paymentCaptureRequest.isSetReference) && Objects.equals(this.splits, paymentCaptureRequest.splits) - && Objects.equals(this.subMerchants, paymentCaptureRequest.subMerchants); + && Objects.equals(this.isSetSplits, paymentCaptureRequest.isSetSplits) + && Objects.equals(this.subMerchants, paymentCaptureRequest.subMerchants) + && Objects.equals(this.isSetSubMerchants, paymentCaptureRequest.isSetSubMerchants); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, enhancedSchemeData, + isSetEnhancedSchemeData, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, platformChargebackLogic, + isSetPlatformChargebackLogic, reference, + isSetReference, splits, - subMerchants); + isSetSplits, + subMerchants, + isSetSubMerchants); } @Override @@ -484,6 +577,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetSubMerchants) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANTS, this.subMerchants); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentCaptureRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java b/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java index c3c9b78e0..23aa3eed9 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCaptureResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,27 +42,51 @@ public class PaymentCaptureResponse { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -103,9 +129,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_SUB_MERCHANTS = "subMerchants"; private List subMerchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchants = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCaptureResponse() {} /** @@ -116,6 +154,7 @@ public PaymentCaptureResponse() {} */ public PaymentCaptureResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -139,6 +178,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -155,6 +195,7 @@ public void setAmount(Amount amount) { */ public PaymentCaptureResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -198,6 +239,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -208,6 +250,7 @@ public void setLineItems(List lineItems) { */ public PaymentCaptureResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -231,6 +274,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -245,6 +289,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentCaptureResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -276,6 +321,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -287,6 +333,7 @@ public void setPaymentPspReference(String paymentPspReference) { public PaymentCaptureResponse platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -310,6 +357,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -320,6 +368,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentCaptureResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -343,6 +392,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -353,6 +403,7 @@ public void setPspReference(String pspReference) { */ public PaymentCaptureResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -376,6 +427,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -392,6 +444,7 @@ public void setReference(String reference) { */ public PaymentCaptureResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -435,6 +488,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -445,6 +499,7 @@ public void setSplits(List splits) { */ public PaymentCaptureResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -468,6 +523,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -478,6 +534,7 @@ public void setStatus(StatusEnum status) { */ public PaymentCaptureResponse subMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set return this; } @@ -509,6 +566,27 @@ public List getSubMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCaptureResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentCaptureResponse object is equal to o. */ @@ -522,31 +600,53 @@ public boolean equals(Object o) { } PaymentCaptureResponse paymentCaptureResponse = (PaymentCaptureResponse) o; return Objects.equals(this.amount, paymentCaptureResponse.amount) + && Objects.equals(this.isSetAmount, paymentCaptureResponse.isSetAmount) && Objects.equals(this.lineItems, paymentCaptureResponse.lineItems) + && Objects.equals(this.isSetLineItems, paymentCaptureResponse.isSetLineItems) && Objects.equals(this.merchantAccount, paymentCaptureResponse.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentCaptureResponse.isSetMerchantAccount) && Objects.equals(this.paymentPspReference, paymentCaptureResponse.paymentPspReference) + && Objects.equals( + this.isSetPaymentPspReference, paymentCaptureResponse.isSetPaymentPspReference) && Objects.equals( this.platformChargebackLogic, paymentCaptureResponse.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, paymentCaptureResponse.isSetPlatformChargebackLogic) && Objects.equals(this.pspReference, paymentCaptureResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentCaptureResponse.isSetPspReference) && Objects.equals(this.reference, paymentCaptureResponse.reference) + && Objects.equals(this.isSetReference, paymentCaptureResponse.isSetReference) && Objects.equals(this.splits, paymentCaptureResponse.splits) + && Objects.equals(this.isSetSplits, paymentCaptureResponse.isSetSplits) && Objects.equals(this.status, paymentCaptureResponse.status) - && Objects.equals(this.subMerchants, paymentCaptureResponse.subMerchants); + && Objects.equals(this.isSetStatus, paymentCaptureResponse.isSetStatus) + && Objects.equals(this.subMerchants, paymentCaptureResponse.subMerchants) + && Objects.equals(this.isSetSubMerchants, paymentCaptureResponse.isSetSubMerchants); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, paymentPspReference, + isSetPaymentPspReference, platformChargebackLogic, + isSetPlatformChargebackLogic, pspReference, + isSetPspReference, reference, + isSetReference, splits, + isSetSplits, status, - subMerchants); + isSetStatus, + subMerchants, + isSetSubMerchants); } @Override @@ -581,6 +681,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetSubMerchants) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANTS, this.subMerchants); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentCaptureResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java b/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java index 678235869..893490633 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentCompletionDetails.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -44,63 +46,129 @@ public class PaymentCompletionDetails { public static final String JSON_PROPERTY_M_D = "MD"; private String MD; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMD = false; + public static final String JSON_PROPERTY_PA_REQ = "PaReq"; private String paReq; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaReq = false; + public static final String JSON_PROPERTY_PA_RES = "PaRes"; private String paRes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaRes = false; + public static final String JSON_PROPERTY_AUTHORIZATION_TOKEN = "authorization_token"; private String authorizationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorizationToken = false; + public static final String JSON_PROPERTY_BILLING_TOKEN = "billingToken"; private String billingToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingToken = false; + public static final String JSON_PROPERTY_CUPSECUREPLUS_SMSCODE = "cupsecureplus.smscode"; private String cupsecureplusSmscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCupsecureplusSmscode = false; + public static final String JSON_PROPERTY_FACILITATOR_ACCESS_TOKEN = "facilitatorAccessToken"; private String facilitatorAccessToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFacilitatorAccessToken = false; + public static final String JSON_PROPERTY_ONE_TIME_PASSCODE = "oneTimePasscode"; private String oneTimePasscode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOneTimePasscode = false; + public static final String JSON_PROPERTY_ORDER_I_D = "orderID"; private String orderID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderID = false; + public static final String JSON_PROPERTY_PAYER_I_D = "payerID"; private String payerID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayerID = false; + public static final String JSON_PROPERTY_PAYLOAD = "payload"; private String payload; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayload = false; + public static final String JSON_PROPERTY_PAYMENT_I_D = "paymentID"; private String paymentID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentID = false; + public static final String JSON_PROPERTY_PAYMENT_STATUS = "paymentStatus"; private String paymentStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentStatus = false; + public static final String JSON_PROPERTY_REDIRECT_RESULT = "redirectResult"; private String redirectResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectResult = false; + public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private String resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + public static final String JSON_PROPERTY_RETURN_URL_QUERY_STRING = "returnUrlQueryString"; private String returnUrlQueryString; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrlQueryString = false; + public static final String JSON_PROPERTY_THREE_D_S_RESULT = "threeDSResult"; private String threeDSResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSResult = false; + public static final String JSON_PROPERTY_THREEDS2_CHALLENGE_RESULT = "threeds2.challengeResult"; private String threeds2ChallengeResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeds2ChallengeResult = false; + public static final String JSON_PROPERTY_THREEDS2_FINGERPRINT = "threeds2.fingerprint"; private String threeds2Fingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeds2Fingerprint = false; + public static final String JSON_PROPERTY_VAULT_TOKEN = "vaultToken"; private String vaultToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVaultToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentCompletionDetails() {} /** @@ -111,6 +179,7 @@ public PaymentCompletionDetails() {} */ public PaymentCompletionDetails MD(String MD) { this.MD = MD; + isSetMD = true; // mark as set return this; } @@ -134,6 +203,7 @@ public String getMD() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMD(String MD) { this.MD = MD; + isSetMD = true; // mark as set } /** @@ -144,6 +214,7 @@ public void setMD(String MD) { */ public PaymentCompletionDetails paReq(String paReq) { this.paReq = paReq; + isSetPaReq = true; // mark as set return this; } @@ -167,6 +238,7 @@ public String getPaReq() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaReq(String paReq) { this.paReq = paReq; + isSetPaReq = true; // mark as set } /** @@ -177,6 +249,7 @@ public void setPaReq(String paReq) { */ public PaymentCompletionDetails paRes(String paRes) { this.paRes = paRes; + isSetPaRes = true; // mark as set return this; } @@ -200,6 +273,7 @@ public String getPaRes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaRes(String paRes) { this.paRes = paRes; + isSetPaRes = true; // mark as set } /** @@ -210,6 +284,7 @@ public void setPaRes(String paRes) { */ public PaymentCompletionDetails authorizationToken(String authorizationToken) { this.authorizationToken = authorizationToken; + isSetAuthorizationToken = true; // mark as set return this; } @@ -233,6 +308,7 @@ public String getAuthorizationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorizationToken(String authorizationToken) { this.authorizationToken = authorizationToken; + isSetAuthorizationToken = true; // mark as set } /** @@ -243,6 +319,7 @@ public void setAuthorizationToken(String authorizationToken) { */ public PaymentCompletionDetails billingToken(String billingToken) { this.billingToken = billingToken; + isSetBillingToken = true; // mark as set return this; } @@ -266,6 +343,7 @@ public String getBillingToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingToken(String billingToken) { this.billingToken = billingToken; + isSetBillingToken = true; // mark as set } /** @@ -276,6 +354,7 @@ public void setBillingToken(String billingToken) { */ public PaymentCompletionDetails cupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set return this; } @@ -299,6 +378,7 @@ public String getCupsecureplusSmscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCupsecureplusSmscode(String cupsecureplusSmscode) { this.cupsecureplusSmscode = cupsecureplusSmscode; + isSetCupsecureplusSmscode = true; // mark as set } /** @@ -309,6 +389,7 @@ public void setCupsecureplusSmscode(String cupsecureplusSmscode) { */ public PaymentCompletionDetails facilitatorAccessToken(String facilitatorAccessToken) { this.facilitatorAccessToken = facilitatorAccessToken; + isSetFacilitatorAccessToken = true; // mark as set return this; } @@ -332,6 +413,7 @@ public String getFacilitatorAccessToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFacilitatorAccessToken(String facilitatorAccessToken) { this.facilitatorAccessToken = facilitatorAccessToken; + isSetFacilitatorAccessToken = true; // mark as set } /** @@ -343,6 +425,7 @@ public void setFacilitatorAccessToken(String facilitatorAccessToken) { */ public PaymentCompletionDetails oneTimePasscode(String oneTimePasscode) { this.oneTimePasscode = oneTimePasscode; + isSetOneTimePasscode = true; // mark as set return this; } @@ -368,6 +451,7 @@ public String getOneTimePasscode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOneTimePasscode(String oneTimePasscode) { this.oneTimePasscode = oneTimePasscode; + isSetOneTimePasscode = true; // mark as set } /** @@ -378,6 +462,7 @@ public void setOneTimePasscode(String oneTimePasscode) { */ public PaymentCompletionDetails orderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set return this; } @@ -401,6 +486,7 @@ public String getOrderID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderID(String orderID) { this.orderID = orderID; + isSetOrderID = true; // mark as set } /** @@ -411,6 +497,7 @@ public void setOrderID(String orderID) { */ public PaymentCompletionDetails payerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set return this; } @@ -434,6 +521,7 @@ public String getPayerID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayerID(String payerID) { this.payerID = payerID; + isSetPayerID = true; // mark as set } /** @@ -444,6 +532,7 @@ public void setPayerID(String payerID) { */ public PaymentCompletionDetails payload(String payload) { this.payload = payload; + isSetPayload = true; // mark as set return this; } @@ -467,6 +556,7 @@ public String getPayload() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayload(String payload) { this.payload = payload; + isSetPayload = true; // mark as set } /** @@ -477,6 +567,7 @@ public void setPayload(String payload) { */ public PaymentCompletionDetails paymentID(String paymentID) { this.paymentID = paymentID; + isSetPaymentID = true; // mark as set return this; } @@ -500,6 +591,7 @@ public String getPaymentID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentID(String paymentID) { this.paymentID = paymentID; + isSetPaymentID = true; // mark as set } /** @@ -513,6 +605,7 @@ public void setPaymentID(String paymentID) { */ public PaymentCompletionDetails paymentStatus(String paymentStatus) { this.paymentStatus = paymentStatus; + isSetPaymentStatus = true; // mark as set return this; } @@ -542,6 +635,7 @@ public String getPaymentStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentStatus(String paymentStatus) { this.paymentStatus = paymentStatus; + isSetPaymentStatus = true; // mark as set } /** @@ -552,6 +646,7 @@ public void setPaymentStatus(String paymentStatus) { */ public PaymentCompletionDetails redirectResult(String redirectResult) { this.redirectResult = redirectResult; + isSetRedirectResult = true; // mark as set return this; } @@ -575,6 +670,7 @@ public String getRedirectResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectResult(String redirectResult) { this.redirectResult = redirectResult; + isSetRedirectResult = true; // mark as set } /** @@ -585,6 +681,7 @@ public void setRedirectResult(String redirectResult) { */ public PaymentCompletionDetails resultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -608,6 +705,7 @@ public String getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(String resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -619,6 +717,7 @@ public void setResultCode(String resultCode) { */ public PaymentCompletionDetails returnUrlQueryString(String returnUrlQueryString) { this.returnUrlQueryString = returnUrlQueryString; + isSetReturnUrlQueryString = true; // mark as set return this; } @@ -644,6 +743,7 @@ public String getReturnUrlQueryString() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrlQueryString(String returnUrlQueryString) { this.returnUrlQueryString = returnUrlQueryString; + isSetReturnUrlQueryString = true; // mark as set } /** @@ -657,6 +757,7 @@ public void setReturnUrlQueryString(String returnUrlQueryString) { */ public PaymentCompletionDetails threeDSResult(String threeDSResult) { this.threeDSResult = threeDSResult; + isSetThreeDSResult = true; // mark as set return this; } @@ -686,6 +787,7 @@ public String getThreeDSResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSResult(String threeDSResult) { this.threeDSResult = threeDSResult; + isSetThreeDSResult = true; // mark as set } /** @@ -698,6 +800,7 @@ public void setThreeDSResult(String threeDSResult) { */ public PaymentCompletionDetails threeds2ChallengeResult(String threeds2ChallengeResult) { this.threeds2ChallengeResult = threeds2ChallengeResult; + isSetThreeds2ChallengeResult = true; // mark as set return this; } @@ -725,6 +828,7 @@ public String getThreeds2ChallengeResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeds2ChallengeResult(String threeds2ChallengeResult) { this.threeds2ChallengeResult = threeds2ChallengeResult; + isSetThreeds2ChallengeResult = true; // mark as set } /** @@ -737,6 +841,7 @@ public void setThreeds2ChallengeResult(String threeds2ChallengeResult) { */ public PaymentCompletionDetails threeds2Fingerprint(String threeds2Fingerprint) { this.threeds2Fingerprint = threeds2Fingerprint; + isSetThreeds2Fingerprint = true; // mark as set return this; } @@ -764,6 +869,7 @@ public String getThreeds2Fingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeds2Fingerprint(String threeds2Fingerprint) { this.threeds2Fingerprint = threeds2Fingerprint; + isSetThreeds2Fingerprint = true; // mark as set } /** @@ -774,6 +880,7 @@ public void setThreeds2Fingerprint(String threeds2Fingerprint) { */ public PaymentCompletionDetails vaultToken(String vaultToken) { this.vaultToken = vaultToken; + isSetVaultToken = true; // mark as set return this; } @@ -797,6 +904,27 @@ public String getVaultToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVaultToken(String vaultToken) { this.vaultToken = vaultToken; + isSetVaultToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentCompletionDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentCompletionDetails object is equal to o. */ @@ -810,52 +938,99 @@ public boolean equals(Object o) { } PaymentCompletionDetails paymentCompletionDetails = (PaymentCompletionDetails) o; return Objects.equals(this.MD, paymentCompletionDetails.MD) + && Objects.equals(this.isSetMD, paymentCompletionDetails.isSetMD) && Objects.equals(this.paReq, paymentCompletionDetails.paReq) + && Objects.equals(this.isSetPaReq, paymentCompletionDetails.isSetPaReq) && Objects.equals(this.paRes, paymentCompletionDetails.paRes) + && Objects.equals(this.isSetPaRes, paymentCompletionDetails.isSetPaRes) && Objects.equals(this.authorizationToken, paymentCompletionDetails.authorizationToken) + && Objects.equals( + this.isSetAuthorizationToken, paymentCompletionDetails.isSetAuthorizationToken) && Objects.equals(this.billingToken, paymentCompletionDetails.billingToken) + && Objects.equals(this.isSetBillingToken, paymentCompletionDetails.isSetBillingToken) && Objects.equals(this.cupsecureplusSmscode, paymentCompletionDetails.cupsecureplusSmscode) + && Objects.equals( + this.isSetCupsecureplusSmscode, paymentCompletionDetails.isSetCupsecureplusSmscode) && Objects.equals( this.facilitatorAccessToken, paymentCompletionDetails.facilitatorAccessToken) + && Objects.equals( + this.isSetFacilitatorAccessToken, paymentCompletionDetails.isSetFacilitatorAccessToken) && Objects.equals(this.oneTimePasscode, paymentCompletionDetails.oneTimePasscode) + && Objects.equals(this.isSetOneTimePasscode, paymentCompletionDetails.isSetOneTimePasscode) && Objects.equals(this.orderID, paymentCompletionDetails.orderID) + && Objects.equals(this.isSetOrderID, paymentCompletionDetails.isSetOrderID) && Objects.equals(this.payerID, paymentCompletionDetails.payerID) + && Objects.equals(this.isSetPayerID, paymentCompletionDetails.isSetPayerID) && Objects.equals(this.payload, paymentCompletionDetails.payload) + && Objects.equals(this.isSetPayload, paymentCompletionDetails.isSetPayload) && Objects.equals(this.paymentID, paymentCompletionDetails.paymentID) + && Objects.equals(this.isSetPaymentID, paymentCompletionDetails.isSetPaymentID) && Objects.equals(this.paymentStatus, paymentCompletionDetails.paymentStatus) + && Objects.equals(this.isSetPaymentStatus, paymentCompletionDetails.isSetPaymentStatus) && Objects.equals(this.redirectResult, paymentCompletionDetails.redirectResult) + && Objects.equals(this.isSetRedirectResult, paymentCompletionDetails.isSetRedirectResult) && Objects.equals(this.resultCode, paymentCompletionDetails.resultCode) + && Objects.equals(this.isSetResultCode, paymentCompletionDetails.isSetResultCode) && Objects.equals(this.returnUrlQueryString, paymentCompletionDetails.returnUrlQueryString) + && Objects.equals( + this.isSetReturnUrlQueryString, paymentCompletionDetails.isSetReturnUrlQueryString) && Objects.equals(this.threeDSResult, paymentCompletionDetails.threeDSResult) + && Objects.equals(this.isSetThreeDSResult, paymentCompletionDetails.isSetThreeDSResult) && Objects.equals( this.threeds2ChallengeResult, paymentCompletionDetails.threeds2ChallengeResult) + && Objects.equals( + this.isSetThreeds2ChallengeResult, + paymentCompletionDetails.isSetThreeds2ChallengeResult) && Objects.equals(this.threeds2Fingerprint, paymentCompletionDetails.threeds2Fingerprint) - && Objects.equals(this.vaultToken, paymentCompletionDetails.vaultToken); + && Objects.equals( + this.isSetThreeds2Fingerprint, paymentCompletionDetails.isSetThreeds2Fingerprint) + && Objects.equals(this.vaultToken, paymentCompletionDetails.vaultToken) + && Objects.equals(this.isSetVaultToken, paymentCompletionDetails.isSetVaultToken); } @Override public int hashCode() { return Objects.hash( MD, + isSetMD, paReq, + isSetPaReq, paRes, + isSetPaRes, authorizationToken, + isSetAuthorizationToken, billingToken, + isSetBillingToken, cupsecureplusSmscode, + isSetCupsecureplusSmscode, facilitatorAccessToken, + isSetFacilitatorAccessToken, oneTimePasscode, + isSetOneTimePasscode, orderID, + isSetOrderID, payerID, + isSetPayerID, payload, + isSetPayload, paymentID, + isSetPaymentID, paymentStatus, + isSetPaymentStatus, redirectResult, + isSetRedirectResult, resultCode, + isSetResultCode, returnUrlQueryString, + isSetReturnUrlQueryString, threeDSResult, + isSetThreeDSResult, threeds2ChallengeResult, + isSetThreeds2ChallengeResult, threeds2Fingerprint, - vaultToken); + isSetThreeds2Fingerprint, + vaultToken, + isSetVaultToken); } @Override @@ -906,6 +1081,87 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMD) { + addIfNull(nulls, JSON_PROPERTY_M_D, this.MD); + } + if (isSetPaReq) { + addIfNull(nulls, JSON_PROPERTY_PA_REQ, this.paReq); + } + if (isSetPaRes) { + addIfNull(nulls, JSON_PROPERTY_PA_RES, this.paRes); + } + if (isSetAuthorizationToken) { + addIfNull(nulls, JSON_PROPERTY_AUTHORIZATION_TOKEN, this.authorizationToken); + } + if (isSetBillingToken) { + addIfNull(nulls, JSON_PROPERTY_BILLING_TOKEN, this.billingToken); + } + if (isSetCupsecureplusSmscode) { + addIfNull(nulls, JSON_PROPERTY_CUPSECUREPLUS_SMSCODE, this.cupsecureplusSmscode); + } + if (isSetFacilitatorAccessToken) { + addIfNull(nulls, JSON_PROPERTY_FACILITATOR_ACCESS_TOKEN, this.facilitatorAccessToken); + } + if (isSetOneTimePasscode) { + addIfNull(nulls, JSON_PROPERTY_ONE_TIME_PASSCODE, this.oneTimePasscode); + } + if (isSetOrderID) { + addIfNull(nulls, JSON_PROPERTY_ORDER_I_D, this.orderID); + } + if (isSetPayerID) { + addIfNull(nulls, JSON_PROPERTY_PAYER_I_D, this.payerID); + } + if (isSetPayload) { + addIfNull(nulls, JSON_PROPERTY_PAYLOAD, this.payload); + } + if (isSetPaymentID) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_I_D, this.paymentID); + } + if (isSetPaymentStatus) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_STATUS, this.paymentStatus); + } + if (isSetRedirectResult) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_RESULT, this.redirectResult); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetReturnUrlQueryString) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL_QUERY_STRING, this.returnUrlQueryString); + } + if (isSetThreeDSResult) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_RESULT, this.threeDSResult); + } + if (isSetThreeds2ChallengeResult) { + addIfNull(nulls, JSON_PROPERTY_THREEDS2_CHALLENGE_RESULT, this.threeds2ChallengeResult); + } + if (isSetThreeds2Fingerprint) { + addIfNull(nulls, JSON_PROPERTY_THREEDS2_FINGERPRINT, this.threeds2Fingerprint); + } + if (isSetVaultToken) { + addIfNull(nulls, JSON_PROPERTY_VAULT_TOKEN, this.vaultToken); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentCompletionDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetails.java b/src/main/java/com/adyen/model/checkout/PaymentDetails.java index e4cfaf322..40a962234 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetails.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class PaymentDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** The payment method type. */ public enum TypeEnum { ALIPAY(String.valueOf("alipay")), @@ -130,8 +138,6 @@ public enum TypeEnum { BOLETOBANCARIO(String.valueOf("boletobancario")), - NETELLER(String.valueOf("neteller")), - CASHTICKET(String.valueOf("cashticket")), IKANO(String.valueOf("ikano")), @@ -156,14 +162,10 @@ public enum TypeEnum { KCP_NAVERPAY(String.valueOf("kcp_naverpay")), - ONLINEBANKING_IN(String.valueOf("onlinebanking_IN")), - FAWRY(String.valueOf("fawry")), ATOME(String.valueOf("atome")), - MONEYBOOKERS(String.valueOf("moneybookers")), - NAPS(String.valueOf("naps")), NORDEA(String.valueOf("nordea")), @@ -254,6 +256,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentDetails() {} /** @@ -264,6 +275,7 @@ public PaymentDetails() {} */ public PaymentDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -287,6 +299,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -297,6 +310,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PaymentDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -321,6 +335,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -331,6 +346,7 @@ public void setSdkData(String sdkData) { */ public PaymentDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -354,6 +370,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentDetails object is equal to o. */ @@ -367,13 +404,17 @@ public boolean equals(Object o) { } PaymentDetails paymentDetails = (PaymentDetails) o; return Objects.equals(this.checkoutAttemptId, paymentDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, paymentDetails.isSetCheckoutAttemptId) && Objects.equals(this.sdkData, paymentDetails.sdkData) - && Objects.equals(this.type, paymentDetails.type); + && Objects.equals(this.isSetSdkData, paymentDetails.isSetSdkData) + && Objects.equals(this.type, paymentDetails.type) + && Objects.equals(this.isSetType, paymentDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, sdkData, type); + return Objects.hash( + checkoutAttemptId, isSetCheckoutAttemptId, sdkData, isSetSdkData, type, isSetType); } @Override @@ -397,6 +438,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java b/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java index bd3f4651b..157cf0ac9 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetailsRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,18 +30,36 @@ public class PaymentDetailsRequest { public static final String JSON_PROPERTY_AUTHENTICATION_DATA = "authenticationData"; private DetailsRequestAuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_DETAILS = "details"; private PaymentCompletionDetails details; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetails = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentDetailsRequest() {} /** @@ -51,6 +71,7 @@ public PaymentDetailsRequest() {} public PaymentDetailsRequest authenticationData( DetailsRequestAuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -74,6 +95,7 @@ public DetailsRequestAuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(DetailsRequestAuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -84,6 +106,7 @@ public void setAuthenticationData(DetailsRequestAuthenticationData authenticatio */ public PaymentDetailsRequest details(PaymentCompletionDetails details) { this.details = details; + isSetDetails = true; // mark as set return this; } @@ -107,6 +130,7 @@ public PaymentCompletionDetails getDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDetails(PaymentCompletionDetails details) { this.details = details; + isSetDetails = true; // mark as set } /** @@ -128,6 +152,7 @@ public void setDetails(PaymentCompletionDetails details) { */ public PaymentDetailsRequest paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -173,6 +198,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setPaymentData(String paymentData) { // `authenticationData.authenticationOnly` instead. public PaymentDetailsRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -227,6 +254,27 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentDetailsRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentDetailsRequest object is equal to o. */ @@ -240,15 +288,30 @@ public boolean equals(Object o) { } PaymentDetailsRequest paymentDetailsRequest = (PaymentDetailsRequest) o; return Objects.equals(this.authenticationData, paymentDetailsRequest.authenticationData) + && Objects.equals( + this.isSetAuthenticationData, paymentDetailsRequest.isSetAuthenticationData) && Objects.equals(this.details, paymentDetailsRequest.details) + && Objects.equals(this.isSetDetails, paymentDetailsRequest.isSetDetails) && Objects.equals(this.paymentData, paymentDetailsRequest.paymentData) + && Objects.equals(this.isSetPaymentData, paymentDetailsRequest.isSetPaymentData) && Objects.equals( - this.threeDSAuthenticationOnly, paymentDetailsRequest.threeDSAuthenticationOnly); + this.threeDSAuthenticationOnly, paymentDetailsRequest.threeDSAuthenticationOnly) + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, + paymentDetailsRequest.isSetThreeDSAuthenticationOnly); } @Override public int hashCode() { - return Objects.hash(authenticationData, details, paymentData, threeDSAuthenticationOnly); + return Objects.hash( + authenticationData, + isSetAuthenticationData, + details, + isSetDetails, + paymentData, + isSetPaymentData, + threeDSAuthenticationOnly, + isSetThreeDSAuthenticationOnly); } @Override @@ -275,6 +338,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetDetails) { + addIfNull(nulls, JSON_PROPERTY_DETAILS, this.details); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentDetailsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java index fd037500c..39cd8eb0d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentDetailsResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -47,39 +49,75 @@ public class PaymentDetailsResponse { public static final String JSON_PROPERTY_ACTION = "action"; private PaymentDetailsResponseAction action; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAction = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_DONATION_TOKEN = "donationToken"; private String donationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationToken = false; + public static final String JSON_PROPERTY_FRAUD_RESULT = "fraudResult"; private FraudResult fraudResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResult = false; + public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_ORDER = "order"; private CheckoutOrderResponse order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private ResponsePaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_VALIDATIONS = "paymentValidations"; private PaymentValidationsResponse paymentValidations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentValidations = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + public static final String JSON_PROPERTY_REFUSAL_REASON_CODE = "refusalReasonCode"; private String refusalReasonCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReasonCode = false; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -176,18 +214,39 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA = "threeDS2ResponseData"; private ThreeDS2ResponseData threeDS2ResponseData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2ResponseData = false; + public static final String JSON_PROPERTY_THREE_D_S2_RESULT = "threeDS2Result"; private ThreeDS2Result threeDS2Result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Result = false; + public static final String JSON_PROPERTY_THREE_D_S_PAYMENT_DATA = "threeDSPaymentData"; private String threeDSPaymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSPaymentData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentDetailsResponse() {} /** @@ -198,6 +257,7 @@ public PaymentDetailsResponse() {} */ public PaymentDetailsResponse action(PaymentDetailsResponseAction action) { this.action = action; + isSetAction = true; // mark as set return this; } @@ -221,6 +281,7 @@ public PaymentDetailsResponseAction getAction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAction(PaymentDetailsResponseAction action) { this.action = action; + isSetAction = true; // mark as set } /** @@ -234,6 +295,7 @@ public void setAction(PaymentDetailsResponseAction action) { */ public PaymentDetailsResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -271,6 +333,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -281,6 +344,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentDetailsResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -304,6 +368,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -314,6 +379,7 @@ public void setAmount(Amount amount) { */ public PaymentDetailsResponse donationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set return this; } @@ -337,6 +403,7 @@ public String getDonationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set } /** @@ -347,6 +414,7 @@ public void setDonationToken(String donationToken) { */ public PaymentDetailsResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -370,6 +438,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -380,6 +449,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public PaymentDetailsResponse merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -403,6 +473,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -413,6 +484,7 @@ public void setMerchantReference(String merchantReference) { */ public PaymentDetailsResponse order(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -436,6 +508,7 @@ public CheckoutOrderResponse getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -446,6 +519,7 @@ public void setOrder(CheckoutOrderResponse order) { */ public PaymentDetailsResponse paymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -469,6 +543,7 @@ public ResponsePaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -479,6 +554,7 @@ public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { */ public PaymentDetailsResponse paymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set return this; } @@ -502,6 +578,7 @@ public PaymentValidationsResponse getPaymentValidations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set } /** @@ -515,6 +592,7 @@ public void setPaymentValidations(PaymentValidationsResponse paymentValidations) */ public PaymentDetailsResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -544,6 +622,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -562,6 +641,7 @@ public void setPspReference(String pspReference) { */ public PaymentDetailsResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -601,6 +681,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -614,6 +695,7 @@ public void setRefusalReason(String refusalReason) { */ public PaymentDetailsResponse refusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set return this; } @@ -643,6 +725,7 @@ public String getRefusalReasonCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set } /** @@ -706,6 +789,7 @@ public void setRefusalReasonCode(String refusalReasonCode) { */ public PaymentDetailsResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -835,6 +919,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -845,6 +930,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public PaymentDetailsResponse shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -868,6 +954,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -878,6 +965,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentDetailsResponse threeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set return this; } @@ -901,6 +989,7 @@ public ThreeDS2ResponseData getThreeDS2ResponseData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set } /** @@ -911,6 +1000,7 @@ public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { */ public PaymentDetailsResponse threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -934,6 +1024,7 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set } /** @@ -946,6 +1037,7 @@ public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { */ public PaymentDetailsResponse threeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set return this; } @@ -973,6 +1065,27 @@ public String getThreeDSPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentDetailsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentDetailsResponse object is equal to o. */ @@ -986,44 +1099,83 @@ public boolean equals(Object o) { } PaymentDetailsResponse paymentDetailsResponse = (PaymentDetailsResponse) o; return Objects.equals(this.action, paymentDetailsResponse.action) + && Objects.equals(this.isSetAction, paymentDetailsResponse.isSetAction) && Objects.equals(this.additionalData, paymentDetailsResponse.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentDetailsResponse.isSetAdditionalData) && Objects.equals(this.amount, paymentDetailsResponse.amount) + && Objects.equals(this.isSetAmount, paymentDetailsResponse.isSetAmount) && Objects.equals(this.donationToken, paymentDetailsResponse.donationToken) + && Objects.equals(this.isSetDonationToken, paymentDetailsResponse.isSetDonationToken) && Objects.equals(this.fraudResult, paymentDetailsResponse.fraudResult) + && Objects.equals(this.isSetFraudResult, paymentDetailsResponse.isSetFraudResult) && Objects.equals(this.merchantReference, paymentDetailsResponse.merchantReference) + && Objects.equals( + this.isSetMerchantReference, paymentDetailsResponse.isSetMerchantReference) && Objects.equals(this.order, paymentDetailsResponse.order) + && Objects.equals(this.isSetOrder, paymentDetailsResponse.isSetOrder) && Objects.equals(this.paymentMethod, paymentDetailsResponse.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, paymentDetailsResponse.isSetPaymentMethod) && Objects.equals(this.paymentValidations, paymentDetailsResponse.paymentValidations) + && Objects.equals( + this.isSetPaymentValidations, paymentDetailsResponse.isSetPaymentValidations) && Objects.equals(this.pspReference, paymentDetailsResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentDetailsResponse.isSetPspReference) && Objects.equals(this.refusalReason, paymentDetailsResponse.refusalReason) + && Objects.equals(this.isSetRefusalReason, paymentDetailsResponse.isSetRefusalReason) && Objects.equals(this.refusalReasonCode, paymentDetailsResponse.refusalReasonCode) + && Objects.equals( + this.isSetRefusalReasonCode, paymentDetailsResponse.isSetRefusalReasonCode) && Objects.equals(this.resultCode, paymentDetailsResponse.resultCode) + && Objects.equals(this.isSetResultCode, paymentDetailsResponse.isSetResultCode) && Objects.equals(this.shopperLocale, paymentDetailsResponse.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentDetailsResponse.isSetShopperLocale) && Objects.equals(this.threeDS2ResponseData, paymentDetailsResponse.threeDS2ResponseData) + && Objects.equals( + this.isSetThreeDS2ResponseData, paymentDetailsResponse.isSetThreeDS2ResponseData) && Objects.equals(this.threeDS2Result, paymentDetailsResponse.threeDS2Result) - && Objects.equals(this.threeDSPaymentData, paymentDetailsResponse.threeDSPaymentData); + && Objects.equals(this.isSetThreeDS2Result, paymentDetailsResponse.isSetThreeDS2Result) + && Objects.equals(this.threeDSPaymentData, paymentDetailsResponse.threeDSPaymentData) + && Objects.equals( + this.isSetThreeDSPaymentData, paymentDetailsResponse.isSetThreeDSPaymentData); } @Override public int hashCode() { return Objects.hash( action, + isSetAction, additionalData, + isSetAdditionalData, amount, + isSetAmount, donationToken, + isSetDonationToken, fraudResult, + isSetFraudResult, merchantReference, + isSetMerchantReference, order, + isSetOrder, paymentMethod, + isSetPaymentMethod, paymentValidations, + isSetPaymentValidations, pspReference, + isSetPspReference, refusalReason, + isSetRefusalReason, refusalReasonCode, + isSetRefusalReasonCode, resultCode, + isSetResultCode, shopperLocale, + isSetShopperLocale, threeDS2ResponseData, + isSetThreeDS2ResponseData, threeDS2Result, - threeDSPaymentData); + isSetThreeDS2Result, + threeDSPaymentData, + isSetThreeDSPaymentData); } @Override @@ -1063,6 +1215,78 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAction) { + addIfNull(nulls, JSON_PROPERTY_ACTION, this.action); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDonationToken) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TOKEN, this.donationToken); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentValidations) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_VALIDATIONS, this.paymentValidations); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetRefusalReasonCode) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON_CODE, this.refusalReasonCode); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetThreeDS2ResponseData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA, this.threeDS2ResponseData); + } + if (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + if (isSetThreeDSPaymentData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_PAYMENT_DATA, this.threeDSPaymentData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentDetailsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java index 5d035c14d..65aa8cbb0 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -76,69 +78,135 @@ public class PaymentLinkRequest { public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private Address deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MANUAL_CAPTURE = "manualCapture"; private Boolean manualCapture; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManualCapture = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + /** * Defines a recurring payment type. Required when `storePaymentMethodMode` is set to * **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a @@ -196,9 +264,15 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** Gets or Sets requiredShopperFields */ public enum RequiredShopperFieldsEnum { BILLINGADDRESS(String.valueOf("billingAddress")), @@ -249,46 +323,88 @@ public static RequiredShopperFieldsEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS = "requiredShopperFields"; private List requiredShopperFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredShopperFields = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_REUSABLE = "reusable"; private Boolean reusable; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReusable = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -343,15 +459,33 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentLinkRequest() {} /** @@ -367,6 +501,7 @@ public PaymentLinkRequest() {} */ public PaymentLinkRequest allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -408,6 +543,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -418,6 +554,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public PaymentLinkRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -441,6 +578,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -451,6 +589,7 @@ public void setAmount(Amount amount) { */ public PaymentLinkRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -474,6 +613,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -484,6 +624,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentLinkRequest billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -507,6 +648,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -522,6 +664,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentLinkRequest blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -563,6 +706,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -574,6 +718,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public PaymentLinkRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -599,6 +744,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -609,6 +755,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentLinkRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -632,6 +779,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -644,6 +792,7 @@ public void setCountryCode(String countryCode) { */ public PaymentLinkRequest dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -671,6 +820,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -685,6 +835,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentLinkRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -716,6 +867,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -726,6 +878,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public PaymentLinkRequest deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -749,6 +902,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -760,6 +914,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentLinkRequest description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -785,6 +940,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -802,6 +958,7 @@ public void setDescription(String description) { */ public PaymentLinkRequest expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -839,6 +996,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -849,6 +1007,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public PaymentLinkRequest fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -872,6 +1031,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -882,6 +1042,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public PaymentLinkRequest fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -905,6 +1066,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -921,6 +1083,7 @@ public void setFundRecipient(FundRecipient fundRecipient) { */ public PaymentLinkRequest installmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -965,6 +1128,7 @@ public Map getInstallmentOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -979,6 +1143,7 @@ public void setInstallmentOptions(Map installmentOpti */ public PaymentLinkRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1018,6 +1183,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1030,6 +1196,7 @@ public void setLineItems(List lineItems) { */ public PaymentLinkRequest manualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set return this; } @@ -1057,6 +1224,7 @@ public Boolean getManualCapture() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set } /** @@ -1071,6 +1239,7 @@ public void setManualCapture(Boolean manualCapture) { */ public PaymentLinkRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1102,6 +1271,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1112,6 +1282,7 @@ public void setMcc(String mcc) { */ public PaymentLinkRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1135,6 +1306,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1148,6 +1320,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentLinkRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1177,6 +1350,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1197,6 +1371,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentLinkRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1248,6 +1423,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1259,6 +1435,7 @@ public void setMetadata(Map metadata) { public PaymentLinkRequest platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1282,6 +1459,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1309,6 +1487,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac public PaymentLinkRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1364,6 +1543,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1376,6 +1556,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentLinkRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1403,6 +1584,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1426,6 +1608,7 @@ public void setReference(String reference) { public PaymentLinkRequest requiredShopperFields( List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set return this; } @@ -1482,6 +1665,7 @@ public List getRequiredShopperFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequiredShopperFields(List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set } /** @@ -1496,6 +1680,7 @@ public void setRequiredShopperFields(List requiredSho */ public PaymentLinkRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -1527,6 +1712,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -1540,6 +1726,7 @@ public void setReturnUrl(String returnUrl) { */ public PaymentLinkRequest reusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set return this; } @@ -1569,6 +1756,7 @@ public Boolean getReusable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set } /** @@ -1579,6 +1767,7 @@ public void setReusable(Boolean reusable) { */ public PaymentLinkRequest riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -1602,6 +1791,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -1612,6 +1802,7 @@ public void setRiskData(RiskData riskData) { */ public PaymentLinkRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1635,6 +1826,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1651,6 +1843,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentLinkRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1686,6 +1879,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1696,6 +1890,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentLinkRequest shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1719,6 +1914,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1734,6 +1930,7 @@ public void setShopperName(Name shopperName) { */ public PaymentLinkRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1767,6 +1964,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1782,6 +1980,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentLinkRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1815,6 +2014,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1826,6 +2026,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentLinkRequest showRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -1851,6 +2052,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -1861,6 +2063,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public PaymentLinkRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -1884,6 +2087,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -1896,6 +2100,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentLinkRequest splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -1923,6 +2128,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -1941,6 +2147,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public PaymentLinkRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -1988,6 +2195,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -1998,6 +2206,7 @@ public void setSplits(List splits) { */ public PaymentLinkRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2021,6 +2230,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2044,6 +2254,7 @@ public void setStore(String store) { public PaymentLinkRequest storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -2091,6 +2302,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -2109,6 +2321,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public PaymentLinkRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2148,6 +2361,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2163,6 +2377,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentLinkRequest themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -2196,6 +2411,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -2207,6 +2423,7 @@ public void setThemeId(String themeId) { public PaymentLinkRequest threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2230,6 +2447,27 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentLinkRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentLinkRequest object is equal to o. */ @@ -2243,96 +2481,192 @@ public boolean equals(Object o) { } PaymentLinkRequest paymentLinkRequest = (PaymentLinkRequest) o; return Objects.equals(this.allowedPaymentMethods, paymentLinkRequest.allowedPaymentMethods) + && Objects.equals( + this.isSetAllowedPaymentMethods, paymentLinkRequest.isSetAllowedPaymentMethods) && Objects.equals(this.amount, paymentLinkRequest.amount) + && Objects.equals(this.isSetAmount, paymentLinkRequest.isSetAmount) && Objects.equals(this.applicationInfo, paymentLinkRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentLinkRequest.isSetApplicationInfo) && Objects.equals(this.billingAddress, paymentLinkRequest.billingAddress) + && Objects.equals(this.isSetBillingAddress, paymentLinkRequest.isSetBillingAddress) && Objects.equals(this.blockedPaymentMethods, paymentLinkRequest.blockedPaymentMethods) + && Objects.equals( + this.isSetBlockedPaymentMethods, paymentLinkRequest.isSetBlockedPaymentMethods) && Objects.equals(this.captureDelayHours, paymentLinkRequest.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, paymentLinkRequest.isSetCaptureDelayHours) && Objects.equals(this.countryCode, paymentLinkRequest.countryCode) + && Objects.equals(this.isSetCountryCode, paymentLinkRequest.isSetCountryCode) && Objects.equals(this.dateOfBirth, paymentLinkRequest.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, paymentLinkRequest.isSetDateOfBirth) && Objects.equals(this.deliverAt, paymentLinkRequest.deliverAt) + && Objects.equals(this.isSetDeliverAt, paymentLinkRequest.isSetDeliverAt) && Objects.equals(this.deliveryAddress, paymentLinkRequest.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, paymentLinkRequest.isSetDeliveryAddress) && Objects.equals(this.description, paymentLinkRequest.description) + && Objects.equals(this.isSetDescription, paymentLinkRequest.isSetDescription) && Objects.equals(this.expiresAt, paymentLinkRequest.expiresAt) + && Objects.equals(this.isSetExpiresAt, paymentLinkRequest.isSetExpiresAt) && Objects.equals(this.fundOrigin, paymentLinkRequest.fundOrigin) + && Objects.equals(this.isSetFundOrigin, paymentLinkRequest.isSetFundOrigin) && Objects.equals(this.fundRecipient, paymentLinkRequest.fundRecipient) + && Objects.equals(this.isSetFundRecipient, paymentLinkRequest.isSetFundRecipient) && Objects.equals(this.installmentOptions, paymentLinkRequest.installmentOptions) + && Objects.equals(this.isSetInstallmentOptions, paymentLinkRequest.isSetInstallmentOptions) && Objects.equals(this.lineItems, paymentLinkRequest.lineItems) + && Objects.equals(this.isSetLineItems, paymentLinkRequest.isSetLineItems) && Objects.equals(this.manualCapture, paymentLinkRequest.manualCapture) + && Objects.equals(this.isSetManualCapture, paymentLinkRequest.isSetManualCapture) && Objects.equals(this.mcc, paymentLinkRequest.mcc) + && Objects.equals(this.isSetMcc, paymentLinkRequest.isSetMcc) && Objects.equals(this.merchantAccount, paymentLinkRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentLinkRequest.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, paymentLinkRequest.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, paymentLinkRequest.isSetMerchantOrderReference) && Objects.equals(this.metadata, paymentLinkRequest.metadata) + && Objects.equals(this.isSetMetadata, paymentLinkRequest.isSetMetadata) && Objects.equals(this.platformChargebackLogic, paymentLinkRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, paymentLinkRequest.isSetPlatformChargebackLogic) && Objects.equals( this.recurringProcessingModel, paymentLinkRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, paymentLinkRequest.isSetRecurringProcessingModel) && Objects.equals(this.reference, paymentLinkRequest.reference) + && Objects.equals(this.isSetReference, paymentLinkRequest.isSetReference) && Objects.equals(this.requiredShopperFields, paymentLinkRequest.requiredShopperFields) + && Objects.equals( + this.isSetRequiredShopperFields, paymentLinkRequest.isSetRequiredShopperFields) && Objects.equals(this.returnUrl, paymentLinkRequest.returnUrl) + && Objects.equals(this.isSetReturnUrl, paymentLinkRequest.isSetReturnUrl) && Objects.equals(this.reusable, paymentLinkRequest.reusable) + && Objects.equals(this.isSetReusable, paymentLinkRequest.isSetReusable) && Objects.equals(this.riskData, paymentLinkRequest.riskData) + && Objects.equals(this.isSetRiskData, paymentLinkRequest.isSetRiskData) && Objects.equals(this.shopperEmail, paymentLinkRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentLinkRequest.isSetShopperEmail) && Objects.equals(this.shopperLocale, paymentLinkRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentLinkRequest.isSetShopperLocale) && Objects.equals(this.shopperName, paymentLinkRequest.shopperName) + && Objects.equals(this.isSetShopperName, paymentLinkRequest.isSetShopperName) && Objects.equals(this.shopperReference, paymentLinkRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentLinkRequest.isSetShopperReference) && Objects.equals(this.shopperStatement, paymentLinkRequest.shopperStatement) + && Objects.equals(this.isSetShopperStatement, paymentLinkRequest.isSetShopperStatement) && Objects.equals( this.showRemovePaymentMethodButton, paymentLinkRequest.showRemovePaymentMethodButton) + && Objects.equals( + this.isSetShowRemovePaymentMethodButton, + paymentLinkRequest.isSetShowRemovePaymentMethodButton) && Objects.equals(this.socialSecurityNumber, paymentLinkRequest.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, paymentLinkRequest.isSetSocialSecurityNumber) && Objects.equals(this.splitCardFundingSources, paymentLinkRequest.splitCardFundingSources) + && Objects.equals( + this.isSetSplitCardFundingSources, paymentLinkRequest.isSetSplitCardFundingSources) && Objects.equals(this.splits, paymentLinkRequest.splits) + && Objects.equals(this.isSetSplits, paymentLinkRequest.isSetSplits) && Objects.equals(this.store, paymentLinkRequest.store) + && Objects.equals(this.isSetStore, paymentLinkRequest.isSetStore) && Objects.equals(this.storePaymentMethodMode, paymentLinkRequest.storePaymentMethodMode) + && Objects.equals( + this.isSetStorePaymentMethodMode, paymentLinkRequest.isSetStorePaymentMethodMode) && Objects.equals(this.telephoneNumber, paymentLinkRequest.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentLinkRequest.isSetTelephoneNumber) && Objects.equals(this.themeId, paymentLinkRequest.themeId) - && Objects.equals(this.threeDS2RequestData, paymentLinkRequest.threeDS2RequestData); + && Objects.equals(this.isSetThemeId, paymentLinkRequest.isSetThemeId) + && Objects.equals(this.threeDS2RequestData, paymentLinkRequest.threeDS2RequestData) + && Objects.equals( + this.isSetThreeDS2RequestData, paymentLinkRequest.isSetThreeDS2RequestData); } @Override public int hashCode() { return Objects.hash( allowedPaymentMethods, + isSetAllowedPaymentMethods, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, billingAddress, + isSetBillingAddress, blockedPaymentMethods, + isSetBlockedPaymentMethods, captureDelayHours, + isSetCaptureDelayHours, countryCode, + isSetCountryCode, dateOfBirth, + isSetDateOfBirth, deliverAt, + isSetDeliverAt, deliveryAddress, + isSetDeliveryAddress, description, + isSetDescription, expiresAt, + isSetExpiresAt, fundOrigin, + isSetFundOrigin, fundRecipient, + isSetFundRecipient, installmentOptions, + isSetInstallmentOptions, lineItems, + isSetLineItems, manualCapture, + isSetManualCapture, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, metadata, + isSetMetadata, platformChargebackLogic, + isSetPlatformChargebackLogic, recurringProcessingModel, + isSetRecurringProcessingModel, reference, + isSetReference, requiredShopperFields, + isSetRequiredShopperFields, returnUrl, + isSetReturnUrl, reusable, + isSetReusable, riskData, + isSetRiskData, shopperEmail, + isSetShopperEmail, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, showRemovePaymentMethodButton, + isSetShowRemovePaymentMethodButton, socialSecurityNumber, + isSetSocialSecurityNumber, splitCardFundingSources, + isSetSplitCardFundingSources, splits, + isSetSplits, store, + isSetStore, storePaymentMethodMode, + isSetStorePaymentMethodMode, telephoneNumber, + isSetTelephoneNumber, themeId, - threeDS2RequestData); + isSetThemeId, + threeDS2RequestData, + isSetThreeDS2RequestData); } @Override @@ -2417,6 +2751,156 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetManualCapture) { + addIfNull(nulls, JSON_PROPERTY_MANUAL_CAPTURE, this.manualCapture); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequiredShopperFields) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS, this.requiredShopperFields); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetReusable) { + addIfNull(nulls, JSON_PROPERTY_REUSABLE, this.reusable); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentLinkRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java index c76f9f3bb..64875f18b 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentLinkResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -80,72 +82,141 @@ public class PaymentLinkResponse { public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private Address billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private LocalDate dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private Address deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_EXPIRES_AT = "expiresAt"; private OffsetDateTime expiresAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiresAt = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_INSTALLMENT_OPTIONS = "installmentOptions"; private Map installmentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentOptions = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MANUAL_CAPTURE = "manualCapture"; private Boolean manualCapture; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetManualCapture = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + /** * Defines a recurring payment type. Required when `storePaymentMethodMode` is set to * **askForConsent** or **enabled**. Possible values: * **Subscription** – A transaction for a @@ -203,9 +274,15 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** Gets or Sets requiredShopperFields */ public enum RequiredShopperFieldsEnum { BILLINGADDRESS(String.valueOf("billingAddress")), @@ -256,43 +333,82 @@ public static RequiredShopperFieldsEnum fromValue(String value) { public static final String JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS = "requiredShopperFields"; private List requiredShopperFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequiredShopperFields = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_REUSABLE = "reusable"; private Boolean reusable; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReusable = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private Name shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON = "showRemovePaymentMethodButton"; private Boolean showRemovePaymentMethodButton; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShowRemovePaymentMethodButton = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** * Status of the payment link. Possible values: * **active**: The link can be used to make * payments. * **expired**: The expiry date for the payment link has passed. Shoppers can no @@ -349,9 +465,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** * Indicates if the details of the payment method will be stored for the shopper. Possible values: * * **disabled** – No details will be stored (default). * **askForConsent** – If the @@ -406,21 +528,45 @@ public static StorePaymentMethodModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE = "storePaymentMethodMode"; private StorePaymentMethodModeEnum storePaymentMethodMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethodMode = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THEME_ID = "themeId"; private String themeId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThemeId = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private CheckoutSessionThreeDS2RequestData threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_UPDATED_AT = "updatedAt"; private OffsetDateTime updatedAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUpdatedAt = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentLinkResponse() {} @JsonCreator @@ -444,6 +590,7 @@ public PaymentLinkResponse( */ public PaymentLinkResponse allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -485,6 +632,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -495,6 +643,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public PaymentLinkResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -518,6 +667,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -528,6 +678,7 @@ public void setAmount(Amount amount) { */ public PaymentLinkResponse applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -551,6 +702,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -561,6 +713,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentLinkResponse billingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -584,6 +737,7 @@ public Address getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(Address billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -599,6 +753,7 @@ public void setBillingAddress(Address billingAddress) { */ public PaymentLinkResponse blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -640,6 +795,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -651,6 +807,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public PaymentLinkResponse captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -676,6 +833,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -686,6 +844,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentLinkResponse countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -709,6 +868,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -721,6 +881,7 @@ public void setCountryCode(String countryCode) { */ public PaymentLinkResponse dateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -748,6 +909,7 @@ public LocalDate getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(LocalDate dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -762,6 +924,7 @@ public void setDateOfBirth(LocalDate dateOfBirth) { */ public PaymentLinkResponse deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -793,6 +956,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -803,6 +967,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public PaymentLinkResponse deliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -826,6 +991,7 @@ public Address getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(Address deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -837,6 +1003,7 @@ public void setDeliveryAddress(Address deliveryAddress) { */ public PaymentLinkResponse description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -862,6 +1029,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -879,6 +1047,7 @@ public void setDescription(String description) { */ public PaymentLinkResponse expiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set return this; } @@ -916,6 +1085,7 @@ public OffsetDateTime getExpiresAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiresAt(OffsetDateTime expiresAt) { this.expiresAt = expiresAt; + isSetExpiresAt = true; // mark as set } /** @@ -926,6 +1096,7 @@ public void setExpiresAt(OffsetDateTime expiresAt) { */ public PaymentLinkResponse fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -949,6 +1120,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -959,6 +1131,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public PaymentLinkResponse fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -982,6 +1155,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1009,6 +1183,7 @@ public String getId() { */ public PaymentLinkResponse installmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set return this; } @@ -1053,6 +1228,7 @@ public Map getInstallmentOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentOptions(Map installmentOptions) { this.installmentOptions = installmentOptions; + isSetInstallmentOptions = true; // mark as set } /** @@ -1067,6 +1243,7 @@ public void setInstallmentOptions(Map installmentOpti */ public PaymentLinkResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1106,6 +1283,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1118,6 +1296,7 @@ public void setLineItems(List lineItems) { */ public PaymentLinkResponse manualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set return this; } @@ -1145,6 +1324,7 @@ public Boolean getManualCapture() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setManualCapture(Boolean manualCapture) { this.manualCapture = manualCapture; + isSetManualCapture = true; // mark as set } /** @@ -1159,6 +1339,7 @@ public void setManualCapture(Boolean manualCapture) { */ public PaymentLinkResponse mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1190,6 +1371,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1200,6 +1382,7 @@ public void setMcc(String mcc) { */ public PaymentLinkResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1223,6 +1406,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -1236,6 +1420,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentLinkResponse merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -1265,6 +1450,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -1285,6 +1471,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentLinkResponse metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -1336,6 +1523,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -1347,6 +1535,7 @@ public void setMetadata(Map metadata) { public PaymentLinkResponse platformChargebackLogic( PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -1370,6 +1559,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -1397,6 +1587,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac public PaymentLinkResponse recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -1452,6 +1643,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -1464,6 +1656,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentLinkResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -1491,6 +1684,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -1514,6 +1708,7 @@ public void setReference(String reference) { public PaymentLinkResponse requiredShopperFields( List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set return this; } @@ -1570,6 +1765,7 @@ public List getRequiredShopperFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequiredShopperFields(List requiredShopperFields) { this.requiredShopperFields = requiredShopperFields; + isSetRequiredShopperFields = true; // mark as set } /** @@ -1584,6 +1780,7 @@ public void setRequiredShopperFields(List requiredSho */ public PaymentLinkResponse returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -1615,6 +1812,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -1628,6 +1826,7 @@ public void setReturnUrl(String returnUrl) { */ public PaymentLinkResponse reusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set return this; } @@ -1657,6 +1856,7 @@ public Boolean getReusable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReusable(Boolean reusable) { this.reusable = reusable; + isSetReusable = true; // mark as set } /** @@ -1667,6 +1867,7 @@ public void setReusable(Boolean reusable) { */ public PaymentLinkResponse riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -1690,6 +1891,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set } /** @@ -1700,6 +1902,7 @@ public void setRiskData(RiskData riskData) { */ public PaymentLinkResponse shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -1723,6 +1926,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -1739,6 +1943,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentLinkResponse shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -1774,6 +1979,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -1784,6 +1990,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentLinkResponse shopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -1807,6 +2014,7 @@ public Name getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(Name shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -1822,6 +2030,7 @@ public void setShopperName(Name shopperName) { */ public PaymentLinkResponse shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -1855,6 +2064,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -1870,6 +2080,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentLinkResponse shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -1903,6 +2114,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -1914,6 +2126,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentLinkResponse showRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set return this; } @@ -1939,6 +2152,7 @@ public Boolean getShowRemovePaymentMethodButton() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButton) { this.showRemovePaymentMethodButton = showRemovePaymentMethodButton; + isSetShowRemovePaymentMethodButton = true; // mark as set } /** @@ -1949,6 +2163,7 @@ public void setShowRemovePaymentMethodButton(Boolean showRemovePaymentMethodButt */ public PaymentLinkResponse socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -1972,6 +2187,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -1984,6 +2200,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentLinkResponse splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -2011,6 +2228,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -2029,6 +2247,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public PaymentLinkResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -2076,6 +2295,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -2094,6 +2314,7 @@ public void setSplits(List splits) { */ public PaymentLinkResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -2133,6 +2354,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -2143,6 +2365,7 @@ public void setStatus(StatusEnum status) { */ public PaymentLinkResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -2166,6 +2389,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -2189,6 +2413,7 @@ public void setStore(String store) { public PaymentLinkResponse storePaymentMethodMode( StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set return this; } @@ -2236,6 +2461,7 @@ public StorePaymentMethodModeEnum getStorePaymentMethodMode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMethodMode) { this.storePaymentMethodMode = storePaymentMethodMode; + isSetStorePaymentMethodMode = true; // mark as set } /** @@ -2254,6 +2480,7 @@ public void setStorePaymentMethodMode(StorePaymentMethodModeEnum storePaymentMet */ public PaymentLinkResponse telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -2293,6 +2520,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -2308,6 +2536,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentLinkResponse themeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set return this; } @@ -2341,6 +2570,7 @@ public String getThemeId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThemeId(String themeId) { this.themeId = themeId; + isSetThemeId = true; // mark as set } /** @@ -2352,6 +2582,7 @@ public void setThemeId(String themeId) { public PaymentLinkResponse threeDS2RequestData( CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -2375,6 +2606,7 @@ public CheckoutSessionThreeDS2RequestData getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -2389,6 +2621,7 @@ public void setThreeDS2RequestData(CheckoutSessionThreeDS2RequestData threeDS2Re */ public PaymentLinkResponse updatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set return this; } @@ -2420,6 +2653,7 @@ public OffsetDateTime getUpdatedAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUpdatedAt(OffsetDateTime updatedAt) { this.updatedAt = updatedAt; + isSetUpdatedAt = true; // mark as set } /** @@ -2433,6 +2667,26 @@ public String getUrl() { return url; } + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentLinkResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + /** Return true if this PaymentLinkResponse object is equal to o. */ @Override public boolean equals(Object o) { @@ -2444,104 +2698,208 @@ public boolean equals(Object o) { } PaymentLinkResponse paymentLinkResponse = (PaymentLinkResponse) o; return Objects.equals(this.allowedPaymentMethods, paymentLinkResponse.allowedPaymentMethods) + && Objects.equals( + this.isSetAllowedPaymentMethods, paymentLinkResponse.isSetAllowedPaymentMethods) && Objects.equals(this.amount, paymentLinkResponse.amount) + && Objects.equals(this.isSetAmount, paymentLinkResponse.isSetAmount) && Objects.equals(this.applicationInfo, paymentLinkResponse.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentLinkResponse.isSetApplicationInfo) && Objects.equals(this.billingAddress, paymentLinkResponse.billingAddress) + && Objects.equals(this.isSetBillingAddress, paymentLinkResponse.isSetBillingAddress) && Objects.equals(this.blockedPaymentMethods, paymentLinkResponse.blockedPaymentMethods) + && Objects.equals( + this.isSetBlockedPaymentMethods, paymentLinkResponse.isSetBlockedPaymentMethods) && Objects.equals(this.captureDelayHours, paymentLinkResponse.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, paymentLinkResponse.isSetCaptureDelayHours) && Objects.equals(this.countryCode, paymentLinkResponse.countryCode) + && Objects.equals(this.isSetCountryCode, paymentLinkResponse.isSetCountryCode) && Objects.equals(this.dateOfBirth, paymentLinkResponse.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, paymentLinkResponse.isSetDateOfBirth) && Objects.equals(this.deliverAt, paymentLinkResponse.deliverAt) + && Objects.equals(this.isSetDeliverAt, paymentLinkResponse.isSetDeliverAt) && Objects.equals(this.deliveryAddress, paymentLinkResponse.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, paymentLinkResponse.isSetDeliveryAddress) && Objects.equals(this.description, paymentLinkResponse.description) + && Objects.equals(this.isSetDescription, paymentLinkResponse.isSetDescription) && Objects.equals(this.expiresAt, paymentLinkResponse.expiresAt) + && Objects.equals(this.isSetExpiresAt, paymentLinkResponse.isSetExpiresAt) && Objects.equals(this.fundOrigin, paymentLinkResponse.fundOrigin) + && Objects.equals(this.isSetFundOrigin, paymentLinkResponse.isSetFundOrigin) && Objects.equals(this.fundRecipient, paymentLinkResponse.fundRecipient) + && Objects.equals(this.isSetFundRecipient, paymentLinkResponse.isSetFundRecipient) && Objects.equals(this.id, paymentLinkResponse.id) + && Objects.equals(this.isSetId, paymentLinkResponse.isSetId) && Objects.equals(this.installmentOptions, paymentLinkResponse.installmentOptions) + && Objects.equals(this.isSetInstallmentOptions, paymentLinkResponse.isSetInstallmentOptions) && Objects.equals(this.lineItems, paymentLinkResponse.lineItems) + && Objects.equals(this.isSetLineItems, paymentLinkResponse.isSetLineItems) && Objects.equals(this.manualCapture, paymentLinkResponse.manualCapture) + && Objects.equals(this.isSetManualCapture, paymentLinkResponse.isSetManualCapture) && Objects.equals(this.mcc, paymentLinkResponse.mcc) + && Objects.equals(this.isSetMcc, paymentLinkResponse.isSetMcc) && Objects.equals(this.merchantAccount, paymentLinkResponse.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentLinkResponse.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, paymentLinkResponse.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, paymentLinkResponse.isSetMerchantOrderReference) && Objects.equals(this.metadata, paymentLinkResponse.metadata) + && Objects.equals(this.isSetMetadata, paymentLinkResponse.isSetMetadata) && Objects.equals(this.platformChargebackLogic, paymentLinkResponse.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, paymentLinkResponse.isSetPlatformChargebackLogic) && Objects.equals( this.recurringProcessingModel, paymentLinkResponse.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, paymentLinkResponse.isSetRecurringProcessingModel) && Objects.equals(this.reference, paymentLinkResponse.reference) + && Objects.equals(this.isSetReference, paymentLinkResponse.isSetReference) && Objects.equals(this.requiredShopperFields, paymentLinkResponse.requiredShopperFields) + && Objects.equals( + this.isSetRequiredShopperFields, paymentLinkResponse.isSetRequiredShopperFields) && Objects.equals(this.returnUrl, paymentLinkResponse.returnUrl) + && Objects.equals(this.isSetReturnUrl, paymentLinkResponse.isSetReturnUrl) && Objects.equals(this.reusable, paymentLinkResponse.reusable) + && Objects.equals(this.isSetReusable, paymentLinkResponse.isSetReusable) && Objects.equals(this.riskData, paymentLinkResponse.riskData) + && Objects.equals(this.isSetRiskData, paymentLinkResponse.isSetRiskData) && Objects.equals(this.shopperEmail, paymentLinkResponse.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentLinkResponse.isSetShopperEmail) && Objects.equals(this.shopperLocale, paymentLinkResponse.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentLinkResponse.isSetShopperLocale) && Objects.equals(this.shopperName, paymentLinkResponse.shopperName) + && Objects.equals(this.isSetShopperName, paymentLinkResponse.isSetShopperName) && Objects.equals(this.shopperReference, paymentLinkResponse.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentLinkResponse.isSetShopperReference) && Objects.equals(this.shopperStatement, paymentLinkResponse.shopperStatement) + && Objects.equals(this.isSetShopperStatement, paymentLinkResponse.isSetShopperStatement) && Objects.equals( this.showRemovePaymentMethodButton, paymentLinkResponse.showRemovePaymentMethodButton) + && Objects.equals( + this.isSetShowRemovePaymentMethodButton, + paymentLinkResponse.isSetShowRemovePaymentMethodButton) && Objects.equals(this.socialSecurityNumber, paymentLinkResponse.socialSecurityNumber) + && Objects.equals( + this.isSetSocialSecurityNumber, paymentLinkResponse.isSetSocialSecurityNumber) && Objects.equals(this.splitCardFundingSources, paymentLinkResponse.splitCardFundingSources) + && Objects.equals( + this.isSetSplitCardFundingSources, paymentLinkResponse.isSetSplitCardFundingSources) && Objects.equals(this.splits, paymentLinkResponse.splits) + && Objects.equals(this.isSetSplits, paymentLinkResponse.isSetSplits) && Objects.equals(this.status, paymentLinkResponse.status) + && Objects.equals(this.isSetStatus, paymentLinkResponse.isSetStatus) && Objects.equals(this.store, paymentLinkResponse.store) + && Objects.equals(this.isSetStore, paymentLinkResponse.isSetStore) && Objects.equals(this.storePaymentMethodMode, paymentLinkResponse.storePaymentMethodMode) + && Objects.equals( + this.isSetStorePaymentMethodMode, paymentLinkResponse.isSetStorePaymentMethodMode) && Objects.equals(this.telephoneNumber, paymentLinkResponse.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentLinkResponse.isSetTelephoneNumber) && Objects.equals(this.themeId, paymentLinkResponse.themeId) + && Objects.equals(this.isSetThemeId, paymentLinkResponse.isSetThemeId) && Objects.equals(this.threeDS2RequestData, paymentLinkResponse.threeDS2RequestData) + && Objects.equals( + this.isSetThreeDS2RequestData, paymentLinkResponse.isSetThreeDS2RequestData) && Objects.equals(this.updatedAt, paymentLinkResponse.updatedAt) - && Objects.equals(this.url, paymentLinkResponse.url); + && Objects.equals(this.isSetUpdatedAt, paymentLinkResponse.isSetUpdatedAt) + && Objects.equals(this.url, paymentLinkResponse.url) + && Objects.equals(this.isSetUrl, paymentLinkResponse.isSetUrl); } @Override public int hashCode() { return Objects.hash( allowedPaymentMethods, + isSetAllowedPaymentMethods, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, billingAddress, + isSetBillingAddress, blockedPaymentMethods, + isSetBlockedPaymentMethods, captureDelayHours, + isSetCaptureDelayHours, countryCode, + isSetCountryCode, dateOfBirth, + isSetDateOfBirth, deliverAt, + isSetDeliverAt, deliveryAddress, + isSetDeliveryAddress, description, + isSetDescription, expiresAt, + isSetExpiresAt, fundOrigin, + isSetFundOrigin, fundRecipient, + isSetFundRecipient, id, + isSetId, installmentOptions, + isSetInstallmentOptions, lineItems, + isSetLineItems, manualCapture, + isSetManualCapture, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, metadata, + isSetMetadata, platformChargebackLogic, + isSetPlatformChargebackLogic, recurringProcessingModel, + isSetRecurringProcessingModel, reference, + isSetReference, requiredShopperFields, + isSetRequiredShopperFields, returnUrl, + isSetReturnUrl, reusable, + isSetReusable, riskData, + isSetRiskData, shopperEmail, + isSetShopperEmail, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, showRemovePaymentMethodButton, + isSetShowRemovePaymentMethodButton, socialSecurityNumber, + isSetSocialSecurityNumber, splitCardFundingSources, + isSetSplitCardFundingSources, splits, + isSetSplits, status, + isSetStatus, store, + isSetStore, storePaymentMethodMode, + isSetStorePaymentMethodMode, telephoneNumber, + isSetTelephoneNumber, themeId, + isSetThemeId, threeDS2RequestData, + isSetThreeDS2RequestData, updatedAt, - url); + isSetUpdatedAt, + url, + isSetUrl); } @Override @@ -2630,6 +2988,168 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetExpiresAt) { + addIfNull(nulls, JSON_PROPERTY_EXPIRES_AT, this.expiresAt); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstallmentOptions) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENT_OPTIONS, this.installmentOptions); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetManualCapture) { + addIfNull(nulls, JSON_PROPERTY_MANUAL_CAPTURE, this.manualCapture); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetRequiredShopperFields) { + addIfNull(nulls, JSON_PROPERTY_REQUIRED_SHOPPER_FIELDS, this.requiredShopperFields); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetReusable) { + addIfNull(nulls, JSON_PROPERTY_REUSABLE, this.reusable); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetShowRemovePaymentMethodButton) { + addIfNull( + nulls, + JSON_PROPERTY_SHOW_REMOVE_PAYMENT_METHOD_BUTTON, + this.showRemovePaymentMethodButton); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStorePaymentMethodMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD_MODE, this.storePaymentMethodMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThemeId) { + addIfNull(nulls, JSON_PROPERTY_THEME_ID, this.themeId); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetUpdatedAt) { + addIfNull(nulls, JSON_PROPERTY_UPDATED_AT, this.updatedAt); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentLinkResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethod.java b/src/main/java/com/adyen/model/checkout/PaymentMethod.java index 9e7852b9e..0bbc0581d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethod.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,20 +45,34 @@ public class PaymentMethod { public static final String JSON_PROPERTY_APPS = "apps"; private List apps; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApps = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_BRANDS = "brands"; private List brands; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrands = false; + public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private Map configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + /** The funding source of the payment method. */ public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -96,25 +112,52 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_GROUP = "group"; private PaymentMethodGroup group; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetGroup = false; + public static final String JSON_PROPERTY_INPUT_DETAILS = "inputDetails"; @Deprecated // deprecated private List inputDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInputDetails = false; + public static final String JSON_PROPERTY_ISSUERS = "issuers"; private List issuers; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuers = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PROMOTED = "promoted"; private Boolean promoted; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPromoted = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethod() {} /** @@ -125,6 +168,7 @@ public PaymentMethod() {} */ public PaymentMethod apps(List apps) { this.apps = apps; + isSetApps = true; // mark as set return this; } @@ -156,6 +200,7 @@ public List getApps() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApps(List apps) { this.apps = apps; + isSetApps = true; // mark as set } /** @@ -166,6 +211,7 @@ public void setApps(List apps) { */ public PaymentMethod brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -189,6 +235,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -199,6 +246,7 @@ public void setBrand(String brand) { */ public PaymentMethod brands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set return this; } @@ -230,6 +278,7 @@ public List getBrands() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrands(List brands) { this.brands = brands; + isSetBrands = true; // mark as set } /** @@ -240,6 +289,7 @@ public void setBrands(List brands) { */ public PaymentMethod configuration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -271,6 +321,7 @@ public Map getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -281,6 +332,7 @@ public void setConfiguration(Map configuration) { */ public PaymentMethod fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -304,6 +356,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -314,6 +367,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public PaymentMethod group(PaymentMethodGroup group) { this.group = group; + isSetGroup = true; // mark as set return this; } @@ -337,6 +391,7 @@ public PaymentMethodGroup getGroup() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGroup(PaymentMethodGroup group) { this.group = group; + isSetGroup = true; // mark as set } /** @@ -350,6 +405,7 @@ public void setGroup(PaymentMethodGroup group) { @Deprecated // deprecated public PaymentMethod inputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set return this; } @@ -387,6 +443,7 @@ public List getInputDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInputDetails(List inputDetails) { this.inputDetails = inputDetails; + isSetInputDetails = true; // mark as set } /** @@ -397,6 +454,7 @@ public void setInputDetails(List inputDetails) { */ public PaymentMethod issuers(List issuers) { this.issuers = issuers; + isSetIssuers = true; // mark as set return this; } @@ -428,6 +486,7 @@ public List getIssuers() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuers(List issuers) { this.issuers = issuers; + isSetIssuers = true; // mark as set } /** @@ -438,6 +497,7 @@ public void setIssuers(List issuers) { */ public PaymentMethod name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -461,6 +521,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -471,6 +532,7 @@ public void setName(String name) { */ public PaymentMethod promoted(Boolean promoted) { this.promoted = promoted; + isSetPromoted = true; // mark as set return this; } @@ -494,6 +556,7 @@ public Boolean getPromoted() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPromoted(Boolean promoted) { this.promoted = promoted; + isSetPromoted = true; // mark as set } /** @@ -504,6 +567,7 @@ public void setPromoted(Boolean promoted) { */ public PaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -527,6 +591,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethod object is equal to o. */ @@ -540,32 +625,54 @@ public boolean equals(Object o) { } PaymentMethod paymentMethod = (PaymentMethod) o; return Objects.equals(this.apps, paymentMethod.apps) + && Objects.equals(this.isSetApps, paymentMethod.isSetApps) && Objects.equals(this.brand, paymentMethod.brand) + && Objects.equals(this.isSetBrand, paymentMethod.isSetBrand) && Objects.equals(this.brands, paymentMethod.brands) + && Objects.equals(this.isSetBrands, paymentMethod.isSetBrands) && Objects.equals(this.configuration, paymentMethod.configuration) + && Objects.equals(this.isSetConfiguration, paymentMethod.isSetConfiguration) && Objects.equals(this.fundingSource, paymentMethod.fundingSource) + && Objects.equals(this.isSetFundingSource, paymentMethod.isSetFundingSource) && Objects.equals(this.group, paymentMethod.group) + && Objects.equals(this.isSetGroup, paymentMethod.isSetGroup) && Objects.equals(this.inputDetails, paymentMethod.inputDetails) + && Objects.equals(this.isSetInputDetails, paymentMethod.isSetInputDetails) && Objects.equals(this.issuers, paymentMethod.issuers) + && Objects.equals(this.isSetIssuers, paymentMethod.isSetIssuers) && Objects.equals(this.name, paymentMethod.name) + && Objects.equals(this.isSetName, paymentMethod.isSetName) && Objects.equals(this.promoted, paymentMethod.promoted) - && Objects.equals(this.type, paymentMethod.type); + && Objects.equals(this.isSetPromoted, paymentMethod.isSetPromoted) + && Objects.equals(this.type, paymentMethod.type) + && Objects.equals(this.isSetType, paymentMethod.isSetType); } @Override public int hashCode() { return Objects.hash( apps, + isSetApps, brand, + isSetBrand, brands, + isSetBrands, configuration, + isSetConfiguration, fundingSource, + isSetFundingSource, group, + isSetGroup, inputDetails, + isSetInputDetails, issuers, + isSetIssuers, name, + isSetName, promoted, - type); + isSetPromoted, + type, + isSetType); } @Override @@ -597,6 +704,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApps) { + addIfNull(nulls, JSON_PROPERTY_APPS, this.apps); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetBrands) { + addIfNull(nulls, JSON_PROPERTY_BRANDS, this.brands); + } + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetGroup) { + addIfNull(nulls, JSON_PROPERTY_GROUP, this.group); + } + if (isSetInputDetails) { + addIfNull(nulls, JSON_PROPERTY_INPUT_DETAILS, this.inputDetails); + } + if (isSetIssuers) { + addIfNull(nulls, JSON_PROPERTY_ISSUERS, this.issuers); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPromoted) { + addIfNull(nulls, JSON_PROPERTY_PROMOTED, this.promoted); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java b/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java index 5ea4bfeed..467d3e84c 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodGroup.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class PaymentMethodGroup { public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_DATA = "paymentMethodData"; private String paymentMethodData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodData = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodGroup() {} /** @@ -43,6 +60,7 @@ public PaymentMethodGroup() {} */ public PaymentMethodGroup name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -77,6 +96,7 @@ public void setName(String name) { */ public PaymentMethodGroup paymentMethodData(String paymentMethodData) { this.paymentMethodData = paymentMethodData; + isSetPaymentMethodData = true; // mark as set return this; } @@ -102,6 +122,7 @@ public String getPaymentMethodData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodData(String paymentMethodData) { this.paymentMethodData = paymentMethodData; + isSetPaymentMethodData = true; // mark as set } /** @@ -112,6 +133,7 @@ public void setPaymentMethodData(String paymentMethodData) { */ public PaymentMethodGroup type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -135,6 +157,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodGroup includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodGroup object is equal to o. */ @@ -148,13 +191,17 @@ public boolean equals(Object o) { } PaymentMethodGroup paymentMethodGroup = (PaymentMethodGroup) o; return Objects.equals(this.name, paymentMethodGroup.name) + && Objects.equals(this.isSetName, paymentMethodGroup.isSetName) && Objects.equals(this.paymentMethodData, paymentMethodGroup.paymentMethodData) - && Objects.equals(this.type, paymentMethodGroup.type); + && Objects.equals(this.isSetPaymentMethodData, paymentMethodGroup.isSetPaymentMethodData) + && Objects.equals(this.type, paymentMethodGroup.type) + && Objects.equals(this.isSetType, paymentMethodGroup.isSetType); } @Override public int hashCode() { - return Objects.hash(name, paymentMethodData, type); + return Objects.hash( + name, isSetName, paymentMethodData, isSetPaymentMethodData, type, isSetType); } @Override @@ -178,6 +225,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPaymentMethodData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_DATA, this.paymentMethodData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodGroup given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java b/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java index 914d33e43..554eebfd6 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodIssuer.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class PaymentMethodIssuer { public static final String JSON_PROPERTY_DISABLED = "disabled"; private Boolean disabled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisabled = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodIssuer() {} /** @@ -45,6 +62,7 @@ public PaymentMethodIssuer() {} */ public PaymentMethodIssuer disabled(Boolean disabled) { this.disabled = disabled; + isSetDisabled = true; // mark as set return this; } @@ -72,6 +90,7 @@ public Boolean getDisabled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDisabled(Boolean disabled) { this.disabled = disabled; + isSetDisabled = true; // mark as set } /** @@ -82,6 +101,7 @@ public void setDisabled(Boolean disabled) { */ public PaymentMethodIssuer id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -105,6 +125,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -115,6 +136,7 @@ public void setId(String id) { */ public PaymentMethodIssuer name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -138,6 +160,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodIssuer includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodIssuer object is equal to o. */ @@ -151,13 +194,16 @@ public boolean equals(Object o) { } PaymentMethodIssuer paymentMethodIssuer = (PaymentMethodIssuer) o; return Objects.equals(this.disabled, paymentMethodIssuer.disabled) + && Objects.equals(this.isSetDisabled, paymentMethodIssuer.isSetDisabled) && Objects.equals(this.id, paymentMethodIssuer.id) - && Objects.equals(this.name, paymentMethodIssuer.name); + && Objects.equals(this.isSetId, paymentMethodIssuer.isSetId) + && Objects.equals(this.name, paymentMethodIssuer.name) + && Objects.equals(this.isSetName, paymentMethodIssuer.isSetName); } @Override public int hashCode() { - return Objects.hash(disabled, id, name); + return Objects.hash(disabled, isSetDisabled, id, isSetId, name, isSetName); } @Override @@ -181,6 +227,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDisabled) { + addIfNull(nulls, JSON_PROPERTY_DISABLED, this.disabled); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodIssuer given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java b/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java index 11a4d4c4a..030be1a61 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodToStore.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,39 +38,81 @@ public class PaymentMethodToStore { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_CVC = "cvc"; private String cvc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD = "encryptedCard"; private String encryptedCard; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCard = false; + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; private String encryptedCardNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; private String encryptedExpiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; private String encryptedExpiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; private String encryptedSecurityCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = false; + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodToStore() {} /** @@ -79,6 +123,7 @@ public PaymentMethodToStore() {} */ public PaymentMethodToStore brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -102,6 +147,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -114,6 +160,7 @@ public void setBrand(String brand) { */ public PaymentMethodToStore cvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set return this; } @@ -141,6 +188,7 @@ public String getCvc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvc(String cvc) { this.cvc = cvc; + isSetCvc = true; // mark as set } /** @@ -151,6 +199,7 @@ public void setCvc(String cvc) { */ public PaymentMethodToStore encryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set return this; } @@ -174,6 +223,7 @@ public String getEncryptedCard() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCard(String encryptedCard) { this.encryptedCard = encryptedCard; + isSetEncryptedCard = true; // mark as set } /** @@ -184,6 +234,7 @@ public void setEncryptedCard(String encryptedCard) { */ public PaymentMethodToStore encryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set return this; } @@ -207,6 +258,7 @@ public String getEncryptedCardNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedCardNumber(String encryptedCardNumber) { this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set } /** @@ -217,6 +269,7 @@ public void setEncryptedCardNumber(String encryptedCardNumber) { */ public PaymentMethodToStore encryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set return this; } @@ -240,6 +293,7 @@ public String getEncryptedExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set } /** @@ -250,6 +304,7 @@ public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { */ public PaymentMethodToStore encryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set return this; } @@ -273,6 +328,7 @@ public String getEncryptedExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedExpiryYear(String encryptedExpiryYear) { this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set } /** @@ -283,6 +339,7 @@ public void setEncryptedExpiryYear(String encryptedExpiryYear) { */ public PaymentMethodToStore encryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set return this; } @@ -306,6 +363,7 @@ public String getEncryptedSecurityCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEncryptedSecurityCode(String encryptedSecurityCode) { this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set } /** @@ -318,6 +376,7 @@ public void setEncryptedSecurityCode(String encryptedSecurityCode) { */ public PaymentMethodToStore expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -345,6 +404,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -357,6 +417,7 @@ public void setExpiryMonth(String expiryMonth) { */ public PaymentMethodToStore expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -384,6 +445,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -394,6 +456,7 @@ public void setExpiryYear(String expiryYear) { */ public PaymentMethodToStore holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -417,6 +480,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -429,6 +493,7 @@ public void setHolderName(String holderName) { */ public PaymentMethodToStore number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -456,6 +521,7 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set } /** @@ -466,6 +532,7 @@ public void setNumber(String number) { */ public PaymentMethodToStore type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -489,6 +556,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodToStore includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodToStore object is equal to o. */ @@ -502,34 +590,62 @@ public boolean equals(Object o) { } PaymentMethodToStore paymentMethodToStore = (PaymentMethodToStore) o; return Objects.equals(this.brand, paymentMethodToStore.brand) + && Objects.equals(this.isSetBrand, paymentMethodToStore.isSetBrand) && Objects.equals(this.cvc, paymentMethodToStore.cvc) + && Objects.equals(this.isSetCvc, paymentMethodToStore.isSetCvc) && Objects.equals(this.encryptedCard, paymentMethodToStore.encryptedCard) + && Objects.equals(this.isSetEncryptedCard, paymentMethodToStore.isSetEncryptedCard) && Objects.equals(this.encryptedCardNumber, paymentMethodToStore.encryptedCardNumber) + && Objects.equals( + this.isSetEncryptedCardNumber, paymentMethodToStore.isSetEncryptedCardNumber) && Objects.equals(this.encryptedExpiryMonth, paymentMethodToStore.encryptedExpiryMonth) + && Objects.equals( + this.isSetEncryptedExpiryMonth, paymentMethodToStore.isSetEncryptedExpiryMonth) && Objects.equals(this.encryptedExpiryYear, paymentMethodToStore.encryptedExpiryYear) + && Objects.equals( + this.isSetEncryptedExpiryYear, paymentMethodToStore.isSetEncryptedExpiryYear) && Objects.equals(this.encryptedSecurityCode, paymentMethodToStore.encryptedSecurityCode) + && Objects.equals( + this.isSetEncryptedSecurityCode, paymentMethodToStore.isSetEncryptedSecurityCode) && Objects.equals(this.expiryMonth, paymentMethodToStore.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, paymentMethodToStore.isSetExpiryMonth) && Objects.equals(this.expiryYear, paymentMethodToStore.expiryYear) + && Objects.equals(this.isSetExpiryYear, paymentMethodToStore.isSetExpiryYear) && Objects.equals(this.holderName, paymentMethodToStore.holderName) + && Objects.equals(this.isSetHolderName, paymentMethodToStore.isSetHolderName) && Objects.equals(this.number, paymentMethodToStore.number) - && Objects.equals(this.type, paymentMethodToStore.type); + && Objects.equals(this.isSetNumber, paymentMethodToStore.isSetNumber) + && Objects.equals(this.type, paymentMethodToStore.type) + && Objects.equals(this.isSetType, paymentMethodToStore.isSetType); } @Override public int hashCode() { return Objects.hash( brand, + isSetBrand, cvc, + isSetCvc, encryptedCard, + isSetEncryptedCard, encryptedCardNumber, + isSetEncryptedCardNumber, encryptedExpiryMonth, + isSetEncryptedExpiryMonth, encryptedExpiryYear, + isSetEncryptedExpiryYear, encryptedSecurityCode, + isSetEncryptedSecurityCode, expiryMonth, + isSetExpiryMonth, expiryYear, + isSetExpiryYear, holderName, + isSetHolderName, number, - type); + isSetNumber, + type, + isSetType); } @Override @@ -570,6 +686,63 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCard) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD, this.encryptedCard); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodToStore given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java b/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java index 272b6371c..7d2e5ff5e 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodUPIApps.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class PaymentMethodUPIApps { public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodUPIApps() {} /** @@ -36,6 +50,7 @@ public PaymentMethodUPIApps() {} */ public PaymentMethodUPIApps id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setId(String id) { */ public PaymentMethodUPIApps name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodUPIApps includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodUPIApps object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } PaymentMethodUPIApps paymentMethodUPIApps = (PaymentMethodUPIApps) o; return Objects.equals(this.id, paymentMethodUPIApps.id) - && Objects.equals(this.name, paymentMethodUPIApps.name); + && Objects.equals(this.isSetId, paymentMethodUPIApps.isSetId) + && Objects.equals(this.name, paymentMethodUPIApps.name) + && Objects.equals(this.isSetName, paymentMethodUPIApps.isSetName); } @Override public int hashCode() { - return Objects.hash(id, name); + return Objects.hash(id, isSetId, name, isSetName); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodUPIApps given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java index ca82b573a..cd437c8db 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -50,18 +52,33 @@ public class PaymentMethodsRequest { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowedPaymentMethods"; private List allowedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAllowedPaymentMethods = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_BLOCKED_PAYMENT_METHODS = "blockedPaymentMethods"; private List blockedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBlockedPaymentMethods = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + /** * The platform where a payment transaction takes place. This field can be used for filtering out * payment methods that are only available on specific platforms. Possible values: * iOS * Android @@ -112,41 +129,74 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_ORDER = "order"; private EncryptedOrderData order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_SHOPPER_CONVERSION_ID = "shopperConversionId"; private String shopperConversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperConversionId = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES = "splitCardFundingSources"; private Boolean splitCardFundingSources; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplitCardFundingSources = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + /** - * Specifies how payment methods should be filtered based on the 'store' parameter: - - * 'exclusive': Only payment methods belonging to the specified 'store' are - * returned. - 'inclusive': Payment methods from the 'store' and those not - * associated with any other store are returned. + * Specifies how payment methods should be filtered based on the `store` parameter: - + * **exclusive**: Only payment methods belonging to the specified `store` are returned. + * - **inclusive**: Payment methods from the `store` and those not associated with any + * other store are returned. */ public enum StoreFiltrationModeEnum { EXCLUSIVE(String.valueOf("exclusive")), @@ -193,9 +243,21 @@ public static StoreFiltrationModeEnum fromValue(String value) { public static final String JSON_PROPERTY_STORE_FILTRATION_MODE = "storeFiltrationMode"; private StoreFiltrationModeEnum storeFiltrationMode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoreFiltrationMode = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodsRequest() {} /** @@ -210,6 +272,7 @@ public PaymentMethodsRequest() {} */ public PaymentMethodsRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -249,6 +312,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -264,6 +328,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentMethodsRequest allowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set return this; } @@ -305,6 +370,7 @@ public List getAllowedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAllowedPaymentMethods(List allowedPaymentMethods) { this.allowedPaymentMethods = allowedPaymentMethods; + isSetAllowedPaymentMethods = true; // mark as set } /** @@ -315,6 +381,7 @@ public void setAllowedPaymentMethods(List allowedPaymentMethods) { */ public PaymentMethodsRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -338,6 +405,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -353,6 +421,7 @@ public void setAmount(Amount amount) { */ public PaymentMethodsRequest blockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set return this; } @@ -394,6 +463,7 @@ public List getBlockedPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBlockedPaymentMethods(List blockedPaymentMethods) { this.blockedPaymentMethods = blockedPaymentMethods; + isSetBlockedPaymentMethods = true; // mark as set } /** @@ -404,6 +474,7 @@ public void setBlockedPaymentMethods(List blockedPaymentMethods) { */ public PaymentMethodsRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -427,6 +498,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -441,6 +513,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentMethodsRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -472,6 +545,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -482,6 +556,7 @@ public void setChannel(ChannelEnum channel) { */ public PaymentMethodsRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -505,6 +580,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -516,6 +592,7 @@ public void setCountryCode(String countryCode) { */ public PaymentMethodsRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -541,6 +618,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -551,6 +629,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentMethodsRequest order(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -574,6 +653,7 @@ public EncryptedOrderData getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -587,6 +667,7 @@ public void setOrder(EncryptedOrderData order) { */ public PaymentMethodsRequest shopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set return this; } @@ -616,6 +697,7 @@ public String getShopperConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set } /** @@ -630,6 +712,7 @@ public void setShopperConversionId(String shopperConversionId) { */ public PaymentMethodsRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -661,6 +744,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -684,6 +768,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentMethodsRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -733,6 +818,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -745,6 +831,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentMethodsRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -772,6 +859,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -788,6 +876,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentMethodsRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -823,6 +912,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -835,6 +925,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentMethodsRequest splitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set return this; } @@ -862,6 +953,7 @@ public Boolean getSplitCardFundingSources() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplitCardFundingSources(Boolean splitCardFundingSources) { this.splitCardFundingSources = splitCardFundingSources; + isSetSplitCardFundingSources = true; // mark as set } /** @@ -885,6 +977,7 @@ public void setSplitCardFundingSources(Boolean splitCardFundingSources) { */ public PaymentMethodsRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -934,35 +1027,37 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** - * Specifies how payment methods should be filtered based on the 'store' parameter: - - * 'exclusive': Only payment methods belonging to the specified 'store' are - * returned. - 'inclusive': Payment methods from the 'store' and those not - * associated with any other store are returned. + * Specifies how payment methods should be filtered based on the `store` parameter: - + * **exclusive**: Only payment methods belonging to the specified `store` are returned. + * - **inclusive**: Payment methods from the `store` and those not associated with any + * other store are returned. * * @param storeFiltrationMode Specifies how payment methods should be filtered based on the - * 'store' parameter: - 'exclusive': Only payment methods belonging to the - * specified 'store' are returned. - 'inclusive': Payment methods from the - * 'store' and those not associated with any other store are returned. + * `store` parameter: - **exclusive**: Only payment methods belonging to the + * specified `store` are returned. - **inclusive**: Payment methods from the + * `store` and those not associated with any other store are returned. * @return the current {@code PaymentMethodsRequest} instance, allowing for method chaining */ public PaymentMethodsRequest storeFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set return this; } /** - * Specifies how payment methods should be filtered based on the 'store' parameter: - - * 'exclusive': Only payment methods belonging to the specified 'store' are - * returned. - 'inclusive': Payment methods from the 'store' and those not - * associated with any other store are returned. + * Specifies how payment methods should be filtered based on the `store` parameter: - + * **exclusive**: Only payment methods belonging to the specified `store` are returned. + * - **inclusive**: Payment methods from the `store` and those not associated with any + * other store are returned. * * @return storeFiltrationMode Specifies how payment methods should be filtered based on the - * 'store' parameter: - 'exclusive': Only payment methods belonging to the - * specified 'store' are returned. - 'inclusive': Payment methods from the - * 'store' and those not associated with any other store are returned. + * `store` parameter: - **exclusive**: Only payment methods belonging to the + * specified `store` are returned. - **inclusive**: Payment methods from the + * `store` and those not associated with any other store are returned. */ @JsonProperty(JSON_PROPERTY_STORE_FILTRATION_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -971,20 +1066,21 @@ public StoreFiltrationModeEnum getStoreFiltrationMode() { } /** - * Specifies how payment methods should be filtered based on the 'store' parameter: - - * 'exclusive': Only payment methods belonging to the specified 'store' are - * returned. - 'inclusive': Payment methods from the 'store' and those not - * associated with any other store are returned. + * Specifies how payment methods should be filtered based on the `store` parameter: - + * **exclusive**: Only payment methods belonging to the specified `store` are returned. + * - **inclusive**: Payment methods from the `store` and those not associated with any + * other store are returned. * * @param storeFiltrationMode Specifies how payment methods should be filtered based on the - * 'store' parameter: - 'exclusive': Only payment methods belonging to the - * specified 'store' are returned. - 'inclusive': Payment methods from the - * 'store' and those not associated with any other store are returned. + * `store` parameter: - **exclusive**: Only payment methods belonging to the + * specified `store` are returned. - **inclusive**: Payment methods from the + * `store` and those not associated with any other store are returned. */ @JsonProperty(JSON_PROPERTY_STORE_FILTRATION_MODE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) { this.storeFiltrationMode = storeFiltrationMode; + isSetStoreFiltrationMode = true; // mark as set } /** @@ -1003,6 +1099,7 @@ public void setStoreFiltrationMode(StoreFiltrationModeEnum storeFiltrationMode) */ public PaymentMethodsRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -1042,6 +1139,27 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodsRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodsRequest object is equal to o. */ @@ -1055,47 +1173,88 @@ public boolean equals(Object o) { } PaymentMethodsRequest paymentMethodsRequest = (PaymentMethodsRequest) o; return Objects.equals(this.additionalData, paymentMethodsRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentMethodsRequest.isSetAdditionalData) && Objects.equals(this.allowedPaymentMethods, paymentMethodsRequest.allowedPaymentMethods) + && Objects.equals( + this.isSetAllowedPaymentMethods, paymentMethodsRequest.isSetAllowedPaymentMethods) && Objects.equals(this.amount, paymentMethodsRequest.amount) + && Objects.equals(this.isSetAmount, paymentMethodsRequest.isSetAmount) && Objects.equals(this.blockedPaymentMethods, paymentMethodsRequest.blockedPaymentMethods) + && Objects.equals( + this.isSetBlockedPaymentMethods, paymentMethodsRequest.isSetBlockedPaymentMethods) && Objects.equals(this.browserInfo, paymentMethodsRequest.browserInfo) + && Objects.equals(this.isSetBrowserInfo, paymentMethodsRequest.isSetBrowserInfo) && Objects.equals(this.channel, paymentMethodsRequest.channel) + && Objects.equals(this.isSetChannel, paymentMethodsRequest.isSetChannel) && Objects.equals(this.countryCode, paymentMethodsRequest.countryCode) + && Objects.equals(this.isSetCountryCode, paymentMethodsRequest.isSetCountryCode) && Objects.equals(this.merchantAccount, paymentMethodsRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentMethodsRequest.isSetMerchantAccount) && Objects.equals(this.order, paymentMethodsRequest.order) + && Objects.equals(this.isSetOrder, paymentMethodsRequest.isSetOrder) && Objects.equals(this.shopperConversionId, paymentMethodsRequest.shopperConversionId) + && Objects.equals( + this.isSetShopperConversionId, paymentMethodsRequest.isSetShopperConversionId) && Objects.equals(this.shopperEmail, paymentMethodsRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentMethodsRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, paymentMethodsRequest.shopperIP) + && Objects.equals(this.isSetShopperIP, paymentMethodsRequest.isSetShopperIP) && Objects.equals(this.shopperLocale, paymentMethodsRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentMethodsRequest.isSetShopperLocale) && Objects.equals(this.shopperReference, paymentMethodsRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentMethodsRequest.isSetShopperReference) && Objects.equals( this.splitCardFundingSources, paymentMethodsRequest.splitCardFundingSources) + && Objects.equals( + this.isSetSplitCardFundingSources, paymentMethodsRequest.isSetSplitCardFundingSources) && Objects.equals(this.store, paymentMethodsRequest.store) + && Objects.equals(this.isSetStore, paymentMethodsRequest.isSetStore) && Objects.equals(this.storeFiltrationMode, paymentMethodsRequest.storeFiltrationMode) - && Objects.equals(this.telephoneNumber, paymentMethodsRequest.telephoneNumber); + && Objects.equals( + this.isSetStoreFiltrationMode, paymentMethodsRequest.isSetStoreFiltrationMode) + && Objects.equals(this.telephoneNumber, paymentMethodsRequest.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentMethodsRequest.isSetTelephoneNumber); } @Override public int hashCode() { return Objects.hash( additionalData, + isSetAdditionalData, allowedPaymentMethods, + isSetAllowedPaymentMethods, amount, + isSetAmount, blockedPaymentMethods, + isSetBlockedPaymentMethods, browserInfo, + isSetBrowserInfo, channel, + isSetChannel, countryCode, + isSetCountryCode, merchantAccount, + isSetMerchantAccount, order, + isSetOrder, shopperConversionId, + isSetShopperConversionId, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperLocale, + isSetShopperLocale, shopperReference, + isSetShopperReference, splitCardFundingSources, + isSetSplitCardFundingSources, store, + isSetStore, storeFiltrationMode, - telephoneNumber); + isSetStoreFiltrationMode, + telephoneNumber, + isSetTelephoneNumber); } @Override @@ -1144,6 +1303,81 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAllowedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_ALLOWED_PAYMENT_METHODS, this.allowedPaymentMethods); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetBlockedPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_BLOCKED_PAYMENT_METHODS, this.blockedPaymentMethods); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetShopperConversionId) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_CONVERSION_ID, this.shopperConversionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSplitCardFundingSources) { + addIfNull(nulls, JSON_PROPERTY_SPLIT_CARD_FUNDING_SOURCES, this.splitCardFundingSources); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStoreFiltrationMode) { + addIfNull(nulls, JSON_PROPERTY_STORE_FILTRATION_MODE, this.storeFiltrationMode); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodsRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java index ebb91e484..9f0dfcef6 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentMethodsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,9 +30,21 @@ public class PaymentMethodsResponse { public static final String JSON_PROPERTY_PAYMENT_METHODS = "paymentMethods"; private List paymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethods = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHODS = "storedPaymentMethods"; private List storedPaymentMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethods = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentMethodsResponse() {} /** @@ -41,6 +55,7 @@ public PaymentMethodsResponse() {} */ public PaymentMethodsResponse paymentMethods(List paymentMethods) { this.paymentMethods = paymentMethods; + isSetPaymentMethods = true; // mark as set return this; } @@ -72,6 +87,7 @@ public List getPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethods(List paymentMethods) { this.paymentMethods = paymentMethods; + isSetPaymentMethods = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setPaymentMethods(List paymentMethods) { public PaymentMethodsResponse storedPaymentMethods( List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set return this; } @@ -115,6 +132,27 @@ public List getStoredPaymentMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethods(List storedPaymentMethods) { this.storedPaymentMethods = storedPaymentMethods; + isSetStoredPaymentMethods = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentMethodsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentMethodsResponse object is equal to o. */ @@ -128,12 +166,16 @@ public boolean equals(Object o) { } PaymentMethodsResponse paymentMethodsResponse = (PaymentMethodsResponse) o; return Objects.equals(this.paymentMethods, paymentMethodsResponse.paymentMethods) - && Objects.equals(this.storedPaymentMethods, paymentMethodsResponse.storedPaymentMethods); + && Objects.equals(this.isSetPaymentMethods, paymentMethodsResponse.isSetPaymentMethods) + && Objects.equals(this.storedPaymentMethods, paymentMethodsResponse.storedPaymentMethods) + && Objects.equals( + this.isSetStoredPaymentMethods, paymentMethodsResponse.isSetStoredPaymentMethods); } @Override public int hashCode() { - return Objects.hash(paymentMethods, storedPaymentMethods); + return Objects.hash( + paymentMethods, isSetPaymentMethods, storedPaymentMethods, isSetStoredPaymentMethods); } @Override @@ -158,6 +200,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHODS, this.paymentMethods); + } + if (isSetStoredPaymentMethods) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHODS, this.storedPaymentMethods); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentMethodsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java index 323509c72..bd38e37cc 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -40,21 +42,39 @@ public class PaymentRefundRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_CAPTURE_PSP_REFERENCE = "capturePspReference"; private String capturePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapturePspReference = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + /** * The reason for the refund request. Possible values: * **FRAUD** * **CUSTOMER REQUEST** * * **RETURN** * **DUPLICATE** * **OTHER** @@ -108,15 +128,33 @@ public static MerchantRefundReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_MERCHANT_REFUND_REASON = "merchantRefundReason"; private MerchantRefundReasonEnum merchantRefundReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRefundReason = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRefundRequest() {} /** @@ -127,6 +165,7 @@ public PaymentRefundRequest() {} */ public PaymentRefundRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -150,6 +189,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -160,6 +200,7 @@ public void setAmount(Amount amount) { */ public PaymentRefundRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -183,6 +224,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -197,6 +239,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRefundRequest capturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set return this; } @@ -228,6 +271,7 @@ public String getCapturePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set } /** @@ -238,6 +282,7 @@ public void setCapturePspReference(String capturePspReference) { */ public PaymentRefundRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -261,6 +306,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -277,6 +323,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentRefundRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -320,6 +367,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -330,6 +378,7 @@ public void setLineItems(List lineItems) { */ public PaymentRefundRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -353,6 +402,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -365,6 +415,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRefundRequest merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set return this; } @@ -392,6 +443,7 @@ public MerchantRefundReasonEnum getMerchantRefundReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set } /** @@ -402,6 +454,7 @@ public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReaso */ public PaymentRefundRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -425,6 +478,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -441,6 +495,7 @@ public void setReference(String reference) { */ public PaymentRefundRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -484,6 +539,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -500,6 +556,7 @@ public void setSplits(List splits) { */ public PaymentRefundRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -535,6 +592,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRefundRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentRefundRequest object is equal to o. */ @@ -548,30 +626,53 @@ public boolean equals(Object o) { } PaymentRefundRequest paymentRefundRequest = (PaymentRefundRequest) o; return Objects.equals(this.amount, paymentRefundRequest.amount) + && Objects.equals(this.isSetAmount, paymentRefundRequest.isSetAmount) && Objects.equals(this.applicationInfo, paymentRefundRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentRefundRequest.isSetApplicationInfo) && Objects.equals(this.capturePspReference, paymentRefundRequest.capturePspReference) + && Objects.equals( + this.isSetCapturePspReference, paymentRefundRequest.isSetCapturePspReference) && Objects.equals(this.enhancedSchemeData, paymentRefundRequest.enhancedSchemeData) + && Objects.equals( + this.isSetEnhancedSchemeData, paymentRefundRequest.isSetEnhancedSchemeData) && Objects.equals(this.lineItems, paymentRefundRequest.lineItems) + && Objects.equals(this.isSetLineItems, paymentRefundRequest.isSetLineItems) && Objects.equals(this.merchantAccount, paymentRefundRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentRefundRequest.isSetMerchantAccount) && Objects.equals(this.merchantRefundReason, paymentRefundRequest.merchantRefundReason) + && Objects.equals( + this.isSetMerchantRefundReason, paymentRefundRequest.isSetMerchantRefundReason) && Objects.equals(this.reference, paymentRefundRequest.reference) + && Objects.equals(this.isSetReference, paymentRefundRequest.isSetReference) && Objects.equals(this.splits, paymentRefundRequest.splits) - && Objects.equals(this.store, paymentRefundRequest.store); + && Objects.equals(this.isSetSplits, paymentRefundRequest.isSetSplits) + && Objects.equals(this.store, paymentRefundRequest.store) + && Objects.equals(this.isSetStore, paymentRefundRequest.isSetStore); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, capturePspReference, + isSetCapturePspReference, enhancedSchemeData, + isSetEnhancedSchemeData, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, merchantRefundReason, + isSetMerchantRefundReason, reference, + isSetReference, splits, - store); + isSetSplits, + store, + isSetStore); } @Override @@ -606,6 +707,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetCapturePspReference) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_PSP_REFERENCE, this.capturePspReference); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantRefundReason) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFUND_REASON, this.merchantRefundReason); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentRefundRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java b/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java index e67a3d927..ae024734d 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRefundResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -41,15 +43,27 @@ public class PaymentRefundResponse { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_CAPTURE_PSP_REFERENCE = "capturePspReference"; private String capturePspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCapturePspReference = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + /** Your reason for the refund request. */ public enum MerchantRefundReasonEnum { FRAUD(String.valueOf("FRAUD")), @@ -100,18 +114,33 @@ public static MerchantRefundReasonEnum fromValue(String value) { public static final String JSON_PROPERTY_MERCHANT_REFUND_REASON = "merchantRefundReason"; private MerchantRefundReasonEnum merchantRefundReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRefundReason = false; + public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -154,9 +183,21 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRefundResponse() {} /** @@ -167,6 +208,7 @@ public PaymentRefundResponse() {} */ public PaymentRefundResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -190,6 +232,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -204,6 +247,7 @@ public void setAmount(Amount amount) { */ public PaymentRefundResponse capturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set return this; } @@ -235,6 +279,7 @@ public String getCapturePspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCapturePspReference(String capturePspReference) { this.capturePspReference = capturePspReference; + isSetCapturePspReference = true; // mark as set } /** @@ -251,6 +296,7 @@ public void setCapturePspReference(String capturePspReference) { */ public PaymentRefundResponse lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -294,6 +340,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -304,6 +351,7 @@ public void setLineItems(List lineItems) { */ public PaymentRefundResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -327,6 +375,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -337,6 +386,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRefundResponse merchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set return this; } @@ -360,6 +410,7 @@ public MerchantRefundReasonEnum getMerchantRefundReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReason) { this.merchantRefundReason = merchantRefundReason; + isSetMerchantRefundReason = true; // mark as set } /** @@ -374,6 +425,7 @@ public void setMerchantRefundReason(MerchantRefundReasonEnum merchantRefundReaso */ public PaymentRefundResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -405,6 +457,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -415,6 +468,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentRefundResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -438,6 +492,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -448,6 +503,7 @@ public void setPspReference(String pspReference) { */ public PaymentRefundResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -471,6 +527,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -487,6 +544,7 @@ public void setReference(String reference) { */ public PaymentRefundResponse splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -530,6 +588,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -540,6 +599,7 @@ public void setSplits(List splits) { */ public PaymentRefundResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -563,6 +623,7 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -579,6 +640,7 @@ public void setStatus(StatusEnum status) { */ public PaymentRefundResponse store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -614,6 +676,27 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRefundResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentRefundResponse object is equal to o. */ @@ -627,32 +710,57 @@ public boolean equals(Object o) { } PaymentRefundResponse paymentRefundResponse = (PaymentRefundResponse) o; return Objects.equals(this.amount, paymentRefundResponse.amount) + && Objects.equals(this.isSetAmount, paymentRefundResponse.isSetAmount) && Objects.equals(this.capturePspReference, paymentRefundResponse.capturePspReference) + && Objects.equals( + this.isSetCapturePspReference, paymentRefundResponse.isSetCapturePspReference) && Objects.equals(this.lineItems, paymentRefundResponse.lineItems) + && Objects.equals(this.isSetLineItems, paymentRefundResponse.isSetLineItems) && Objects.equals(this.merchantAccount, paymentRefundResponse.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentRefundResponse.isSetMerchantAccount) && Objects.equals(this.merchantRefundReason, paymentRefundResponse.merchantRefundReason) + && Objects.equals( + this.isSetMerchantRefundReason, paymentRefundResponse.isSetMerchantRefundReason) && Objects.equals(this.paymentPspReference, paymentRefundResponse.paymentPspReference) + && Objects.equals( + this.isSetPaymentPspReference, paymentRefundResponse.isSetPaymentPspReference) && Objects.equals(this.pspReference, paymentRefundResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentRefundResponse.isSetPspReference) && Objects.equals(this.reference, paymentRefundResponse.reference) + && Objects.equals(this.isSetReference, paymentRefundResponse.isSetReference) && Objects.equals(this.splits, paymentRefundResponse.splits) + && Objects.equals(this.isSetSplits, paymentRefundResponse.isSetSplits) && Objects.equals(this.status, paymentRefundResponse.status) - && Objects.equals(this.store, paymentRefundResponse.store); + && Objects.equals(this.isSetStatus, paymentRefundResponse.isSetStatus) + && Objects.equals(this.store, paymentRefundResponse.store) + && Objects.equals(this.isSetStore, paymentRefundResponse.isSetStore); } @Override public int hashCode() { return Objects.hash( amount, + isSetAmount, capturePspReference, + isSetCapturePspReference, lineItems, + isSetLineItems, merchantAccount, + isSetMerchantAccount, merchantRefundReason, + isSetMerchantRefundReason, paymentPspReference, + isSetPaymentPspReference, pspReference, + isSetPspReference, reference, + isSetReference, splits, + isSetSplits, status, - store); + isSetStatus, + store, + isSetStore); } @Override @@ -690,6 +798,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetCapturePspReference) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_PSP_REFERENCE, this.capturePspReference); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantRefundReason) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFUND_REASON, this.merchantRefundReason); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentRefundResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentRequest.java b/src/main/java/com/adyen/model/checkout/PaymentRequest.java index b60315ad1..af66cc6aa 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -82,7 +84,6 @@ PaymentRequest.JSON_PROPERTY_REFERENCE, PaymentRequest.JSON_PROPERTY_RETURN_URL, PaymentRequest.JSON_PROPERTY_RISK_DATA, - PaymentRequest.JSON_PROPERTY_SDK_DATA, PaymentRequest.JSON_PROPERTY_SESSION_VALIDITY, PaymentRequest.JSON_PROPERTY_SHOPPER_CONVERSION_ID, PaymentRequest.JSON_PROPERTY_SHOPPER_EMAIL, @@ -107,33 +108,63 @@ public class PaymentRequest { public static final String JSON_PROPERTY_ACCOUNT_INFO = "accountInfo"; private AccountInfo accountInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountInfo = false; + public static final String JSON_PROPERTY_ADDITIONAL_AMOUNT = "additionalAmount"; private Amount additionalAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalAmount = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_AUTHENTICATION_DATA = "authenticationData"; private AuthenticationData authenticationData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationData = false; + public static final String JSON_PROPERTY_BANK_ACCOUNT = "bankAccount"; private CheckoutBankAccount bankAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccount = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private BillingAddress billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_BROWSER_INFO = "browserInfo"; private BrowserInfo browserInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrowserInfo = false; + public static final String JSON_PROPERTY_CAPTURE_DELAY_HOURS = "captureDelayHours"; private Integer captureDelayHours; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCaptureDelayHours = false; + /** * The platform where a payment transaction takes place. This field is optional for filtering out * payment methods that are only available on specific platforms. If this value is not set, then @@ -185,50 +216,95 @@ public static ChannelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHANNEL = "channel"; private ChannelEnum channel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChannel = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_COMPANY = "company"; private Company company; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCompany = false; + public static final String JSON_PROPERTY_CONVERSION_ID = "conversionId"; @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead private String conversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConversionId = false; + public static final String JSON_PROPERTY_COUNTRY_CODE = "countryCode"; private String countryCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountryCode = false; + public static final String JSON_PROPERTY_DATE_OF_BIRTH = "dateOfBirth"; private OffsetDateTime dateOfBirth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDateOfBirth = false; + public static final String JSON_PROPERTY_DCC_QUOTE = "dccQuote"; private ForexQuote dccQuote; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDccQuote = false; + public static final String JSON_PROPERTY_DELIVER_AT = "deliverAt"; private OffsetDateTime deliverAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliverAt = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private DeliveryAddress deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DELIVERY_DATE = "deliveryDate"; @Deprecated // deprecated since Adyen Checkout API v70: Use `deliverAt` instead. private OffsetDateTime deliveryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryDate = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + public static final String JSON_PROPERTY_ENABLE_ONE_CLICK = "enableOneClick"; private Boolean enableOneClick; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableOneClick = false; + public static final String JSON_PROPERTY_ENABLE_PAY_OUT = "enablePayOut"; private Boolean enablePayOut; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnablePayOut = false; + public static final String JSON_PROPERTY_ENABLE_RECURRING = "enableRecurring"; private Boolean enableRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnableRecurring = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + /** The type of the entity the payment is processed for. */ public enum EntityTypeEnum { NATURALPERSON(String.valueOf("NaturalPerson")), @@ -273,15 +349,27 @@ public static EntityTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ENTITY_TYPE = "entityType"; private EntityTypeEnum entityType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEntityType = false; + public static final String JSON_PROPERTY_FRAUD_OFFSET = "fraudOffset"; private Integer fraudOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudOffset = false; + public static final String JSON_PROPERTY_FUND_ORIGIN = "fundOrigin"; private FundOrigin fundOrigin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundOrigin = false; + public static final String JSON_PROPERTY_FUND_RECIPIENT = "fundRecipient"; private FundRecipient fundRecipient; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundRecipient = false; + /** * The reason for the amount update. Possible values: * **delayedCharge** * **noShow** * * **installment** @@ -331,61 +419,118 @@ public static IndustryUsageEnum fromValue(String value) { public static final String JSON_PROPERTY_INDUSTRY_USAGE = "industryUsage"; private IndustryUsageEnum industryUsage; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIndustryUsage = false; + public static final String JSON_PROPERTY_INSTALLMENTS = "installments"; private Installments installments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallments = false; + public static final String JSON_PROPERTY_LINE_ITEMS = "lineItems"; private List lineItems; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLineItems = false; + public static final String JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT = "localizedShopperStatement"; private Map localizedShopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocalizedShopperStatement = false; + public static final String JSON_PROPERTY_MANDATE = "mandate"; private Mandate mandate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandate = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_MERCHANT_ORDER_REFERENCE = "merchantOrderReference"; private String merchantOrderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantOrderReference = false; + public static final String JSON_PROPERTY_MERCHANT_RISK_INDICATOR = "merchantRiskIndicator"; private MerchantRiskIndicator merchantRiskIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantRiskIndicator = false; + public static final String JSON_PROPERTY_METADATA = "metadata"; private Map metadata; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMetadata = false; + public static final String JSON_PROPERTY_MPI_DATA = "mpiData"; private ThreeDSecureData mpiData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMpiData = false; + public static final String JSON_PROPERTY_ORDER = "order"; private EncryptedOrderData order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_ORDER_REFERENCE = "orderReference"; private String orderReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrderReference = false; + public static final String JSON_PROPERTY_ORIGIN = "origin"; private String origin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrigin = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private CheckoutPaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_VALIDATIONS = "paymentValidations"; private PaymentValidations paymentValidations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentValidations = false; + public static final String JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC = "platformChargebackLogic"; private PlatformChargebackLogic platformChargebackLogic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPlatformChargebackLogic = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private String recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details or * using stored payment details. Allowed values: * `Subscription` – A transaction for a @@ -443,36 +588,63 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD = "redirectFromIssuerMethod"; private String redirectFromIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectFromIssuerMethod = false; + public static final String JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD = "redirectToIssuerMethod"; private String redirectToIssuerMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRedirectToIssuerMethod = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + public static final String JSON_PROPERTY_RETURN_URL = "returnUrl"; private String returnUrl; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReturnUrl = false; + public static final String JSON_PROPERTY_RISK_DATA = "riskData"; private RiskData riskData; - public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; - private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskData = false; public static final String JSON_PROPERTY_SESSION_VALIDITY = "sessionValidity"; private String sessionValidity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionValidity = false; + public static final String JSON_PROPERTY_SHOPPER_CONVERSION_ID = "shopperConversionId"; private String shopperConversionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperConversionId = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + /** * Specifies the sales channel, through which the shopper gives their card details, and whether * the shopper is a returning customer. For the web service API, Adyen assumes Ecommerce shopper @@ -533,51 +705,102 @@ public static ShopperInteractionEnum fromValue(String value) { public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private ShopperInteractionEnum shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_LOCALE = "shopperLocale"; private String shopperLocale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperLocale = false; + public static final String JSON_PROPERTY_SHOPPER_NAME = "shopperName"; private ShopperName shopperName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperName = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SHOPPER_STATEMENT = "shopperStatement"; private String shopperStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperStatement = false; + public static final String JSON_PROPERTY_SOCIAL_SECURITY_NUMBER = "socialSecurityNumber"; private String socialSecurityNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSocialSecurityNumber = false; + public static final String JSON_PROPERTY_SPLITS = "splits"; private List splits; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSplits = false; + public static final String JSON_PROPERTY_STORE = "store"; private String store; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + public static final String JSON_PROPERTY_STORE_PAYMENT_METHOD = "storePaymentMethod"; private Boolean storePaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStorePaymentMethod = false; + public static final String JSON_PROPERTY_SUB_MERCHANTS = "subMerchants"; private List subMerchants; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchants = false; + public static final String JSON_PROPERTY_SURCHARGE = "surcharge"; private Surcharge surcharge; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSurcharge = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + public static final String JSON_PROPERTY_THREE_D_S2_REQUEST_DATA = "threeDS2RequestData"; private ThreeDS2RequestFields threeDS2RequestData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2RequestData = false; + public static final String JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY = "threeDSAuthenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v69: Use // `authenticationData.authenticationOnly` instead. private Boolean threeDSAuthenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSAuthenticationOnly = false; + public static final String JSON_PROPERTY_TRUSTED_SHOPPER = "trustedShopper"; private Boolean trustedShopper; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTrustedShopper = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentRequest() {} /** @@ -588,6 +811,7 @@ public PaymentRequest() {} */ public PaymentRequest accountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set return this; } @@ -611,6 +835,7 @@ public AccountInfo getAccountInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountInfo(AccountInfo accountInfo) { this.accountInfo = accountInfo; + isSetAccountInfo = true; // mark as set } /** @@ -621,6 +846,7 @@ public void setAccountInfo(AccountInfo accountInfo) { */ public PaymentRequest additionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set return this; } @@ -644,6 +870,7 @@ public Amount getAdditionalAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalAmount(Amount additionalAmount) { this.additionalAmount = additionalAmount; + isSetAdditionalAmount = true; // mark as set } /** @@ -658,6 +885,7 @@ public void setAdditionalAmount(Amount additionalAmount) { */ public PaymentRequest additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -697,6 +925,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -707,6 +936,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -730,6 +960,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -740,6 +971,7 @@ public void setAmount(Amount amount) { */ public PaymentRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -763,6 +995,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -773,6 +1006,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentRequest authenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set return this; } @@ -796,6 +1030,7 @@ public AuthenticationData getAuthenticationData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationData(AuthenticationData authenticationData) { this.authenticationData = authenticationData; + isSetAuthenticationData = true; // mark as set } /** @@ -806,6 +1041,7 @@ public void setAuthenticationData(AuthenticationData authenticationData) { */ public PaymentRequest bankAccount(CheckoutBankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set return this; } @@ -829,6 +1065,7 @@ public CheckoutBankAccount getBankAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccount(CheckoutBankAccount bankAccount) { this.bankAccount = bankAccount; + isSetBankAccount = true; // mark as set } /** @@ -839,6 +1076,7 @@ public void setBankAccount(CheckoutBankAccount bankAccount) { */ public PaymentRequest billingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -862,6 +1100,7 @@ public BillingAddress getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(BillingAddress billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -872,6 +1111,7 @@ public void setBillingAddress(BillingAddress billingAddress) { */ public PaymentRequest browserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set return this; } @@ -895,6 +1135,7 @@ public BrowserInfo getBrowserInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserInfo(BrowserInfo browserInfo) { this.browserInfo = browserInfo; + isSetBrowserInfo = true; // mark as set } /** @@ -906,6 +1147,7 @@ public void setBrowserInfo(BrowserInfo browserInfo) { */ public PaymentRequest captureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set return this; } @@ -931,6 +1173,7 @@ public Integer getCaptureDelayHours() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCaptureDelayHours(Integer captureDelayHours) { this.captureDelayHours = captureDelayHours; + isSetCaptureDelayHours = true; // mark as set } /** @@ -947,6 +1190,7 @@ public void setCaptureDelayHours(Integer captureDelayHours) { */ public PaymentRequest channel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set return this; } @@ -982,6 +1226,7 @@ public ChannelEnum getChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChannel(ChannelEnum channel) { this.channel = channel; + isSetChannel = true; // mark as set } /** @@ -994,6 +1239,7 @@ public void setChannel(ChannelEnum channel) { */ public PaymentRequest checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -1021,6 +1267,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -1031,6 +1278,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PaymentRequest company(Company company) { this.company = company; + isSetCompany = true; // mark as set return this; } @@ -1054,6 +1302,7 @@ public Company getCompany() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCompany(Company company) { this.company = company; + isSetCompany = true; // mark as set } /** @@ -1068,6 +1317,7 @@ public void setCompany(Company company) { @Deprecated // deprecated since Adyen Checkout API v68: Use `checkoutAttemptId` instead public PaymentRequest conversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set return this; } @@ -1099,6 +1349,7 @@ public String getConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConversionId(String conversionId) { this.conversionId = conversionId; + isSetConversionId = true; // mark as set } /** @@ -1111,6 +1362,7 @@ public void setConversionId(String conversionId) { */ public PaymentRequest countryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set return this; } @@ -1138,6 +1390,7 @@ public String getCountryCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(String countryCode) { this.countryCode = countryCode; + isSetCountryCode = true; // mark as set } /** @@ -1150,6 +1403,7 @@ public void setCountryCode(String countryCode) { */ public PaymentRequest dateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set return this; } @@ -1177,6 +1431,7 @@ public OffsetDateTime getDateOfBirth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateOfBirth(OffsetDateTime dateOfBirth) { this.dateOfBirth = dateOfBirth; + isSetDateOfBirth = true; // mark as set } /** @@ -1187,6 +1442,7 @@ public void setDateOfBirth(OffsetDateTime dateOfBirth) { */ public PaymentRequest dccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set return this; } @@ -1210,6 +1466,7 @@ public ForexQuote getDccQuote() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDccQuote(ForexQuote dccQuote) { this.dccQuote = dccQuote; + isSetDccQuote = true; // mark as set } /** @@ -1224,6 +1481,7 @@ public void setDccQuote(ForexQuote dccQuote) { */ public PaymentRequest deliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set return this; } @@ -1255,6 +1513,7 @@ public OffsetDateTime getDeliverAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliverAt(OffsetDateTime deliverAt) { this.deliverAt = deliverAt; + isSetDeliverAt = true; // mark as set } /** @@ -1265,6 +1524,7 @@ public void setDeliverAt(OffsetDateTime deliverAt) { */ public PaymentRequest deliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -1288,6 +1548,7 @@ public DeliveryAddress getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(DeliveryAddress deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -1304,6 +1565,7 @@ public void setDeliveryAddress(DeliveryAddress deliveryAddress) { @Deprecated // deprecated since Adyen Checkout API v70: Use `deliverAt` instead. public PaymentRequest deliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set return this; } @@ -1339,6 +1601,7 @@ public OffsetDateTime getDeliveryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryDate(OffsetDateTime deliveryDate) { this.deliveryDate = deliveryDate; + isSetDeliveryDate = true; // mark as set } /** @@ -1352,6 +1615,7 @@ public void setDeliveryDate(OffsetDateTime deliveryDate) { */ public PaymentRequest deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -1381,6 +1645,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -1395,6 +1660,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public PaymentRequest enableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set return this; } @@ -1426,6 +1692,7 @@ public Boolean getEnableOneClick() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableOneClick(Boolean enableOneClick) { this.enableOneClick = enableOneClick; + isSetEnableOneClick = true; // mark as set } /** @@ -1438,6 +1705,7 @@ public void setEnableOneClick(Boolean enableOneClick) { */ public PaymentRequest enablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set return this; } @@ -1465,6 +1733,7 @@ public Boolean getEnablePayOut() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnablePayOut(Boolean enablePayOut) { this.enablePayOut = enablePayOut; + isSetEnablePayOut = true; // mark as set } /** @@ -1481,6 +1750,7 @@ public void setEnablePayOut(Boolean enablePayOut) { */ public PaymentRequest enableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set return this; } @@ -1516,6 +1786,7 @@ public Boolean getEnableRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnableRecurring(Boolean enableRecurring) { this.enableRecurring = enableRecurring; + isSetEnableRecurring = true; // mark as set } /** @@ -1526,6 +1797,7 @@ public void setEnableRecurring(Boolean enableRecurring) { */ public PaymentRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -1549,6 +1821,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -1559,6 +1832,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentRequest entityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set return this; } @@ -1582,6 +1856,7 @@ public EntityTypeEnum getEntityType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEntityType(EntityTypeEnum entityType) { this.entityType = entityType; + isSetEntityType = true; // mark as set } /** @@ -1594,6 +1869,7 @@ public void setEntityType(EntityTypeEnum entityType) { */ public PaymentRequest fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -1621,6 +1897,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -1631,6 +1908,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public PaymentRequest fundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set return this; } @@ -1654,6 +1932,7 @@ public FundOrigin getFundOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundOrigin(FundOrigin fundOrigin) { this.fundOrigin = fundOrigin; + isSetFundOrigin = true; // mark as set } /** @@ -1664,6 +1943,7 @@ public void setFundOrigin(FundOrigin fundOrigin) { */ public PaymentRequest fundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set return this; } @@ -1687,6 +1967,7 @@ public FundRecipient getFundRecipient() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundRecipient(FundRecipient fundRecipient) { this.fundRecipient = fundRecipient; + isSetFundRecipient = true; // mark as set } /** @@ -1699,6 +1980,7 @@ public void setFundRecipient(FundRecipient fundRecipient) { */ public PaymentRequest industryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set return this; } @@ -1726,6 +2008,7 @@ public IndustryUsageEnum getIndustryUsage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndustryUsage(IndustryUsageEnum industryUsage) { this.industryUsage = industryUsage; + isSetIndustryUsage = true; // mark as set } /** @@ -1736,6 +2019,7 @@ public void setIndustryUsage(IndustryUsageEnum industryUsage) { */ public PaymentRequest installments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set return this; } @@ -1759,6 +2043,7 @@ public Installments getInstallments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallments(Installments installments) { this.installments = installments; + isSetInstallments = true; // mark as set } /** @@ -1773,6 +2058,7 @@ public void setInstallments(Installments installments) { */ public PaymentRequest lineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set return this; } @@ -1812,6 +2098,7 @@ public List getLineItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLineItems(List lineItems) { this.lineItems = lineItems; + isSetLineItems = true; // mark as set } /** @@ -1832,6 +2119,7 @@ public void setLineItems(List lineItems) { */ public PaymentRequest localizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set return this; } @@ -1884,6 +2172,7 @@ public Map getLocalizedShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalizedShopperStatement(Map localizedShopperStatement) { this.localizedShopperStatement = localizedShopperStatement; + isSetLocalizedShopperStatement = true; // mark as set } /** @@ -1894,6 +2183,7 @@ public void setLocalizedShopperStatement(Map localizedShopperSta */ public PaymentRequest mandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -1917,6 +2207,7 @@ public Mandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(Mandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -1931,6 +2222,7 @@ public void setMandate(Mandate mandate) { */ public PaymentRequest mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -1962,6 +2254,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -1973,6 +2266,7 @@ public void setMcc(String mcc) { */ public PaymentRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -1998,6 +2292,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -2022,6 +2317,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentRequest merchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set return this; } @@ -2074,6 +2370,7 @@ public String getMerchantOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantOrderReference(String merchantOrderReference) { this.merchantOrderReference = merchantOrderReference; + isSetMerchantOrderReference = true; // mark as set } /** @@ -2084,6 +2381,7 @@ public void setMerchantOrderReference(String merchantOrderReference) { */ public PaymentRequest merchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set return this; } @@ -2107,6 +2405,7 @@ public MerchantRiskIndicator getMerchantRiskIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator) { this.merchantRiskIndicator = merchantRiskIndicator; + isSetMerchantRiskIndicator = true; // mark as set } /** @@ -2123,6 +2422,7 @@ public void setMerchantRiskIndicator(MerchantRiskIndicator merchantRiskIndicator */ public PaymentRequest metadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set return this; } @@ -2166,6 +2466,7 @@ public Map getMetadata() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMetadata(Map metadata) { this.metadata = metadata; + isSetMetadata = true; // mark as set } /** @@ -2176,6 +2477,7 @@ public void setMetadata(Map metadata) { */ public PaymentRequest mpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set return this; } @@ -2199,6 +2501,7 @@ public ThreeDSecureData getMpiData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMpiData(ThreeDSecureData mpiData) { this.mpiData = mpiData; + isSetMpiData = true; // mark as set } /** @@ -2209,6 +2512,7 @@ public void setMpiData(ThreeDSecureData mpiData) { */ public PaymentRequest order(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -2232,6 +2536,7 @@ public EncryptedOrderData getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(EncryptedOrderData order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -2247,6 +2552,7 @@ public void setOrder(EncryptedOrderData order) { */ public PaymentRequest orderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set return this; } @@ -2280,6 +2586,7 @@ public String getOrderReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrderReference(String orderReference) { this.orderReference = orderReference; + isSetOrderReference = true; // mark as set } /** @@ -2294,6 +2601,7 @@ public void setOrderReference(String orderReference) { */ public PaymentRequest origin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set return this; } @@ -2325,6 +2633,7 @@ public String getOrigin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrigin(String origin) { this.origin = origin; + isSetOrigin = true; // mark as set } /** @@ -2335,6 +2644,7 @@ public void setOrigin(String origin) { */ public PaymentRequest paymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -2358,6 +2668,7 @@ public CheckoutPaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(CheckoutPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -2368,6 +2679,7 @@ public void setPaymentMethod(CheckoutPaymentMethod paymentMethod) { */ public PaymentRequest paymentValidations(PaymentValidations paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set return this; } @@ -2391,6 +2703,7 @@ public PaymentValidations getPaymentValidations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentValidations(PaymentValidations paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set } /** @@ -2401,6 +2714,7 @@ public void setPaymentValidations(PaymentValidations paymentValidations) { */ public PaymentRequest platformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set return this; } @@ -2424,6 +2738,7 @@ public PlatformChargebackLogic getPlatformChargebackLogic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebackLogic) { this.platformChargebackLogic = platformChargebackLogic; + isSetPlatformChargebackLogic = true; // mark as set } /** @@ -2435,6 +2750,7 @@ public void setPlatformChargebackLogic(PlatformChargebackLogic platformChargebac */ public PaymentRequest recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -2460,6 +2776,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -2470,6 +2787,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public PaymentRequest recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -2493,6 +2811,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -2521,6 +2840,7 @@ public void setRecurringFrequency(String recurringFrequency) { public PaymentRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2578,6 +2898,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2589,6 +2910,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public PaymentRequest redirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set return this; } @@ -2614,6 +2936,7 @@ public String getRedirectFromIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { this.redirectFromIssuerMethod = redirectFromIssuerMethod; + isSetRedirectFromIssuerMethod = true; // mark as set } /** @@ -2625,6 +2948,7 @@ public void setRedirectFromIssuerMethod(String redirectFromIssuerMethod) { */ public PaymentRequest redirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set return this; } @@ -2650,6 +2974,7 @@ public String getRedirectToIssuerMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { this.redirectToIssuerMethod = redirectToIssuerMethod; + isSetRedirectToIssuerMethod = true; // mark as set } /** @@ -2666,6 +2991,7 @@ public void setRedirectToIssuerMethod(String redirectToIssuerMethod) { */ public PaymentRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -2701,6 +3027,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -2738,6 +3065,7 @@ public void setReference(String reference) { */ public PaymentRequest returnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set return this; } @@ -2815,6 +3143,7 @@ public String getReturnUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; + isSetReturnUrl = true; // mark as set } /** @@ -2825,6 +3154,7 @@ public void setReturnUrl(String returnUrl) { */ public PaymentRequest riskData(RiskData riskData) { this.riskData = riskData; + isSetRiskData = true; // mark as set return this; } @@ -2848,46 +3178,7 @@ public RiskData getRiskData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskData(RiskData riskData) { this.riskData = riskData; - } - - /** - * Base64-encoded JSON object containing SDK related parameters required by the SDK to function - * optimally. Clients must not add unrelated or sensitive personal information. - * - * @param sdkData Base64-encoded JSON object containing SDK related parameters required by the SDK - * to function optimally. Clients must not add unrelated or sensitive personal information. - * @return the current {@code PaymentRequest} instance, allowing for method chaining - */ - public PaymentRequest sdkData(String sdkData) { - this.sdkData = sdkData; - return this; - } - - /** - * Base64-encoded JSON object containing SDK related parameters required by the SDK to function - * optimally. Clients must not add unrelated or sensitive personal information. - * - * @return sdkData Base64-encoded JSON object containing SDK related parameters required by the - * SDK to function optimally. Clients must not add unrelated or sensitive personal - * information. - */ - @JsonProperty(JSON_PROPERTY_SDK_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSdkData() { - return sdkData; - } - - /** - * Base64-encoded JSON object containing SDK related parameters required by the SDK to function - * optimally. Clients must not add unrelated or sensitive personal information. - * - * @param sdkData Base64-encoded JSON object containing SDK related parameters required by the SDK - * to function optimally. Clients must not add unrelated or sensitive personal information. - */ - @JsonProperty(JSON_PROPERTY_SDK_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSdkData(String sdkData) { - this.sdkData = sdkData; + isSetRiskData = true; // mark as set } /** @@ -2901,6 +3192,7 @@ public void setSdkData(String sdkData) { */ public PaymentRequest sessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set return this; } @@ -2930,6 +3222,7 @@ public String getSessionValidity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionValidity(String sessionValidity) { this.sessionValidity = sessionValidity; + isSetSessionValidity = true; // mark as set } /** @@ -2943,6 +3236,7 @@ public void setSessionValidity(String sessionValidity) { */ public PaymentRequest shopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set return this; } @@ -2972,6 +3266,7 @@ public String getShopperConversionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperConversionId(String shopperConversionId) { this.shopperConversionId = shopperConversionId; + isSetShopperConversionId = true; // mark as set } /** @@ -2986,6 +3281,7 @@ public void setShopperConversionId(String shopperConversionId) { */ public PaymentRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -3017,6 +3313,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -3040,6 +3337,7 @@ public void setShopperEmail(String shopperEmail) { */ public PaymentRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -3089,6 +3387,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -3120,6 +3419,7 @@ public void setShopperIP(String shopperIP) { */ public PaymentRequest shopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -3185,6 +3485,7 @@ public ShopperInteractionEnum getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -3197,6 +3498,7 @@ public void setShopperInteraction(ShopperInteractionEnum shopperInteraction) { */ public PaymentRequest shopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set return this; } @@ -3224,6 +3526,7 @@ public String getShopperLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperLocale(String shopperLocale) { this.shopperLocale = shopperLocale; + isSetShopperLocale = true; // mark as set } /** @@ -3234,6 +3537,7 @@ public void setShopperLocale(String shopperLocale) { */ public PaymentRequest shopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set return this; } @@ -3257,6 +3561,7 @@ public ShopperName getShopperName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperName(ShopperName shopperName) { this.shopperName = shopperName; + isSetShopperName = true; // mark as set } /** @@ -3272,6 +3577,7 @@ public void setShopperName(ShopperName shopperName) { */ public PaymentRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -3305,6 +3611,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -3320,6 +3627,7 @@ public void setShopperReference(String shopperReference) { */ public PaymentRequest shopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set return this; } @@ -3353,6 +3661,7 @@ public String getShopperStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperStatement(String shopperStatement) { this.shopperStatement = shopperStatement; + isSetShopperStatement = true; // mark as set } /** @@ -3363,6 +3672,7 @@ public void setShopperStatement(String shopperStatement) { */ public PaymentRequest socialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set return this; } @@ -3386,6 +3696,7 @@ public String getSocialSecurityNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSocialSecurityNumber(String socialSecurityNumber) { this.socialSecurityNumber = socialSecurityNumber; + isSetSocialSecurityNumber = true; // mark as set } /** @@ -3404,6 +3715,7 @@ public void setSocialSecurityNumber(String socialSecurityNumber) { */ public PaymentRequest splits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set return this; } @@ -3451,6 +3763,7 @@ public List getSplits() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSplits(List splits) { this.splits = splits; + isSetSplits = true; // mark as set } /** @@ -3474,6 +3787,7 @@ public void setSplits(List splits) { */ public PaymentRequest store(String store) { this.store = store; + isSetStore = true; // mark as set return this; } @@ -3523,6 +3837,7 @@ public String getStore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStore(String store) { this.store = store; + isSetStore = true; // mark as set } /** @@ -3537,6 +3852,7 @@ public void setStore(String store) { */ public PaymentRequest storePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set return this; } @@ -3568,6 +3884,7 @@ public Boolean getStorePaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStorePaymentMethod(Boolean storePaymentMethod) { this.storePaymentMethod = storePaymentMethod; + isSetStorePaymentMethod = true; // mark as set } /** @@ -3580,6 +3897,7 @@ public void setStorePaymentMethod(Boolean storePaymentMethod) { */ public PaymentRequest subMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set return this; } @@ -3615,6 +3933,7 @@ public List getSubMerchants() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubMerchants(List subMerchants) { this.subMerchants = subMerchants; + isSetSubMerchants = true; // mark as set } /** @@ -3625,6 +3944,7 @@ public void setSubMerchants(List subMerchants) { */ public PaymentRequest surcharge(Surcharge surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set return this; } @@ -3648,6 +3968,7 @@ public Surcharge getSurcharge() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSurcharge(Surcharge surcharge) { this.surcharge = surcharge; + isSetSurcharge = true; // mark as set } /** @@ -3666,6 +3987,7 @@ public void setSurcharge(Surcharge surcharge) { */ public PaymentRequest telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -3705,6 +4027,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -3715,6 +4038,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public PaymentRequest threeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set return this; } @@ -3738,6 +4062,7 @@ public ThreeDS2RequestFields getThreeDS2RequestData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { this.threeDS2RequestData = threeDS2RequestData; + isSetThreeDS2RequestData = true; // mark as set } /** @@ -3758,6 +4083,7 @@ public void setThreeDS2RequestData(ThreeDS2RequestFields threeDS2RequestData) { // `authenticationData.authenticationOnly` instead. public PaymentRequest threeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set return this; } @@ -3801,6 +4127,7 @@ public Boolean getThreeDSAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { this.threeDSAuthenticationOnly = threeDSAuthenticationOnly; + isSetThreeDSAuthenticationOnly = true; // mark as set } /** @@ -3811,6 +4138,7 @@ public void setThreeDSAuthenticationOnly(Boolean threeDSAuthenticationOnly) { */ public PaymentRequest trustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set return this; } @@ -3834,6 +4162,27 @@ public Boolean getTrustedShopper() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTrustedShopper(Boolean trustedShopper) { this.trustedShopper = trustedShopper; + isSetTrustedShopper = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentRequest object is equal to o. */ @@ -3847,158 +4196,310 @@ public boolean equals(Object o) { } PaymentRequest paymentRequest = (PaymentRequest) o; return Objects.equals(this.accountInfo, paymentRequest.accountInfo) + && Objects.equals(this.isSetAccountInfo, paymentRequest.isSetAccountInfo) && Objects.equals(this.additionalAmount, paymentRequest.additionalAmount) + && Objects.equals(this.isSetAdditionalAmount, paymentRequest.isSetAdditionalAmount) && Objects.equals(this.additionalData, paymentRequest.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentRequest.isSetAdditionalData) && Objects.equals(this.amount, paymentRequest.amount) + && Objects.equals(this.isSetAmount, paymentRequest.isSetAmount) && Objects.equals(this.applicationInfo, paymentRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentRequest.isSetApplicationInfo) && Objects.equals(this.authenticationData, paymentRequest.authenticationData) + && Objects.equals(this.isSetAuthenticationData, paymentRequest.isSetAuthenticationData) && Objects.equals(this.bankAccount, paymentRequest.bankAccount) + && Objects.equals(this.isSetBankAccount, paymentRequest.isSetBankAccount) && Objects.equals(this.billingAddress, paymentRequest.billingAddress) + && Objects.equals(this.isSetBillingAddress, paymentRequest.isSetBillingAddress) && Objects.equals(this.browserInfo, paymentRequest.browserInfo) + && Objects.equals(this.isSetBrowserInfo, paymentRequest.isSetBrowserInfo) && Objects.equals(this.captureDelayHours, paymentRequest.captureDelayHours) + && Objects.equals(this.isSetCaptureDelayHours, paymentRequest.isSetCaptureDelayHours) && Objects.equals(this.channel, paymentRequest.channel) + && Objects.equals(this.isSetChannel, paymentRequest.isSetChannel) && Objects.equals(this.checkoutAttemptId, paymentRequest.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, paymentRequest.isSetCheckoutAttemptId) && Objects.equals(this.company, paymentRequest.company) + && Objects.equals(this.isSetCompany, paymentRequest.isSetCompany) && Objects.equals(this.conversionId, paymentRequest.conversionId) + && Objects.equals(this.isSetConversionId, paymentRequest.isSetConversionId) && Objects.equals(this.countryCode, paymentRequest.countryCode) + && Objects.equals(this.isSetCountryCode, paymentRequest.isSetCountryCode) && Objects.equals(this.dateOfBirth, paymentRequest.dateOfBirth) + && Objects.equals(this.isSetDateOfBirth, paymentRequest.isSetDateOfBirth) && Objects.equals(this.dccQuote, paymentRequest.dccQuote) + && Objects.equals(this.isSetDccQuote, paymentRequest.isSetDccQuote) && Objects.equals(this.deliverAt, paymentRequest.deliverAt) + && Objects.equals(this.isSetDeliverAt, paymentRequest.isSetDeliverAt) && Objects.equals(this.deliveryAddress, paymentRequest.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, paymentRequest.isSetDeliveryAddress) && Objects.equals(this.deliveryDate, paymentRequest.deliveryDate) + && Objects.equals(this.isSetDeliveryDate, paymentRequest.isSetDeliveryDate) && Objects.equals(this.deviceFingerprint, paymentRequest.deviceFingerprint) + && Objects.equals(this.isSetDeviceFingerprint, paymentRequest.isSetDeviceFingerprint) && Objects.equals(this.enableOneClick, paymentRequest.enableOneClick) + && Objects.equals(this.isSetEnableOneClick, paymentRequest.isSetEnableOneClick) && Objects.equals(this.enablePayOut, paymentRequest.enablePayOut) + && Objects.equals(this.isSetEnablePayOut, paymentRequest.isSetEnablePayOut) && Objects.equals(this.enableRecurring, paymentRequest.enableRecurring) + && Objects.equals(this.isSetEnableRecurring, paymentRequest.isSetEnableRecurring) && Objects.equals(this.enhancedSchemeData, paymentRequest.enhancedSchemeData) + && Objects.equals(this.isSetEnhancedSchemeData, paymentRequest.isSetEnhancedSchemeData) && Objects.equals(this.entityType, paymentRequest.entityType) + && Objects.equals(this.isSetEntityType, paymentRequest.isSetEntityType) && Objects.equals(this.fraudOffset, paymentRequest.fraudOffset) + && Objects.equals(this.isSetFraudOffset, paymentRequest.isSetFraudOffset) && Objects.equals(this.fundOrigin, paymentRequest.fundOrigin) + && Objects.equals(this.isSetFundOrigin, paymentRequest.isSetFundOrigin) && Objects.equals(this.fundRecipient, paymentRequest.fundRecipient) + && Objects.equals(this.isSetFundRecipient, paymentRequest.isSetFundRecipient) && Objects.equals(this.industryUsage, paymentRequest.industryUsage) + && Objects.equals(this.isSetIndustryUsage, paymentRequest.isSetIndustryUsage) && Objects.equals(this.installments, paymentRequest.installments) + && Objects.equals(this.isSetInstallments, paymentRequest.isSetInstallments) && Objects.equals(this.lineItems, paymentRequest.lineItems) + && Objects.equals(this.isSetLineItems, paymentRequest.isSetLineItems) && Objects.equals(this.localizedShopperStatement, paymentRequest.localizedShopperStatement) + && Objects.equals( + this.isSetLocalizedShopperStatement, paymentRequest.isSetLocalizedShopperStatement) && Objects.equals(this.mandate, paymentRequest.mandate) + && Objects.equals(this.isSetMandate, paymentRequest.isSetMandate) && Objects.equals(this.mcc, paymentRequest.mcc) + && Objects.equals(this.isSetMcc, paymentRequest.isSetMcc) && Objects.equals(this.merchantAccount, paymentRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentRequest.isSetMerchantAccount) && Objects.equals(this.merchantOrderReference, paymentRequest.merchantOrderReference) + && Objects.equals( + this.isSetMerchantOrderReference, paymentRequest.isSetMerchantOrderReference) && Objects.equals(this.merchantRiskIndicator, paymentRequest.merchantRiskIndicator) + && Objects.equals( + this.isSetMerchantRiskIndicator, paymentRequest.isSetMerchantRiskIndicator) && Objects.equals(this.metadata, paymentRequest.metadata) + && Objects.equals(this.isSetMetadata, paymentRequest.isSetMetadata) && Objects.equals(this.mpiData, paymentRequest.mpiData) + && Objects.equals(this.isSetMpiData, paymentRequest.isSetMpiData) && Objects.equals(this.order, paymentRequest.order) + && Objects.equals(this.isSetOrder, paymentRequest.isSetOrder) && Objects.equals(this.orderReference, paymentRequest.orderReference) + && Objects.equals(this.isSetOrderReference, paymentRequest.isSetOrderReference) && Objects.equals(this.origin, paymentRequest.origin) + && Objects.equals(this.isSetOrigin, paymentRequest.isSetOrigin) && Objects.equals(this.paymentMethod, paymentRequest.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, paymentRequest.isSetPaymentMethod) && Objects.equals(this.paymentValidations, paymentRequest.paymentValidations) + && Objects.equals(this.isSetPaymentValidations, paymentRequest.isSetPaymentValidations) && Objects.equals(this.platformChargebackLogic, paymentRequest.platformChargebackLogic) + && Objects.equals( + this.isSetPlatformChargebackLogic, paymentRequest.isSetPlatformChargebackLogic) && Objects.equals(this.recurringExpiry, paymentRequest.recurringExpiry) + && Objects.equals(this.isSetRecurringExpiry, paymentRequest.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, paymentRequest.recurringFrequency) + && Objects.equals(this.isSetRecurringFrequency, paymentRequest.isSetRecurringFrequency) && Objects.equals(this.recurringProcessingModel, paymentRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, paymentRequest.isSetRecurringProcessingModel) && Objects.equals(this.redirectFromIssuerMethod, paymentRequest.redirectFromIssuerMethod) + && Objects.equals( + this.isSetRedirectFromIssuerMethod, paymentRequest.isSetRedirectFromIssuerMethod) && Objects.equals(this.redirectToIssuerMethod, paymentRequest.redirectToIssuerMethod) + && Objects.equals( + this.isSetRedirectToIssuerMethod, paymentRequest.isSetRedirectToIssuerMethod) && Objects.equals(this.reference, paymentRequest.reference) + && Objects.equals(this.isSetReference, paymentRequest.isSetReference) && Objects.equals(this.returnUrl, paymentRequest.returnUrl) + && Objects.equals(this.isSetReturnUrl, paymentRequest.isSetReturnUrl) && Objects.equals(this.riskData, paymentRequest.riskData) - && Objects.equals(this.sdkData, paymentRequest.sdkData) + && Objects.equals(this.isSetRiskData, paymentRequest.isSetRiskData) && Objects.equals(this.sessionValidity, paymentRequest.sessionValidity) + && Objects.equals(this.isSetSessionValidity, paymentRequest.isSetSessionValidity) && Objects.equals(this.shopperConversionId, paymentRequest.shopperConversionId) + && Objects.equals(this.isSetShopperConversionId, paymentRequest.isSetShopperConversionId) && Objects.equals(this.shopperEmail, paymentRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, paymentRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, paymentRequest.shopperIP) + && Objects.equals(this.isSetShopperIP, paymentRequest.isSetShopperIP) && Objects.equals(this.shopperInteraction, paymentRequest.shopperInteraction) + && Objects.equals(this.isSetShopperInteraction, paymentRequest.isSetShopperInteraction) && Objects.equals(this.shopperLocale, paymentRequest.shopperLocale) + && Objects.equals(this.isSetShopperLocale, paymentRequest.isSetShopperLocale) && Objects.equals(this.shopperName, paymentRequest.shopperName) + && Objects.equals(this.isSetShopperName, paymentRequest.isSetShopperName) && Objects.equals(this.shopperReference, paymentRequest.shopperReference) + && Objects.equals(this.isSetShopperReference, paymentRequest.isSetShopperReference) && Objects.equals(this.shopperStatement, paymentRequest.shopperStatement) + && Objects.equals(this.isSetShopperStatement, paymentRequest.isSetShopperStatement) && Objects.equals(this.socialSecurityNumber, paymentRequest.socialSecurityNumber) + && Objects.equals(this.isSetSocialSecurityNumber, paymentRequest.isSetSocialSecurityNumber) && Objects.equals(this.splits, paymentRequest.splits) + && Objects.equals(this.isSetSplits, paymentRequest.isSetSplits) && Objects.equals(this.store, paymentRequest.store) + && Objects.equals(this.isSetStore, paymentRequest.isSetStore) && Objects.equals(this.storePaymentMethod, paymentRequest.storePaymentMethod) + && Objects.equals(this.isSetStorePaymentMethod, paymentRequest.isSetStorePaymentMethod) && Objects.equals(this.subMerchants, paymentRequest.subMerchants) + && Objects.equals(this.isSetSubMerchants, paymentRequest.isSetSubMerchants) && Objects.equals(this.surcharge, paymentRequest.surcharge) + && Objects.equals(this.isSetSurcharge, paymentRequest.isSetSurcharge) && Objects.equals(this.telephoneNumber, paymentRequest.telephoneNumber) + && Objects.equals(this.isSetTelephoneNumber, paymentRequest.isSetTelephoneNumber) && Objects.equals(this.threeDS2RequestData, paymentRequest.threeDS2RequestData) + && Objects.equals(this.isSetThreeDS2RequestData, paymentRequest.isSetThreeDS2RequestData) && Objects.equals(this.threeDSAuthenticationOnly, paymentRequest.threeDSAuthenticationOnly) - && Objects.equals(this.trustedShopper, paymentRequest.trustedShopper); + && Objects.equals( + this.isSetThreeDSAuthenticationOnly, paymentRequest.isSetThreeDSAuthenticationOnly) + && Objects.equals(this.trustedShopper, paymentRequest.trustedShopper) + && Objects.equals(this.isSetTrustedShopper, paymentRequest.isSetTrustedShopper); } @Override public int hashCode() { return Objects.hash( accountInfo, + isSetAccountInfo, additionalAmount, + isSetAdditionalAmount, additionalData, + isSetAdditionalData, amount, + isSetAmount, applicationInfo, + isSetApplicationInfo, authenticationData, + isSetAuthenticationData, bankAccount, + isSetBankAccount, billingAddress, + isSetBillingAddress, browserInfo, + isSetBrowserInfo, captureDelayHours, + isSetCaptureDelayHours, channel, + isSetChannel, checkoutAttemptId, + isSetCheckoutAttemptId, company, + isSetCompany, conversionId, + isSetConversionId, countryCode, + isSetCountryCode, dateOfBirth, + isSetDateOfBirth, dccQuote, + isSetDccQuote, deliverAt, + isSetDeliverAt, deliveryAddress, + isSetDeliveryAddress, deliveryDate, + isSetDeliveryDate, deviceFingerprint, + isSetDeviceFingerprint, enableOneClick, + isSetEnableOneClick, enablePayOut, + isSetEnablePayOut, enableRecurring, + isSetEnableRecurring, enhancedSchemeData, + isSetEnhancedSchemeData, entityType, + isSetEntityType, fraudOffset, + isSetFraudOffset, fundOrigin, + isSetFundOrigin, fundRecipient, + isSetFundRecipient, industryUsage, + isSetIndustryUsage, installments, + isSetInstallments, lineItems, + isSetLineItems, localizedShopperStatement, + isSetLocalizedShopperStatement, mandate, + isSetMandate, mcc, + isSetMcc, merchantAccount, + isSetMerchantAccount, merchantOrderReference, + isSetMerchantOrderReference, merchantRiskIndicator, + isSetMerchantRiskIndicator, metadata, + isSetMetadata, mpiData, + isSetMpiData, order, + isSetOrder, orderReference, + isSetOrderReference, origin, + isSetOrigin, paymentMethod, + isSetPaymentMethod, paymentValidations, + isSetPaymentValidations, platformChargebackLogic, + isSetPlatformChargebackLogic, recurringExpiry, + isSetRecurringExpiry, recurringFrequency, + isSetRecurringFrequency, recurringProcessingModel, + isSetRecurringProcessingModel, redirectFromIssuerMethod, + isSetRedirectFromIssuerMethod, redirectToIssuerMethod, + isSetRedirectToIssuerMethod, reference, + isSetReference, returnUrl, + isSetReturnUrl, riskData, - sdkData, + isSetRiskData, sessionValidity, + isSetSessionValidity, shopperConversionId, + isSetShopperConversionId, shopperEmail, + isSetShopperEmail, shopperIP, + isSetShopperIP, shopperInteraction, + isSetShopperInteraction, shopperLocale, + isSetShopperLocale, shopperName, + isSetShopperName, shopperReference, + isSetShopperReference, shopperStatement, + isSetShopperStatement, socialSecurityNumber, + isSetSocialSecurityNumber, splits, + isSetSplits, store, + isSetStore, storePaymentMethod, + isSetStorePaymentMethod, subMerchants, + isSetSubMerchants, surcharge, + isSetSurcharge, telephoneNumber, + isSetTelephoneNumber, threeDS2RequestData, + isSetThreeDS2RequestData, threeDSAuthenticationOnly, - trustedShopper); + isSetThreeDSAuthenticationOnly, + trustedShopper, + isSetTrustedShopper); } @Override @@ -4073,7 +4574,6 @@ public String toString() { sb.append(" reference: ").append(toIndentedString(reference)).append("\n"); sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).append("\n"); sb.append(" riskData: ").append(toIndentedString(riskData)).append("\n"); - sb.append(" sdkData: ").append(toIndentedString(sdkData)).append("\n"); sb.append(" sessionValidity: ").append(toIndentedString(sessionValidity)).append("\n"); sb.append(" shopperConversionId: ") .append(toIndentedString(shopperConversionId)) @@ -4115,6 +4615,246 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_INFO, this.accountInfo); + } + if (isSetAdditionalAmount) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_AMOUNT, this.additionalAmount); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetAuthenticationData) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_DATA, this.authenticationData); + } + if (isSetBankAccount) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT, this.bankAccount); + } + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetBrowserInfo) { + addIfNull(nulls, JSON_PROPERTY_BROWSER_INFO, this.browserInfo); + } + if (isSetCaptureDelayHours) { + addIfNull(nulls, JSON_PROPERTY_CAPTURE_DELAY_HOURS, this.captureDelayHours); + } + if (isSetChannel) { + addIfNull(nulls, JSON_PROPERTY_CHANNEL, this.channel); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetCompany) { + addIfNull(nulls, JSON_PROPERTY_COMPANY, this.company); + } + if (isSetConversionId) { + addIfNull(nulls, JSON_PROPERTY_CONVERSION_ID, this.conversionId); + } + if (isSetCountryCode) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY_CODE, this.countryCode); + } + if (isSetDateOfBirth) { + addIfNull(nulls, JSON_PROPERTY_DATE_OF_BIRTH, this.dateOfBirth); + } + if (isSetDccQuote) { + addIfNull(nulls, JSON_PROPERTY_DCC_QUOTE, this.dccQuote); + } + if (isSetDeliverAt) { + addIfNull(nulls, JSON_PROPERTY_DELIVER_AT, this.deliverAt); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeliveryDate) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_DATE, this.deliveryDate); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetEnableOneClick) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_ONE_CLICK, this.enableOneClick); + } + if (isSetEnablePayOut) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_PAY_OUT, this.enablePayOut); + } + if (isSetEnableRecurring) { + addIfNull(nulls, JSON_PROPERTY_ENABLE_RECURRING, this.enableRecurring); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetEntityType) { + addIfNull(nulls, JSON_PROPERTY_ENTITY_TYPE, this.entityType); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetFundOrigin) { + addIfNull(nulls, JSON_PROPERTY_FUND_ORIGIN, this.fundOrigin); + } + if (isSetFundRecipient) { + addIfNull(nulls, JSON_PROPERTY_FUND_RECIPIENT, this.fundRecipient); + } + if (isSetIndustryUsage) { + addIfNull(nulls, JSON_PROPERTY_INDUSTRY_USAGE, this.industryUsage); + } + if (isSetInstallments) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS, this.installments); + } + if (isSetLineItems) { + addIfNull(nulls, JSON_PROPERTY_LINE_ITEMS, this.lineItems); + } + if (isSetLocalizedShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_LOCALIZED_SHOPPER_STATEMENT, this.localizedShopperStatement); + } + if (isSetMandate) { + addIfNull(nulls, JSON_PROPERTY_MANDATE, this.mandate); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetMerchantOrderReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ORDER_REFERENCE, this.merchantOrderReference); + } + if (isSetMerchantRiskIndicator) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_RISK_INDICATOR, this.merchantRiskIndicator); + } + if (isSetMetadata) { + addIfNull(nulls, JSON_PROPERTY_METADATA, this.metadata); + } + if (isSetMpiData) { + addIfNull(nulls, JSON_PROPERTY_MPI_DATA, this.mpiData); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetOrderReference) { + addIfNull(nulls, JSON_PROPERTY_ORDER_REFERENCE, this.orderReference); + } + if (isSetOrigin) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN, this.origin); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentValidations) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_VALIDATIONS, this.paymentValidations); + } + if (isSetPlatformChargebackLogic) { + addIfNull(nulls, JSON_PROPERTY_PLATFORM_CHARGEBACK_LOGIC, this.platformChargebackLogic); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetRedirectFromIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_FROM_ISSUER_METHOD, this.redirectFromIssuerMethod); + } + if (isSetRedirectToIssuerMethod) { + addIfNull(nulls, JSON_PROPERTY_REDIRECT_TO_ISSUER_METHOD, this.redirectToIssuerMethod); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetReturnUrl) { + addIfNull(nulls, JSON_PROPERTY_RETURN_URL, this.returnUrl); + } + if (isSetRiskData) { + addIfNull(nulls, JSON_PROPERTY_RISK_DATA, this.riskData); + } + if (isSetSessionValidity) { + addIfNull(nulls, JSON_PROPERTY_SESSION_VALIDITY, this.sessionValidity); + } + if (isSetShopperConversionId) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_CONVERSION_ID, this.shopperConversionId); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperLocale) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_LOCALE, this.shopperLocale); + } + if (isSetShopperName) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_NAME, this.shopperName); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetShopperStatement) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_STATEMENT, this.shopperStatement); + } + if (isSetSocialSecurityNumber) { + addIfNull(nulls, JSON_PROPERTY_SOCIAL_SECURITY_NUMBER, this.socialSecurityNumber); + } + if (isSetSplits) { + addIfNull(nulls, JSON_PROPERTY_SPLITS, this.splits); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetStorePaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_STORE_PAYMENT_METHOD, this.storePaymentMethod); + } + if (isSetSubMerchants) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANTS, this.subMerchants); + } + if (isSetSurcharge) { + addIfNull(nulls, JSON_PROPERTY_SURCHARGE, this.surcharge); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetThreeDS2RequestData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_REQUEST_DATA, this.threeDS2RequestData); + } + if (isSetThreeDSAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_AUTHENTICATION_ONLY, this.threeDSAuthenticationOnly); + } + if (isSetTrustedShopper) { + addIfNull(nulls, JSON_PROPERTY_TRUSTED_SHOPPER, this.trustedShopper); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentResponse.java b/src/main/java/com/adyen/model/checkout/PaymentResponse.java index 63d6ef5d6..23f9c68bc 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,39 +48,75 @@ public class PaymentResponse { public static final String JSON_PROPERTY_ACTION = "action"; private PaymentResponseAction action; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAction = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_DONATION_TOKEN = "donationToken"; private String donationToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDonationToken = false; + public static final String JSON_PROPERTY_FRAUD_RESULT = "fraudResult"; private FraudResult fraudResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResult = false; + public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_ORDER = "order"; private CheckoutOrderResponse order; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOrder = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private ResponsePaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_VALIDATIONS = "paymentValidations"; private PaymentValidationsResponse paymentValidations; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentValidations = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFUSAL_REASON = "refusalReason"; private String refusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReason = false; + public static final String JSON_PROPERTY_REFUSAL_REASON_CODE = "refusalReasonCode"; private String refusalReasonCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReasonCode = false; + /** * The result of the payment. For more information, see [Result * codes](https://docs.adyen.com/online-payments/payment-result-codes). Possible values: * @@ -175,15 +213,33 @@ public static ResultCodeEnum fromValue(String value) { public static final String JSON_PROPERTY_RESULT_CODE = "resultCode"; private ResultCodeEnum resultCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResultCode = false; + public static final String JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA = "threeDS2ResponseData"; private ThreeDS2ResponseData threeDS2ResponseData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2ResponseData = false; + public static final String JSON_PROPERTY_THREE_D_S2_RESULT = "threeDS2Result"; private ThreeDS2Result threeDS2Result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDS2Result = false; + public static final String JSON_PROPERTY_THREE_D_S_PAYMENT_DATA = "threeDSPaymentData"; private String threeDSPaymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSPaymentData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentResponse() {} /** @@ -194,6 +250,7 @@ public PaymentResponse() {} */ public PaymentResponse action(PaymentResponseAction action) { this.action = action; + isSetAction = true; // mark as set return this; } @@ -217,6 +274,7 @@ public PaymentResponseAction getAction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAction(PaymentResponseAction action) { this.action = action; + isSetAction = true; // mark as set } /** @@ -230,6 +288,7 @@ public void setAction(PaymentResponseAction action) { */ public PaymentResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -267,6 +326,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -277,6 +337,7 @@ public void setAdditionalData(Map additionalData) { */ public PaymentResponse amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -300,6 +361,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -310,6 +372,7 @@ public void setAmount(Amount amount) { */ public PaymentResponse donationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set return this; } @@ -333,6 +396,7 @@ public String getDonationToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDonationToken(String donationToken) { this.donationToken = donationToken; + isSetDonationToken = true; // mark as set } /** @@ -343,6 +407,7 @@ public void setDonationToken(String donationToken) { */ public PaymentResponse fraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set return this; } @@ -366,6 +431,7 @@ public FraudResult getFraudResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResult(FraudResult fraudResult) { this.fraudResult = fraudResult; + isSetFraudResult = true; // mark as set } /** @@ -383,6 +449,7 @@ public void setFraudResult(FraudResult fraudResult) { */ public PaymentResponse merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -420,6 +487,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -430,6 +498,7 @@ public void setMerchantReference(String merchantReference) { */ public PaymentResponse order(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set return this; } @@ -453,6 +522,7 @@ public CheckoutOrderResponse getOrder() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOrder(CheckoutOrderResponse order) { this.order = order; + isSetOrder = true; // mark as set } /** @@ -463,6 +533,7 @@ public void setOrder(CheckoutOrderResponse order) { */ public PaymentResponse paymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -486,6 +557,7 @@ public ResponsePaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -496,6 +568,7 @@ public void setPaymentMethod(ResponsePaymentMethod paymentMethod) { */ public PaymentResponse paymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set return this; } @@ -519,6 +592,7 @@ public PaymentValidationsResponse getPaymentValidations() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentValidations(PaymentValidationsResponse paymentValidations) { this.paymentValidations = paymentValidations; + isSetPaymentValidations = true; // mark as set } /** @@ -535,6 +609,7 @@ public void setPaymentValidations(PaymentValidationsResponse paymentValidations) */ public PaymentResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -570,6 +645,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -588,6 +664,7 @@ public void setPspReference(String pspReference) { */ public PaymentResponse refusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set return this; } @@ -627,6 +704,7 @@ public String getRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReason(String refusalReason) { this.refusalReason = refusalReason; + isSetRefusalReason = true; // mark as set } /** @@ -640,6 +718,7 @@ public void setRefusalReason(String refusalReason) { */ public PaymentResponse refusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set return this; } @@ -669,6 +748,7 @@ public String getRefusalReasonCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReasonCode(String refusalReasonCode) { this.refusalReasonCode = refusalReasonCode; + isSetRefusalReasonCode = true; // mark as set } /** @@ -732,6 +812,7 @@ public void setRefusalReasonCode(String refusalReasonCode) { */ public PaymentResponse resultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set return this; } @@ -861,6 +942,7 @@ public ResultCodeEnum getResultCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResultCode(ResultCodeEnum resultCode) { this.resultCode = resultCode; + isSetResultCode = true; // mark as set } /** @@ -871,6 +953,7 @@ public void setResultCode(ResultCodeEnum resultCode) { */ public PaymentResponse threeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set return this; } @@ -894,6 +977,7 @@ public ThreeDS2ResponseData getThreeDS2ResponseData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { this.threeDS2ResponseData = threeDS2ResponseData; + isSetThreeDS2ResponseData = true; // mark as set } /** @@ -904,6 +988,7 @@ public void setThreeDS2ResponseData(ThreeDS2ResponseData threeDS2ResponseData) { */ public PaymentResponse threeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set return this; } @@ -927,6 +1012,7 @@ public ThreeDS2Result getThreeDS2Result() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { this.threeDS2Result = threeDS2Result; + isSetThreeDS2Result = true; // mark as set } /** @@ -939,6 +1025,7 @@ public void setThreeDS2Result(ThreeDS2Result threeDS2Result) { */ public PaymentResponse threeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set return this; } @@ -966,6 +1053,27 @@ public String getThreeDSPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSPaymentData(String threeDSPaymentData) { this.threeDSPaymentData = threeDSPaymentData; + isSetThreeDSPaymentData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentResponse object is equal to o. */ @@ -979,42 +1087,74 @@ public boolean equals(Object o) { } PaymentResponse paymentResponse = (PaymentResponse) o; return Objects.equals(this.action, paymentResponse.action) + && Objects.equals(this.isSetAction, paymentResponse.isSetAction) && Objects.equals(this.additionalData, paymentResponse.additionalData) + && Objects.equals(this.isSetAdditionalData, paymentResponse.isSetAdditionalData) && Objects.equals(this.amount, paymentResponse.amount) + && Objects.equals(this.isSetAmount, paymentResponse.isSetAmount) && Objects.equals(this.donationToken, paymentResponse.donationToken) + && Objects.equals(this.isSetDonationToken, paymentResponse.isSetDonationToken) && Objects.equals(this.fraudResult, paymentResponse.fraudResult) + && Objects.equals(this.isSetFraudResult, paymentResponse.isSetFraudResult) && Objects.equals(this.merchantReference, paymentResponse.merchantReference) + && Objects.equals(this.isSetMerchantReference, paymentResponse.isSetMerchantReference) && Objects.equals(this.order, paymentResponse.order) + && Objects.equals(this.isSetOrder, paymentResponse.isSetOrder) && Objects.equals(this.paymentMethod, paymentResponse.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, paymentResponse.isSetPaymentMethod) && Objects.equals(this.paymentValidations, paymentResponse.paymentValidations) + && Objects.equals(this.isSetPaymentValidations, paymentResponse.isSetPaymentValidations) && Objects.equals(this.pspReference, paymentResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentResponse.isSetPspReference) && Objects.equals(this.refusalReason, paymentResponse.refusalReason) + && Objects.equals(this.isSetRefusalReason, paymentResponse.isSetRefusalReason) && Objects.equals(this.refusalReasonCode, paymentResponse.refusalReasonCode) + && Objects.equals(this.isSetRefusalReasonCode, paymentResponse.isSetRefusalReasonCode) && Objects.equals(this.resultCode, paymentResponse.resultCode) + && Objects.equals(this.isSetResultCode, paymentResponse.isSetResultCode) && Objects.equals(this.threeDS2ResponseData, paymentResponse.threeDS2ResponseData) + && Objects.equals(this.isSetThreeDS2ResponseData, paymentResponse.isSetThreeDS2ResponseData) && Objects.equals(this.threeDS2Result, paymentResponse.threeDS2Result) - && Objects.equals(this.threeDSPaymentData, paymentResponse.threeDSPaymentData); + && Objects.equals(this.isSetThreeDS2Result, paymentResponse.isSetThreeDS2Result) + && Objects.equals(this.threeDSPaymentData, paymentResponse.threeDSPaymentData) + && Objects.equals(this.isSetThreeDSPaymentData, paymentResponse.isSetThreeDSPaymentData); } @Override public int hashCode() { return Objects.hash( action, + isSetAction, additionalData, + isSetAdditionalData, amount, + isSetAmount, donationToken, + isSetDonationToken, fraudResult, + isSetFraudResult, merchantReference, + isSetMerchantReference, order, + isSetOrder, paymentMethod, + isSetPaymentMethod, paymentValidations, + isSetPaymentValidations, pspReference, + isSetPspReference, refusalReason, + isSetRefusalReason, refusalReasonCode, + isSetRefusalReasonCode, resultCode, + isSetResultCode, threeDS2ResponseData, + isSetThreeDS2ResponseData, threeDS2Result, - threeDSPaymentData); + isSetThreeDS2Result, + threeDSPaymentData, + isSetThreeDSPaymentData); } @Override @@ -1053,6 +1193,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAction) { + addIfNull(nulls, JSON_PROPERTY_ACTION, this.action); + } + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDonationToken) { + addIfNull(nulls, JSON_PROPERTY_DONATION_TOKEN, this.donationToken); + } + if (isSetFraudResult) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT, this.fraudResult); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetOrder) { + addIfNull(nulls, JSON_PROPERTY_ORDER, this.order); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentValidations) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_VALIDATIONS, this.paymentValidations); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON, this.refusalReason); + } + if (isSetRefusalReasonCode) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON_CODE, this.refusalReasonCode); + } + if (isSetResultCode) { + addIfNull(nulls, JSON_PROPERTY_RESULT_CODE, this.resultCode); + } + if (isSetThreeDS2ResponseData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESPONSE_DATA, this.threeDS2ResponseData); + } + if (isSetThreeDS2Result) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S2_RESULT, this.threeDS2Result); + } + if (isSetThreeDSPaymentData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_PAYMENT_DATA, this.threeDSPaymentData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java b/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java index 87c62b92d..573784670 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaymentReversalRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PaymentReversalRequest { public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentReversalRequest() {} /** @@ -47,6 +67,7 @@ public PaymentReversalRequest() {} */ public PaymentReversalRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -70,6 +91,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public PaymentReversalRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -103,6 +126,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public PaymentReversalRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentReversalRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentReversalRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentReversalRequest object is equal to o. */ @@ -182,14 +230,27 @@ public boolean equals(Object o) { } PaymentReversalRequest paymentReversalRequest = (PaymentReversalRequest) o; return Objects.equals(this.applicationInfo, paymentReversalRequest.applicationInfo) + && Objects.equals(this.isSetApplicationInfo, paymentReversalRequest.isSetApplicationInfo) && Objects.equals(this.enhancedSchemeData, paymentReversalRequest.enhancedSchemeData) + && Objects.equals( + this.isSetEnhancedSchemeData, paymentReversalRequest.isSetEnhancedSchemeData) && Objects.equals(this.merchantAccount, paymentReversalRequest.merchantAccount) - && Objects.equals(this.reference, paymentReversalRequest.reference); + && Objects.equals(this.isSetMerchantAccount, paymentReversalRequest.isSetMerchantAccount) + && Objects.equals(this.reference, paymentReversalRequest.reference) + && Objects.equals(this.isSetReference, paymentReversalRequest.isSetReference); } @Override public int hashCode() { - return Objects.hash(applicationInfo, enhancedSchemeData, merchantAccount, reference); + return Objects.hash( + applicationInfo, + isSetApplicationInfo, + enhancedSchemeData, + isSetEnhancedSchemeData, + merchantAccount, + isSetMerchantAccount, + reference, + isSetReference); } @Override @@ -214,6 +275,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentReversalRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java b/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java index 7fd0b3f2f..4e4f8d8a6 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentReversalResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class PaymentReversalResponse { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_PSP_REFERENCE = "paymentPspReference"; private String paymentPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentPspReference = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -84,6 +98,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentReversalResponse() {} /** @@ -94,6 +117,7 @@ public PaymentReversalResponse() {} */ public PaymentReversalResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -117,6 +141,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -131,6 +156,7 @@ public void setMerchantAccount(String merchantAccount) { */ public PaymentReversalResponse paymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set return this; } @@ -162,6 +188,7 @@ public String getPaymentPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentPspReference(String paymentPspReference) { this.paymentPspReference = paymentPspReference; + isSetPaymentPspReference = true; // mark as set } /** @@ -172,6 +199,7 @@ public void setPaymentPspReference(String paymentPspReference) { */ public PaymentReversalResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -195,6 +223,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -205,6 +234,7 @@ public void setPspReference(String pspReference) { */ public PaymentReversalResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -228,6 +258,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -238,6 +269,7 @@ public void setReference(String reference) { */ public PaymentReversalResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -261,6 +293,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentReversalResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentReversalResponse object is equal to o. */ @@ -274,15 +327,31 @@ public boolean equals(Object o) { } PaymentReversalResponse paymentReversalResponse = (PaymentReversalResponse) o; return Objects.equals(this.merchantAccount, paymentReversalResponse.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, paymentReversalResponse.isSetMerchantAccount) && Objects.equals(this.paymentPspReference, paymentReversalResponse.paymentPspReference) + && Objects.equals( + this.isSetPaymentPspReference, paymentReversalResponse.isSetPaymentPspReference) && Objects.equals(this.pspReference, paymentReversalResponse.pspReference) + && Objects.equals(this.isSetPspReference, paymentReversalResponse.isSetPspReference) && Objects.equals(this.reference, paymentReversalResponse.reference) - && Objects.equals(this.status, paymentReversalResponse.status); + && Objects.equals(this.isSetReference, paymentReversalResponse.isSetReference) + && Objects.equals(this.status, paymentReversalResponse.status) + && Objects.equals(this.isSetStatus, paymentReversalResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(merchantAccount, paymentPspReference, pspReference, reference, status); + return Objects.hash( + merchantAccount, + isSetMerchantAccount, + paymentPspReference, + isSetPaymentPspReference, + pspReference, + isSetPspReference, + reference, + isSetReference, + status, + isSetStatus); } @Override @@ -310,6 +379,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentPspReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_PSP_REFERENCE, this.paymentPspReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentReversalResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidations.java b/src/main/java/com/adyen/model/checkout/PaymentValidations.java index ce7ee85aa..c64b37ca4 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidations.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidations.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -21,7 +23,16 @@ @JsonPropertyOrder({PaymentValidations.JSON_PROPERTY_NAME}) public class PaymentValidations { public static final String JSON_PROPERTY_NAME = "name"; - private Name name; + private PaymentValidationsNameRequest name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; public PaymentValidations() {} @@ -31,8 +42,9 @@ public PaymentValidations() {} * @param name * @return the current {@code PaymentValidations} instance, allowing for method chaining */ - public PaymentValidations name(Name name) { + public PaymentValidations name(PaymentValidationsNameRequest name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -43,7 +55,7 @@ public PaymentValidations name(Name name) { */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Name getName() { + public PaymentValidationsNameRequest getName() { return name; } @@ -54,8 +66,29 @@ public Name getName() { */ @JsonProperty(JSON_PROPERTY_NAME) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(Name name) { + public void setName(PaymentValidationsNameRequest name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidations includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentValidations object is equal to o. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } PaymentValidations paymentValidations = (PaymentValidations) o; - return Objects.equals(this.name, paymentValidations.name); + return Objects.equals(this.name, paymentValidations.name) + && Objects.equals(this.isSetName, paymentValidations.isSetName); } @Override public int hashCode() { - return Objects.hash(name); + return Objects.hash(name, isSetName); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentValidations given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameRequest.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameRequest.java new file mode 100644 index 000000000..354ae1da2 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameRequest.java @@ -0,0 +1,196 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** PaymentValidationsNameRequest */ +@JsonPropertyOrder({PaymentValidationsNameRequest.JSON_PROPERTY_STATUS}) +public class PaymentValidationsNameRequest { + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public PaymentValidationsNameRequest() {} + + /** + * Set to **requested** to request a [name + * validation](https://docs.adyen.com/payment-methods/cards/name-validation) to verify if the + * cardholder name provided by the shopper matches the cardholder name on file at the issuing + * bank. + * + * @param status Set to **requested** to request a [name + * validation](https://docs.adyen.com/payment-methods/cards/name-validation) to verify if the + * cardholder name provided by the shopper matches the cardholder name on file at the issuing + * bank. + * @return the current {@code PaymentValidationsNameRequest} instance, allowing for method + * chaining + */ + public PaymentValidationsNameRequest status(String status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * Set to **requested** to request a [name + * validation](https://docs.adyen.com/payment-methods/cards/name-validation) to verify if the + * cardholder name provided by the shopper matches the cardholder name on file at the issuing + * bank. + * + * @return status Set to **requested** to request a [name + * validation](https://docs.adyen.com/payment-methods/cards/name-validation) to verify if the + * cardholder name provided by the shopper matches the cardholder name on file at the issuing + * bank. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStatus() { + return status; + } + + /** + * Set to **requested** to request a [name + * validation](https://docs.adyen.com/payment-methods/cards/name-validation) to verify if the + * cardholder name provided by the shopper matches the cardholder name on file at the issuing + * bank. + * + * @param status Set to **requested** to request a [name + * validation](https://docs.adyen.com/payment-methods/cards/name-validation) to verify if the + * cardholder name provided by the shopper matches the cardholder name on file at the issuing + * bank. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(String status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this PaymentValidationsNameRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PaymentValidationsNameRequest paymentValidationsNameRequest = (PaymentValidationsNameRequest) o; + return Objects.equals(this.status, paymentValidationsNameRequest.status) + && Objects.equals(this.isSetStatus, paymentValidationsNameRequest.isSetStatus); + } + + @Override + public int hashCode() { + return Objects.hash(status, isSetStatus); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PaymentValidationsNameRequest {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of PaymentValidationsNameRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PaymentValidationsNameRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * PaymentValidationsNameRequest + */ + public static PaymentValidationsNameRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, PaymentValidationsNameRequest.class); + } + + /** + * Convert an instance of PaymentValidationsNameRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java index 037e9a6bb..de7c44183 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class PaymentValidationsNameResponse { public static final String JSON_PROPERTY_RAW_RESPONSE = "rawResponse"; private PaymentValidationsNameResultRawResponse rawResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRawResponse = false; + public static final String JSON_PROPERTY_RESULT = "result"; private PaymentValidationsNameResultResponse result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + /** * Informs you if the name validation was performed. Possible values: **performed**, * **notPerformed**, **notSupported** @@ -83,6 +91,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentValidationsNameResponse() {} /** @@ -95,6 +112,7 @@ public PaymentValidationsNameResponse() {} public PaymentValidationsNameResponse rawResponse( PaymentValidationsNameResultRawResponse rawResponse) { this.rawResponse = rawResponse; + isSetRawResponse = true; // mark as set return this; } @@ -118,6 +136,7 @@ public PaymentValidationsNameResultRawResponse getRawResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRawResponse(PaymentValidationsNameResultRawResponse rawResponse) { this.rawResponse = rawResponse; + isSetRawResponse = true; // mark as set } /** @@ -129,6 +148,7 @@ public void setRawResponse(PaymentValidationsNameResultRawResponse rawResponse) */ public PaymentValidationsNameResponse result(PaymentValidationsNameResultResponse result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -152,6 +172,7 @@ public PaymentValidationsNameResultResponse getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(PaymentValidationsNameResultResponse result) { this.result = result; + isSetResult = true; // mark as set } /** @@ -165,6 +186,7 @@ public void setResult(PaymentValidationsNameResultResponse result) { */ public PaymentValidationsNameResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -192,6 +214,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentValidationsNameResponse object is equal to o. */ @@ -206,13 +249,16 @@ public boolean equals(Object o) { PaymentValidationsNameResponse paymentValidationsNameResponse = (PaymentValidationsNameResponse) o; return Objects.equals(this.rawResponse, paymentValidationsNameResponse.rawResponse) + && Objects.equals(this.isSetRawResponse, paymentValidationsNameResponse.isSetRawResponse) && Objects.equals(this.result, paymentValidationsNameResponse.result) - && Objects.equals(this.status, paymentValidationsNameResponse.status); + && Objects.equals(this.isSetResult, paymentValidationsNameResponse.isSetResult) + && Objects.equals(this.status, paymentValidationsNameResponse.status) + && Objects.equals(this.isSetStatus, paymentValidationsNameResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(rawResponse, result, status); + return Objects.hash(rawResponse, isSetRawResponse, result, isSetResult, status, isSetStatus); } @Override @@ -236,6 +282,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetRawResponse) { + addIfNull(nulls, JSON_PROPERTY_RAW_RESPONSE, this.rawResponse); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentValidationsNameResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java index 955066691..deeff8bf7 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultRawResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class PaymentValidationsNameResultRawResponse { public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_MIDDLE_NAME = "middleName"; private String middleName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMiddleName = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentValidationsNameResultRawResponse() {} /** @@ -54,6 +77,7 @@ public PaymentValidationsNameResultRawResponse() {} */ public PaymentValidationsNameResultRawResponse firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -94,6 +119,7 @@ public void setFirstName(String firstName) { */ public PaymentValidationsNameResultRawResponse fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -121,6 +147,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -134,6 +161,7 @@ public void setFullName(String fullName) { */ public PaymentValidationsNameResultRawResponse lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -161,6 +189,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -174,6 +203,7 @@ public void setLastName(String lastName) { */ public PaymentValidationsNameResultRawResponse middleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set return this; } @@ -201,6 +231,7 @@ public String getMiddleName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMiddleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set } /** @@ -214,6 +245,7 @@ public void setMiddleName(String middleName) { */ public PaymentValidationsNameResultRawResponse status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -241,6 +273,27 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameResultRawResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentValidationsNameResultRawResponse object is equal to o. */ @@ -255,15 +308,32 @@ public boolean equals(Object o) { PaymentValidationsNameResultRawResponse paymentValidationsNameResultRawResponse = (PaymentValidationsNameResultRawResponse) o; return Objects.equals(this.firstName, paymentValidationsNameResultRawResponse.firstName) + && Objects.equals( + this.isSetFirstName, paymentValidationsNameResultRawResponse.isSetFirstName) && Objects.equals(this.fullName, paymentValidationsNameResultRawResponse.fullName) + && Objects.equals(this.isSetFullName, paymentValidationsNameResultRawResponse.isSetFullName) && Objects.equals(this.lastName, paymentValidationsNameResultRawResponse.lastName) + && Objects.equals(this.isSetLastName, paymentValidationsNameResultRawResponse.isSetLastName) && Objects.equals(this.middleName, paymentValidationsNameResultRawResponse.middleName) - && Objects.equals(this.status, paymentValidationsNameResultRawResponse.status); + && Objects.equals( + this.isSetMiddleName, paymentValidationsNameResultRawResponse.isSetMiddleName) + && Objects.equals(this.status, paymentValidationsNameResultRawResponse.status) + && Objects.equals(this.isSetStatus, paymentValidationsNameResultRawResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(firstName, fullName, lastName, middleName, status); + return Objects.hash( + firstName, + isSetFirstName, + fullName, + isSetFullName, + lastName, + isSetLastName, + middleName, + isSetMiddleName, + status, + isSetStatus); } @Override @@ -289,6 +359,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetMiddleName) { + addIfNull(nulls, JSON_PROPERTY_MIDDLE_NAME, this.middleName); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentValidationsNameResultRawResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java index 07716be41..88a695a00 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsNameResultResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class PaymentValidationsNameResultResponse { public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_FULL_NAME = "fullName"; private String fullName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFullName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + public static final String JSON_PROPERTY_MIDDLE_NAME = "middleName"; private String middleName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMiddleName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentValidationsNameResultResponse() {} /** @@ -52,6 +72,7 @@ public PaymentValidationsNameResultResponse() {} */ public PaymentValidationsNameResultResponse firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -83,6 +104,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -98,6 +120,7 @@ public void setFirstName(String firstName) { */ public PaymentValidationsNameResultResponse fullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set return this; } @@ -129,6 +152,7 @@ public String getFullName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFullName(String fullName) { this.fullName = fullName; + isSetFullName = true; // mark as set } /** @@ -144,6 +168,7 @@ public void setFullName(String fullName) { */ public PaymentValidationsNameResultResponse lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -175,6 +200,7 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set } /** @@ -190,6 +216,7 @@ public void setLastName(String lastName) { */ public PaymentValidationsNameResultResponse middleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set return this; } @@ -221,6 +248,27 @@ public String getMiddleName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMiddleName(String middleName) { this.middleName = middleName; + isSetMiddleName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsNameResultResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentValidationsNameResultResponse object is equal to o. */ @@ -235,14 +283,27 @@ public boolean equals(Object o) { PaymentValidationsNameResultResponse paymentValidationsNameResultResponse = (PaymentValidationsNameResultResponse) o; return Objects.equals(this.firstName, paymentValidationsNameResultResponse.firstName) + && Objects.equals(this.isSetFirstName, paymentValidationsNameResultResponse.isSetFirstName) && Objects.equals(this.fullName, paymentValidationsNameResultResponse.fullName) + && Objects.equals(this.isSetFullName, paymentValidationsNameResultResponse.isSetFullName) && Objects.equals(this.lastName, paymentValidationsNameResultResponse.lastName) - && Objects.equals(this.middleName, paymentValidationsNameResultResponse.middleName); + && Objects.equals(this.isSetLastName, paymentValidationsNameResultResponse.isSetLastName) + && Objects.equals(this.middleName, paymentValidationsNameResultResponse.middleName) + && Objects.equals( + this.isSetMiddleName, paymentValidationsNameResultResponse.isSetMiddleName); } @Override public int hashCode() { - return Objects.hash(firstName, fullName, lastName, middleName); + return Objects.hash( + firstName, + isSetFirstName, + fullName, + isSetFullName, + lastName, + isSetLastName, + middleName, + isSetMiddleName); } @Override @@ -267,6 +328,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetFullName) { + addIfNull(nulls, JSON_PROPERTY_FULL_NAME, this.fullName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + if (isSetMiddleName) { + addIfNull(nulls, JSON_PROPERTY_MIDDLE_NAME, this.middleName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentValidationsNameResultResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java b/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java index dfa318034..4faa73799 100644 --- a/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaymentValidationsResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class PaymentValidationsResponse { public static final String JSON_PROPERTY_NAME = "name"; private PaymentValidationsNameResponse name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaymentValidationsResponse() {} /** @@ -33,6 +44,7 @@ public PaymentValidationsResponse() {} */ public PaymentValidationsResponse name(PaymentValidationsNameResponse name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -56,6 +68,27 @@ public PaymentValidationsNameResponse getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(PaymentValidationsNameResponse name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaymentValidationsResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaymentValidationsResponse object is equal to o. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } PaymentValidationsResponse paymentValidationsResponse = (PaymentValidationsResponse) o; - return Objects.equals(this.name, paymentValidationsResponse.name); + return Objects.equals(this.name, paymentValidationsResponse.name) + && Objects.equals(this.isSetName, paymentValidationsResponse.isSetName); } @Override public int hashCode() { - return Objects.hash(name); + return Objects.hash(name, isSetName); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaymentValidationsResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java index c3acb76c5..572e2f767 100644 --- a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java +++ b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,21 +34,45 @@ public class PaypalUpdateOrderRequest { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_DELIVERY_METHODS = "deliveryMethods"; private List deliveryMethods; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryMethods = false; + public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_SESSION_ID = "sessionId"; private String sessionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSessionId = false; + public static final String JSON_PROPERTY_TAX_TOTAL = "taxTotal"; private TaxTotal taxTotal; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxTotal = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaypalUpdateOrderRequest() {} /** @@ -57,6 +83,7 @@ public PaypalUpdateOrderRequest() {} */ public PaypalUpdateOrderRequest amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -80,6 +107,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -90,6 +118,7 @@ public void setAmount(Amount amount) { */ public PaypalUpdateOrderRequest deliveryMethods(List deliveryMethods) { this.deliveryMethods = deliveryMethods; + isSetDeliveryMethods = true; // mark as set return this; } @@ -121,6 +150,7 @@ public List getDeliveryMethods() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryMethods(List deliveryMethods) { this.deliveryMethods = deliveryMethods; + isSetDeliveryMethods = true; // mark as set } /** @@ -133,6 +163,7 @@ public void setDeliveryMethods(List deliveryMethods) { */ public PaypalUpdateOrderRequest paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -160,6 +191,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -171,6 +203,7 @@ public void setPaymentData(String paymentData) { */ public PaypalUpdateOrderRequest pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -196,6 +229,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -206,6 +240,7 @@ public void setPspReference(String pspReference) { */ public PaypalUpdateOrderRequest sessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set return this; } @@ -229,6 +264,7 @@ public String getSessionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionId(String sessionId) { this.sessionId = sessionId; + isSetSessionId = true; // mark as set } /** @@ -239,6 +275,7 @@ public void setSessionId(String sessionId) { */ public PaypalUpdateOrderRequest taxTotal(TaxTotal taxTotal) { this.taxTotal = taxTotal; + isSetTaxTotal = true; // mark as set return this; } @@ -262,6 +299,27 @@ public TaxTotal getTaxTotal() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxTotal(TaxTotal taxTotal) { this.taxTotal = taxTotal; + isSetTaxTotal = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaypalUpdateOrderRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaypalUpdateOrderRequest object is equal to o. */ @@ -275,16 +333,34 @@ public boolean equals(Object o) { } PaypalUpdateOrderRequest paypalUpdateOrderRequest = (PaypalUpdateOrderRequest) o; return Objects.equals(this.amount, paypalUpdateOrderRequest.amount) + && Objects.equals(this.isSetAmount, paypalUpdateOrderRequest.isSetAmount) && Objects.equals(this.deliveryMethods, paypalUpdateOrderRequest.deliveryMethods) + && Objects.equals(this.isSetDeliveryMethods, paypalUpdateOrderRequest.isSetDeliveryMethods) && Objects.equals(this.paymentData, paypalUpdateOrderRequest.paymentData) + && Objects.equals(this.isSetPaymentData, paypalUpdateOrderRequest.isSetPaymentData) && Objects.equals(this.pspReference, paypalUpdateOrderRequest.pspReference) + && Objects.equals(this.isSetPspReference, paypalUpdateOrderRequest.isSetPspReference) && Objects.equals(this.sessionId, paypalUpdateOrderRequest.sessionId) - && Objects.equals(this.taxTotal, paypalUpdateOrderRequest.taxTotal); + && Objects.equals(this.isSetSessionId, paypalUpdateOrderRequest.isSetSessionId) + && Objects.equals(this.taxTotal, paypalUpdateOrderRequest.taxTotal) + && Objects.equals(this.isSetTaxTotal, paypalUpdateOrderRequest.isSetTaxTotal); } @Override public int hashCode() { - return Objects.hash(amount, deliveryMethods, paymentData, pspReference, sessionId, taxTotal); + return Objects.hash( + amount, + isSetAmount, + deliveryMethods, + isSetDeliveryMethods, + paymentData, + isSetPaymentData, + pspReference, + isSetPspReference, + sessionId, + isSetSessionId, + taxTotal, + isSetTaxTotal); } @Override @@ -311,6 +387,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDeliveryMethods) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_METHODS, this.deliveryMethods); + } + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetSessionId) { + addIfNull(nulls, JSON_PROPERTY_SESSION_ID, this.sessionId); + } + if (isSetTaxTotal) { + addIfNull(nulls, JSON_PROPERTY_TAX_TOTAL, this.taxTotal); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaypalUpdateOrderRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java index e12df3805..7ca088afe 100644 --- a/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java +++ b/src/main/java/com/adyen/model/checkout/PaypalUpdateOrderResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,6 +32,9 @@ public class PaypalUpdateOrderResponse { public static final String JSON_PROPERTY_PAYMENT_DATA = "paymentData"; private String paymentData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentData = false; + /** * The status of the request. This indicates whether the order was successfully updated with * PayPal. @@ -77,6 +82,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PaypalUpdateOrderResponse() {} /** @@ -87,6 +101,7 @@ public PaypalUpdateOrderResponse() {} */ public PaypalUpdateOrderResponse paymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set return this; } @@ -110,6 +125,7 @@ public String getPaymentData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentData(String paymentData) { this.paymentData = paymentData; + isSetPaymentData = true; // mark as set } /** @@ -122,6 +138,7 @@ public void setPaymentData(String paymentData) { */ public PaypalUpdateOrderResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -149,6 +166,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PaypalUpdateOrderResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PaypalUpdateOrderResponse object is equal to o. */ @@ -162,12 +200,14 @@ public boolean equals(Object o) { } PaypalUpdateOrderResponse paypalUpdateOrderResponse = (PaypalUpdateOrderResponse) o; return Objects.equals(this.paymentData, paypalUpdateOrderResponse.paymentData) - && Objects.equals(this.status, paypalUpdateOrderResponse.status); + && Objects.equals(this.isSetPaymentData, paypalUpdateOrderResponse.isSetPaymentData) + && Objects.equals(this.status, paypalUpdateOrderResponse.status) + && Objects.equals(this.isSetStatus, paypalUpdateOrderResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(paymentData, status); + return Objects.hash(paymentData, isSetPaymentData, status, isSetStatus); } @Override @@ -190,6 +230,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetPaymentData) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_DATA, this.paymentData); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PaypalUpdateOrderResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Phone.java b/src/main/java/com/adyen/model/checkout/Phone.java index 2315e4ae3..49e6df6fd 100644 --- a/src/main/java/com/adyen/model/checkout/Phone.java +++ b/src/main/java/com/adyen/model/checkout/Phone.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class Phone { public static final String JSON_PROPERTY_CC = "cc"; private String cc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCc = false; + public static final String JSON_PROPERTY_SUBSCRIBER = "subscriber"; private String subscriber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubscriber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Phone() {} /** @@ -36,6 +50,7 @@ public Phone() {} */ public Phone cc(String cc) { this.cc = cc; + isSetCc = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getCc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCc(String cc) { this.cc = cc; + isSetCc = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setCc(String cc) { */ public Phone subscriber(String subscriber) { this.subscriber = subscriber; + isSetSubscriber = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getSubscriber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubscriber(String subscriber) { this.subscriber = subscriber; + isSetSubscriber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Phone includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Phone object is equal to o. */ @@ -104,12 +142,15 @@ public boolean equals(Object o) { return false; } Phone phone = (Phone) o; - return Objects.equals(this.cc, phone.cc) && Objects.equals(this.subscriber, phone.subscriber); + return Objects.equals(this.cc, phone.cc) + && Objects.equals(this.isSetCc, phone.isSetCc) + && Objects.equals(this.subscriber, phone.subscriber) + && Objects.equals(this.isSetSubscriber, phone.isSetSubscriber); } @Override public int hashCode() { - return Objects.hash(cc, subscriber); + return Objects.hash(cc, isSetCc, subscriber, isSetSubscriber); } @Override @@ -132,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCc) { + addIfNull(nulls, JSON_PROPERTY_CC, this.cc); + } + if (isSetSubscriber) { + addIfNull(nulls, JSON_PROPERTY_SUBSCRIBER, this.subscriber); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Phone given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PixDetails.java b/src/main/java/com/adyen/model/checkout/PixDetails.java index 553392ef7..8fa20c237 100644 --- a/src/main/java/com/adyen/model/checkout/PixDetails.java +++ b/src/main/java/com/adyen/model/checkout/PixDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class PixDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_PIX_RECURRING = "pixRecurring"; private PixRecurring pixRecurring; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPixRecurring = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** The payment method type. */ public enum TypeEnum { PIX(String.valueOf("pix")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PixDetails() {} /** @@ -99,6 +125,7 @@ public PixDetails() {} */ public PixDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +160,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PixDetails pixRecurring(PixRecurring pixRecurring) { this.pixRecurring = pixRecurring; + isSetPixRecurring = true; // mark as set return this; } @@ -155,6 +184,7 @@ public PixRecurring getPixRecurring() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPixRecurring(PixRecurring pixRecurring) { this.pixRecurring = pixRecurring; + isSetPixRecurring = true; // mark as set } /** @@ -169,6 +199,7 @@ public void setPixRecurring(PixRecurring pixRecurring) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public PixDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -200,6 +231,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -210,6 +242,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public PixDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -234,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -246,6 +280,7 @@ public void setSdkData(String sdkData) { */ public PixDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public PixDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PixDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PixDetails object is equal to o. */ @@ -319,22 +377,35 @@ public boolean equals(Object o) { } PixDetails pixDetails = (PixDetails) o; return Objects.equals(this.checkoutAttemptId, pixDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, pixDetails.isSetCheckoutAttemptId) && Objects.equals(this.pixRecurring, pixDetails.pixRecurring) + && Objects.equals(this.isSetPixRecurring, pixDetails.isSetPixRecurring) && Objects.equals(this.recurringDetailReference, pixDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, pixDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, pixDetails.sdkData) + && Objects.equals(this.isSetSdkData, pixDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, pixDetails.storedPaymentMethodId) - && Objects.equals(this.type, pixDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, pixDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, pixDetails.type) + && Objects.equals(this.isSetType, pixDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, pixRecurring, + isSetPixRecurring, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -365,6 +436,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetPixRecurring) { + addIfNull(nulls, JSON_PROPERTY_PIX_RECURRING, this.pixRecurring); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PixDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PixRecurring.java b/src/main/java/com/adyen/model/checkout/PixRecurring.java index 2c146d69e..6764b074c 100644 --- a/src/main/java/com/adyen/model/checkout/PixRecurring.java +++ b/src/main/java/com/adyen/model/checkout/PixRecurring.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -38,12 +40,21 @@ public class PixRecurring { public static final String JSON_PROPERTY_BILLING_DATE = "billingDate"; private String billingDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingDate = false; + public static final String JSON_PROPERTY_BUSINESS_DAY_ONLY = "businessDayOnly"; private Boolean businessDayOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBusinessDayOnly = false; + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; private String endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + /** The frequency at which the shopper will be charged. */ public enum FrequencyEnum { WEEKLY(String.valueOf("weekly")), @@ -94,24 +105,51 @@ public static FrequencyEnum fromValue(String value) { public static final String JSON_PROPERTY_FREQUENCY = "frequency"; private FrequencyEnum frequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFrequency = false; + public static final String JSON_PROPERTY_MIN_AMOUNT = "minAmount"; private Amount minAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMinAmount = false; + public static final String JSON_PROPERTY_ORIGINAL_PSP_REFERENCE = "originalPspReference"; private String originalPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginalPspReference = false; + public static final String JSON_PROPERTY_RECURRING_AMOUNT = "recurringAmount"; private Amount recurringAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringAmount = false; + public static final String JSON_PROPERTY_RECURRING_STATEMENT = "recurringStatement"; private String recurringStatement; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringStatement = false; + public static final String JSON_PROPERTY_RETRY_POLICY = "retryPolicy"; private Boolean retryPolicy; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRetryPolicy = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private String startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PixRecurring() {} /** @@ -123,6 +161,7 @@ public PixRecurring() {} */ public PixRecurring billingDate(String billingDate) { this.billingDate = billingDate; + isSetBillingDate = true; // mark as set return this; } @@ -148,6 +187,7 @@ public String getBillingDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDate(String billingDate) { this.billingDate = billingDate; + isSetBillingDate = true; // mark as set } /** @@ -158,6 +198,7 @@ public void setBillingDate(String billingDate) { */ public PixRecurring businessDayOnly(Boolean businessDayOnly) { this.businessDayOnly = businessDayOnly; + isSetBusinessDayOnly = true; // mark as set return this; } @@ -182,6 +223,7 @@ public Boolean getBusinessDayOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBusinessDayOnly(Boolean businessDayOnly) { this.businessDayOnly = businessDayOnly; + isSetBusinessDayOnly = true; // mark as set } /** @@ -196,6 +238,7 @@ public void setBusinessDayOnly(Boolean businessDayOnly) { */ public PixRecurring endsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -227,6 +270,7 @@ public String getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -237,6 +281,7 @@ public void setEndsAt(String endsAt) { */ public PixRecurring frequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set return this; } @@ -260,6 +305,7 @@ public FrequencyEnum getFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set } /** @@ -270,6 +316,7 @@ public void setFrequency(FrequencyEnum frequency) { */ public PixRecurring minAmount(Amount minAmount) { this.minAmount = minAmount; + isSetMinAmount = true; // mark as set return this; } @@ -293,6 +340,7 @@ public Amount getMinAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMinAmount(Amount minAmount) { this.minAmount = minAmount; + isSetMinAmount = true; // mark as set } /** @@ -305,6 +353,7 @@ public void setMinAmount(Amount minAmount) { */ public PixRecurring originalPspReference(String originalPspReference) { this.originalPspReference = originalPspReference; + isSetOriginalPspReference = true; // mark as set return this; } @@ -332,6 +381,7 @@ public String getOriginalPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginalPspReference(String originalPspReference) { this.originalPspReference = originalPspReference; + isSetOriginalPspReference = true; // mark as set } /** @@ -342,6 +392,7 @@ public void setOriginalPspReference(String originalPspReference) { */ public PixRecurring recurringAmount(Amount recurringAmount) { this.recurringAmount = recurringAmount; + isSetRecurringAmount = true; // mark as set return this; } @@ -365,6 +416,7 @@ public Amount getRecurringAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringAmount(Amount recurringAmount) { this.recurringAmount = recurringAmount; + isSetRecurringAmount = true; // mark as set } /** @@ -379,6 +431,7 @@ public void setRecurringAmount(Amount recurringAmount) { */ public PixRecurring recurringStatement(String recurringStatement) { this.recurringStatement = recurringStatement; + isSetRecurringStatement = true; // mark as set return this; } @@ -410,6 +463,7 @@ public String getRecurringStatement() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringStatement(String recurringStatement) { this.recurringStatement = recurringStatement; + isSetRecurringStatement = true; // mark as set } /** @@ -421,6 +475,7 @@ public void setRecurringStatement(String recurringStatement) { */ public PixRecurring retryPolicy(Boolean retryPolicy) { this.retryPolicy = retryPolicy; + isSetRetryPolicy = true; // mark as set return this; } @@ -446,6 +501,7 @@ public Boolean getRetryPolicy() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRetryPolicy(Boolean retryPolicy) { this.retryPolicy = retryPolicy; + isSetRetryPolicy = true; // mark as set } /** @@ -458,6 +514,7 @@ public void setRetryPolicy(Boolean retryPolicy) { */ public PixRecurring startsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -485,6 +542,27 @@ public String getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PixRecurring includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PixRecurring object is equal to o. */ @@ -498,30 +576,50 @@ public boolean equals(Object o) { } PixRecurring pixRecurring = (PixRecurring) o; return Objects.equals(this.billingDate, pixRecurring.billingDate) + && Objects.equals(this.isSetBillingDate, pixRecurring.isSetBillingDate) && Objects.equals(this.businessDayOnly, pixRecurring.businessDayOnly) + && Objects.equals(this.isSetBusinessDayOnly, pixRecurring.isSetBusinessDayOnly) && Objects.equals(this.endsAt, pixRecurring.endsAt) + && Objects.equals(this.isSetEndsAt, pixRecurring.isSetEndsAt) && Objects.equals(this.frequency, pixRecurring.frequency) + && Objects.equals(this.isSetFrequency, pixRecurring.isSetFrequency) && Objects.equals(this.minAmount, pixRecurring.minAmount) + && Objects.equals(this.isSetMinAmount, pixRecurring.isSetMinAmount) && Objects.equals(this.originalPspReference, pixRecurring.originalPspReference) + && Objects.equals(this.isSetOriginalPspReference, pixRecurring.isSetOriginalPspReference) && Objects.equals(this.recurringAmount, pixRecurring.recurringAmount) + && Objects.equals(this.isSetRecurringAmount, pixRecurring.isSetRecurringAmount) && Objects.equals(this.recurringStatement, pixRecurring.recurringStatement) + && Objects.equals(this.isSetRecurringStatement, pixRecurring.isSetRecurringStatement) && Objects.equals(this.retryPolicy, pixRecurring.retryPolicy) - && Objects.equals(this.startsAt, pixRecurring.startsAt); + && Objects.equals(this.isSetRetryPolicy, pixRecurring.isSetRetryPolicy) + && Objects.equals(this.startsAt, pixRecurring.startsAt) + && Objects.equals(this.isSetStartsAt, pixRecurring.isSetStartsAt); } @Override public int hashCode() { return Objects.hash( billingDate, + isSetBillingDate, businessDayOnly, + isSetBusinessDayOnly, endsAt, + isSetEndsAt, frequency, + isSetFrequency, minAmount, + isSetMinAmount, originalPspReference, + isSetOriginalPspReference, recurringAmount, + isSetRecurringAmount, recurringStatement, + isSetRecurringStatement, retryPolicy, - startsAt); + isSetRetryPolicy, + startsAt, + isSetStartsAt); } @Override @@ -554,6 +652,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingDate) { + addIfNull(nulls, JSON_PROPERTY_BILLING_DATE, this.billingDate); + } + if (isSetBusinessDayOnly) { + addIfNull(nulls, JSON_PROPERTY_BUSINESS_DAY_ONLY, this.businessDayOnly); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetFrequency) { + addIfNull(nulls, JSON_PROPERTY_FREQUENCY, this.frequency); + } + if (isSetMinAmount) { + addIfNull(nulls, JSON_PROPERTY_MIN_AMOUNT, this.minAmount); + } + if (isSetOriginalPspReference) { + addIfNull(nulls, JSON_PROPERTY_ORIGINAL_PSP_REFERENCE, this.originalPspReference); + } + if (isSetRecurringAmount) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_AMOUNT, this.recurringAmount); + } + if (isSetRecurringStatement) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_STATEMENT, this.recurringStatement); + } + if (isSetRetryPolicy) { + addIfNull(nulls, JSON_PROPERTY_RETRY_POLICY, this.retryPolicy); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PixRecurring given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java index e8e0f9214..66933cee4 100644 --- a/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java +++ b/src/main/java/com/adyen/model/checkout/PlatformChargebackLogic.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -77,12 +79,27 @@ public static BehaviorEnum fromValue(String value) { public static final String JSON_PROPERTY_BEHAVIOR = "behavior"; private BehaviorEnum behavior; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBehavior = false; + public static final String JSON_PROPERTY_COST_ALLOCATION_ACCOUNT = "costAllocationAccount"; private String costAllocationAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCostAllocationAccount = false; + public static final String JSON_PROPERTY_TARGET_ACCOUNT = "targetAccount"; private String targetAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTargetAccount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PlatformChargebackLogic() {} /** @@ -96,6 +113,7 @@ public PlatformChargebackLogic() {} */ public PlatformChargebackLogic behavior(BehaviorEnum behavior) { this.behavior = behavior; + isSetBehavior = true; // mark as set return this; } @@ -125,6 +143,7 @@ public BehaviorEnum getBehavior() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBehavior(BehaviorEnum behavior) { this.behavior = behavior; + isSetBehavior = true; // mark as set } /** @@ -138,6 +157,7 @@ public void setBehavior(BehaviorEnum behavior) { */ public PlatformChargebackLogic costAllocationAccount(String costAllocationAccount) { this.costAllocationAccount = costAllocationAccount; + isSetCostAllocationAccount = true; // mark as set return this; } @@ -167,6 +187,7 @@ public String getCostAllocationAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCostAllocationAccount(String costAllocationAccount) { this.costAllocationAccount = costAllocationAccount; + isSetCostAllocationAccount = true; // mark as set } /** @@ -179,6 +200,7 @@ public void setCostAllocationAccount(String costAllocationAccount) { */ public PlatformChargebackLogic targetAccount(String targetAccount) { this.targetAccount = targetAccount; + isSetTargetAccount = true; // mark as set return this; } @@ -206,6 +228,27 @@ public String getTargetAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTargetAccount(String targetAccount) { this.targetAccount = targetAccount; + isSetTargetAccount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PlatformChargebackLogic includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PlatformChargebackLogic object is equal to o. */ @@ -219,13 +262,23 @@ public boolean equals(Object o) { } PlatformChargebackLogic platformChargebackLogic = (PlatformChargebackLogic) o; return Objects.equals(this.behavior, platformChargebackLogic.behavior) + && Objects.equals(this.isSetBehavior, platformChargebackLogic.isSetBehavior) && Objects.equals(this.costAllocationAccount, platformChargebackLogic.costAllocationAccount) - && Objects.equals(this.targetAccount, platformChargebackLogic.targetAccount); + && Objects.equals( + this.isSetCostAllocationAccount, platformChargebackLogic.isSetCostAllocationAccount) + && Objects.equals(this.targetAccount, platformChargebackLogic.targetAccount) + && Objects.equals(this.isSetTargetAccount, platformChargebackLogic.isSetTargetAccount); } @Override public int hashCode() { - return Objects.hash(behavior, costAllocationAccount, targetAccount); + return Objects.hash( + behavior, + isSetBehavior, + costAllocationAccount, + isSetCostAllocationAccount, + targetAccount, + isSetTargetAccount); } @Override @@ -251,6 +304,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBehavior) { + addIfNull(nulls, JSON_PROPERTY_BEHAVIOR, this.behavior); + } + if (isSetCostAllocationAccount) { + addIfNull(nulls, JSON_PROPERTY_COST_ALLOCATION_ACCOUNT, this.costAllocationAccount); + } + if (isSetTargetAccount) { + addIfNull(nulls, JSON_PROPERTY_TARGET_ACCOUNT, this.targetAccount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PlatformChargebackLogic given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/PseDetails.java b/src/main/java/com/adyen/model/checkout/PseDetails.java index 0a00753df..effa9854a 100644 --- a/src/main/java/com/adyen/model/checkout/PseDetails.java +++ b/src/main/java/com/adyen/model/checkout/PseDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,21 +37,39 @@ public class PseDetails { public static final String JSON_PROPERTY_BANK = "bank"; private String bank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBank = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CLIENT_TYPE = "clientType"; private String clientType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClientType = false; + public static final String JSON_PROPERTY_IDENTIFICATION = "identification"; private String identification; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentification = false; + public static final String JSON_PROPERTY_IDENTIFICATION_TYPE = "identificationType"; private String identificationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIdentificationType = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** The payment method type. */ public enum TypeEnum { PSE_PAYULATAM(String.valueOf("pse_payulatam")); @@ -92,6 +112,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public PseDetails() {} /** @@ -102,6 +131,7 @@ public PseDetails() {} */ public PseDetails bank(String bank) { this.bank = bank; + isSetBank = true; // mark as set return this; } @@ -125,6 +155,7 @@ public String getBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBank(String bank) { this.bank = bank; + isSetBank = true; // mark as set } /** @@ -135,6 +166,7 @@ public void setBank(String bank) { */ public PseDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -158,6 +190,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -168,6 +201,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public PseDetails clientType(String clientType) { this.clientType = clientType; + isSetClientType = true; // mark as set return this; } @@ -191,6 +225,7 @@ public String getClientType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClientType(String clientType) { this.clientType = clientType; + isSetClientType = true; // mark as set } /** @@ -201,6 +236,7 @@ public void setClientType(String clientType) { */ public PseDetails identification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set return this; } @@ -224,6 +260,7 @@ public String getIdentification() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentification(String identification) { this.identification = identification; + isSetIdentification = true; // mark as set } /** @@ -234,6 +271,7 @@ public void setIdentification(String identification) { */ public PseDetails identificationType(String identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set return this; } @@ -257,6 +295,7 @@ public String getIdentificationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentificationType(String identificationType) { this.identificationType = identificationType; + isSetIdentificationType = true; // mark as set } /** @@ -267,6 +306,7 @@ public void setIdentificationType(String identificationType) { */ public PseDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -291,6 +331,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -301,6 +342,7 @@ public void setSdkData(String sdkData) { */ public PseDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -324,6 +366,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public PseDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this PseDetails object is equal to o. */ @@ -337,18 +400,38 @@ public boolean equals(Object o) { } PseDetails pseDetails = (PseDetails) o; return Objects.equals(this.bank, pseDetails.bank) + && Objects.equals(this.isSetBank, pseDetails.isSetBank) && Objects.equals(this.checkoutAttemptId, pseDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, pseDetails.isSetCheckoutAttemptId) && Objects.equals(this.clientType, pseDetails.clientType) + && Objects.equals(this.isSetClientType, pseDetails.isSetClientType) && Objects.equals(this.identification, pseDetails.identification) + && Objects.equals(this.isSetIdentification, pseDetails.isSetIdentification) && Objects.equals(this.identificationType, pseDetails.identificationType) + && Objects.equals(this.isSetIdentificationType, pseDetails.isSetIdentificationType) && Objects.equals(this.sdkData, pseDetails.sdkData) - && Objects.equals(this.type, pseDetails.type); + && Objects.equals(this.isSetSdkData, pseDetails.isSetSdkData) + && Objects.equals(this.type, pseDetails.type) + && Objects.equals(this.isSetType, pseDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - bank, checkoutAttemptId, clientType, identification, identificationType, sdkData, type); + bank, + isSetBank, + checkoutAttemptId, + isSetCheckoutAttemptId, + clientType, + isSetClientType, + identification, + isSetIdentification, + identificationType, + isSetIdentificationType, + sdkData, + isSetSdkData, + type, + isSetType); } @Override @@ -376,6 +459,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBank) { + addIfNull(nulls, JSON_PROPERTY_BANK, this.bank); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetClientType) { + addIfNull(nulls, JSON_PROPERTY_CLIENT_TYPE, this.clientType); + } + if (isSetIdentification) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION, this.identification); + } + if (isSetIdentificationType) { + addIfNull(nulls, JSON_PROPERTY_IDENTIFICATION_TYPE, this.identificationType); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of PseDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java b/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java index ac9e7d9cc..61ba85b15 100644 --- a/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/RakutenPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,16 +35,28 @@ public class RakutenPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **rakutenpay** */ public enum TypeEnum { RAKUTENPAY(String.valueOf("rakutenpay")); @@ -85,6 +99,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RakutenPayDetails() {} /** @@ -95,6 +118,7 @@ public RakutenPayDetails() {} */ public RakutenPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -118,6 +142,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -132,6 +157,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public RakutenPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -163,6 +189,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -173,6 +200,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RakutenPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -197,6 +225,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -209,6 +238,7 @@ public void setSdkData(String sdkData) { */ public RakutenPayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -236,6 +266,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -246,6 +277,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RakutenPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -269,6 +301,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RakutenPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RakutenPayDetails object is equal to o. */ @@ -282,16 +335,32 @@ public boolean equals(Object o) { } RakutenPayDetails rakutenPayDetails = (RakutenPayDetails) o; return Objects.equals(this.checkoutAttemptId, rakutenPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, rakutenPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, rakutenPayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, rakutenPayDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, rakutenPayDetails.sdkData) + && Objects.equals(this.isSetSdkData, rakutenPayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, rakutenPayDetails.storedPaymentMethodId) - && Objects.equals(this.type, rakutenPayDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, rakutenPayDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, rakutenPayDetails.type) + && Objects.equals(this.isSetType, rakutenPayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -321,6 +390,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RakutenPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RatepayDetails.java b/src/main/java/com/adyen/model/checkout/RatepayDetails.java index c687407fb..042127e11 100644 --- a/src/main/java/com/adyen/model/checkout/RatepayDetails.java +++ b/src/main/java/com/adyen/model/checkout/RatepayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,25 +38,46 @@ public class RatepayDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **ratepay** */ public enum TypeEnum { RATEPAY(String.valueOf("ratepay")), @@ -99,6 +122,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RatepayDetails() {} /** @@ -109,6 +141,7 @@ public RatepayDetails() {} */ public RatepayDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -132,6 +165,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -142,6 +176,7 @@ public void setBillingAddress(String billingAddress) { */ public RatepayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -165,6 +200,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -175,6 +211,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public RatepayDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -198,6 +235,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -208,6 +246,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public RatepayDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -231,6 +270,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -245,6 +285,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public RatepayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -276,6 +317,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -286,6 +328,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RatepayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -310,6 +353,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -322,6 +366,7 @@ public void setSdkData(String sdkData) { */ public RatepayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -349,6 +394,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -359,6 +405,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RatepayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -382,6 +429,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RatepayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RatepayDetails object is equal to o. */ @@ -395,26 +463,44 @@ public boolean equals(Object o) { } RatepayDetails ratepayDetails = (RatepayDetails) o; return Objects.equals(this.billingAddress, ratepayDetails.billingAddress) + && Objects.equals(this.isSetBillingAddress, ratepayDetails.isSetBillingAddress) && Objects.equals(this.checkoutAttemptId, ratepayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, ratepayDetails.isSetCheckoutAttemptId) && Objects.equals(this.deliveryAddress, ratepayDetails.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, ratepayDetails.isSetDeliveryAddress) && Objects.equals(this.personalDetails, ratepayDetails.personalDetails) + && Objects.equals(this.isSetPersonalDetails, ratepayDetails.isSetPersonalDetails) && Objects.equals(this.recurringDetailReference, ratepayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, ratepayDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, ratepayDetails.sdkData) + && Objects.equals(this.isSetSdkData, ratepayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, ratepayDetails.storedPaymentMethodId) - && Objects.equals(this.type, ratepayDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, ratepayDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, ratepayDetails.type) + && Objects.equals(this.isSetType, ratepayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingAddress, + isSetBillingAddress, checkoutAttemptId, + isSetCheckoutAttemptId, deliveryAddress, + isSetDeliveryAddress, personalDetails, + isSetPersonalDetails, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -447,6 +533,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RatepayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Recurring.java b/src/main/java/com/adyen/model/checkout/Recurring.java index efe7e27e0..3f4004a43 100644 --- a/src/main/java/com/adyen/model/checkout/Recurring.java +++ b/src/main/java/com/adyen/model/checkout/Recurring.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -94,15 +96,27 @@ public static ContractEnum fromValue(String value) { public static final String JSON_PROPERTY_CONTRACT = "contract"; private ContractEnum contract; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetContract = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_NAME = "recurringDetailName"; private String recurringDetailName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailName = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private OffsetDateTime recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + /** The name of the token service. */ public enum TokenServiceEnum { VISATOKENSERVICE(String.valueOf("VISATOKENSERVICE")), @@ -151,6 +165,15 @@ public static TokenServiceEnum fromValue(String value) { public static final String JSON_PROPERTY_TOKEN_SERVICE = "tokenService"; private TokenServiceEnum tokenService; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenService = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Recurring() {} /** @@ -183,6 +206,7 @@ public Recurring() {} */ public Recurring contract(ContractEnum contract) { this.contract = contract; + isSetContract = true; // mark as set return this; } @@ -250,6 +274,7 @@ public ContractEnum getContract() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContract(ContractEnum contract) { this.contract = contract; + isSetContract = true; // mark as set } /** @@ -260,6 +285,7 @@ public void setContract(ContractEnum contract) { */ public Recurring recurringDetailName(String recurringDetailName) { this.recurringDetailName = recurringDetailName; + isSetRecurringDetailName = true; // mark as set return this; } @@ -283,6 +309,7 @@ public String getRecurringDetailName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailName(String recurringDetailName) { this.recurringDetailName = recurringDetailName; + isSetRecurringDetailName = true; // mark as set } /** @@ -294,6 +321,7 @@ public void setRecurringDetailName(String recurringDetailName) { */ public Recurring recurringExpiry(OffsetDateTime recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -319,6 +347,7 @@ public OffsetDateTime getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(OffsetDateTime recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -329,6 +358,7 @@ public void setRecurringExpiry(OffsetDateTime recurringExpiry) { */ public Recurring recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -352,6 +382,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -362,6 +393,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public Recurring tokenService(TokenServiceEnum tokenService) { this.tokenService = tokenService; + isSetTokenService = true; // mark as set return this; } @@ -385,6 +417,27 @@ public TokenServiceEnum getTokenService() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenService(TokenServiceEnum tokenService) { this.tokenService = tokenService; + isSetTokenService = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Recurring includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Recurring object is equal to o. */ @@ -398,16 +451,30 @@ public boolean equals(Object o) { } Recurring recurring = (Recurring) o; return Objects.equals(this.contract, recurring.contract) + && Objects.equals(this.isSetContract, recurring.isSetContract) && Objects.equals(this.recurringDetailName, recurring.recurringDetailName) + && Objects.equals(this.isSetRecurringDetailName, recurring.isSetRecurringDetailName) && Objects.equals(this.recurringExpiry, recurring.recurringExpiry) + && Objects.equals(this.isSetRecurringExpiry, recurring.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, recurring.recurringFrequency) - && Objects.equals(this.tokenService, recurring.tokenService); + && Objects.equals(this.isSetRecurringFrequency, recurring.isSetRecurringFrequency) + && Objects.equals(this.tokenService, recurring.tokenService) + && Objects.equals(this.isSetTokenService, recurring.isSetTokenService); } @Override public int hashCode() { return Objects.hash( - contract, recurringDetailName, recurringExpiry, recurringFrequency, tokenService); + contract, + isSetContract, + recurringDetailName, + isSetRecurringDetailName, + recurringExpiry, + isSetRecurringExpiry, + recurringFrequency, + isSetRecurringFrequency, + tokenService, + isSetTokenService); } @Override @@ -435,6 +502,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetContract) { + addIfNull(nulls, JSON_PROPERTY_CONTRACT, this.contract); + } + if (isSetRecurringDetailName) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_NAME, this.recurringDetailName); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetTokenService) { + addIfNull(nulls, JSON_PROPERTY_TOKEN_SERVICE, this.tokenService); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Recurring given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java index 3628a97e7..62aeaddef 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalData3DSecure.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class ResponseAdditionalData3DSecure { public static final String JSON_PROPERTY_CARD_HOLDER_INFO = "cardHolderInfo"; private String cardHolderInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolderInfo = false; + public static final String JSON_PROPERTY_CAVV = "cavv"; private String cavv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavv = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + public static final String JSON_PROPERTY_SCA_EXEMPTION_REQUESTED = "scaExemptionRequested"; private String scaExemptionRequested; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetScaExemptionRequested = false; + public static final String JSON_PROPERTY_THREEDS2_CARD_ENROLLED = "threeds2.cardEnrolled"; private Boolean threeds2CardEnrolled; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeds2CardEnrolled = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalData3DSecure() {} /** @@ -54,6 +77,7 @@ public ResponseAdditionalData3DSecure() {} */ public ResponseAdditionalData3DSecure cardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set return this; } @@ -81,6 +105,7 @@ public String getCardHolderInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set } /** @@ -94,6 +119,7 @@ public void setCardHolderInfo(String cardHolderInfo) { */ public ResponseAdditionalData3DSecure cavv(String cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set return this; } @@ -121,6 +147,7 @@ public String getCavv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavv(String cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set } /** @@ -132,6 +159,7 @@ public void setCavv(String cavv) { */ public ResponseAdditionalData3DSecure cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -155,6 +183,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -172,6 +201,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ResponseAdditionalData3DSecure scaExemptionRequested(String scaExemptionRequested) { this.scaExemptionRequested = scaExemptionRequested; + isSetScaExemptionRequested = true; // mark as set return this; } @@ -207,6 +237,7 @@ public String getScaExemptionRequested() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScaExemptionRequested(String scaExemptionRequested) { this.scaExemptionRequested = scaExemptionRequested; + isSetScaExemptionRequested = true; // mark as set } /** @@ -218,6 +249,7 @@ public void setScaExemptionRequested(String scaExemptionRequested) { */ public ResponseAdditionalData3DSecure threeds2CardEnrolled(Boolean threeds2CardEnrolled) { this.threeds2CardEnrolled = threeds2CardEnrolled; + isSetThreeds2CardEnrolled = true; // mark as set return this; } @@ -241,6 +273,27 @@ public Boolean getThreeds2CardEnrolled() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeds2CardEnrolled(Boolean threeds2CardEnrolled) { this.threeds2CardEnrolled = threeds2CardEnrolled; + isSetThreeds2CardEnrolled = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalData3DSecure includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalData3DSecure object is equal to o. */ @@ -255,18 +308,38 @@ public boolean equals(Object o) { ResponseAdditionalData3DSecure responseAdditionalData3DSecure = (ResponseAdditionalData3DSecure) o; return Objects.equals(this.cardHolderInfo, responseAdditionalData3DSecure.cardHolderInfo) + && Objects.equals( + this.isSetCardHolderInfo, responseAdditionalData3DSecure.isSetCardHolderInfo) && Objects.equals(this.cavv, responseAdditionalData3DSecure.cavv) + && Objects.equals(this.isSetCavv, responseAdditionalData3DSecure.isSetCavv) && Objects.equals(this.cavvAlgorithm, responseAdditionalData3DSecure.cavvAlgorithm) + && Objects.equals( + this.isSetCavvAlgorithm, responseAdditionalData3DSecure.isSetCavvAlgorithm) && Objects.equals( this.scaExemptionRequested, responseAdditionalData3DSecure.scaExemptionRequested) && Objects.equals( - this.threeds2CardEnrolled, responseAdditionalData3DSecure.threeds2CardEnrolled); + this.isSetScaExemptionRequested, + responseAdditionalData3DSecure.isSetScaExemptionRequested) + && Objects.equals( + this.threeds2CardEnrolled, responseAdditionalData3DSecure.threeds2CardEnrolled) + && Objects.equals( + this.isSetThreeds2CardEnrolled, + responseAdditionalData3DSecure.isSetThreeds2CardEnrolled); } @Override public int hashCode() { return Objects.hash( - cardHolderInfo, cavv, cavvAlgorithm, scaExemptionRequested, threeds2CardEnrolled); + cardHolderInfo, + isSetCardHolderInfo, + cavv, + isSetCavv, + cavvAlgorithm, + isSetCavvAlgorithm, + scaExemptionRequested, + isSetScaExemptionRequested, + threeds2CardEnrolled, + isSetThreeds2CardEnrolled); } @Override @@ -296,6 +369,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardHolderInfo) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER_INFO, this.cardHolderInfo); + } + if (isSetCavv) { + addIfNull(nulls, JSON_PROPERTY_CAVV, this.cavv); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetScaExemptionRequested) { + addIfNull(nulls, JSON_PROPERTY_SCA_EXEMPTION_REQUESTED, this.scaExemptionRequested); + } + if (isSetThreeds2CardEnrolled) { + addIfNull(nulls, JSON_PROPERTY_THREEDS2_CARD_ENROLLED, this.threeds2CardEnrolled); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalData3DSecure given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java index 74a83e4a7..ac6e4026e 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataBillingAddress.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,24 +32,48 @@ public class ResponseAdditionalDataBillingAddress { public static final String JSON_PROPERTY_BILLING_ADDRESS_CITY = "billingAddress.city"; private String billingAddressCity; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressCity = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_COUNTRY = "billingAddress.country"; private String billingAddressCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressCountry = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_HOUSE_NUMBER_OR_NAME = "billingAddress.houseNumberOrName"; private String billingAddressHouseNumberOrName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressHouseNumberOrName = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_POSTAL_CODE = "billingAddress.postalCode"; private String billingAddressPostalCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressPostalCode = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_STATE_OR_PROVINCE = "billingAddress.stateOrProvince"; private String billingAddressStateOrProvince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressStateOrProvince = false; + public static final String JSON_PROPERTY_BILLING_ADDRESS_STREET = "billingAddress.street"; private String billingAddressStreet; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddressStreet = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataBillingAddress() {} /** @@ -59,6 +85,7 @@ public ResponseAdditionalDataBillingAddress() {} */ public ResponseAdditionalDataBillingAddress billingAddressCity(String billingAddressCity) { this.billingAddressCity = billingAddressCity; + isSetBillingAddressCity = true; // mark as set return this; } @@ -82,6 +109,7 @@ public String getBillingAddressCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressCity(String billingAddressCity) { this.billingAddressCity = billingAddressCity; + isSetBillingAddressCity = true; // mark as set } /** @@ -94,6 +122,7 @@ public void setBillingAddressCity(String billingAddressCity) { */ public ResponseAdditionalDataBillingAddress billingAddressCountry(String billingAddressCountry) { this.billingAddressCountry = billingAddressCountry; + isSetBillingAddressCountry = true; // mark as set return this; } @@ -119,6 +148,7 @@ public String getBillingAddressCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressCountry(String billingAddressCountry) { this.billingAddressCountry = billingAddressCountry; + isSetBillingAddressCountry = true; // mark as set } /** @@ -132,6 +162,7 @@ public void setBillingAddressCountry(String billingAddressCountry) { public ResponseAdditionalDataBillingAddress billingAddressHouseNumberOrName( String billingAddressHouseNumberOrName) { this.billingAddressHouseNumberOrName = billingAddressHouseNumberOrName; + isSetBillingAddressHouseNumberOrName = true; // mark as set return this; } @@ -157,6 +188,7 @@ public String getBillingAddressHouseNumberOrName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressHouseNumberOrName(String billingAddressHouseNumberOrName) { this.billingAddressHouseNumberOrName = billingAddressHouseNumberOrName; + isSetBillingAddressHouseNumberOrName = true; // mark as set } /** @@ -170,6 +202,7 @@ public void setBillingAddressHouseNumberOrName(String billingAddressHouseNumberO public ResponseAdditionalDataBillingAddress billingAddressPostalCode( String billingAddressPostalCode) { this.billingAddressPostalCode = billingAddressPostalCode; + isSetBillingAddressPostalCode = true; // mark as set return this; } @@ -195,6 +228,7 @@ public String getBillingAddressPostalCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressPostalCode(String billingAddressPostalCode) { this.billingAddressPostalCode = billingAddressPostalCode; + isSetBillingAddressPostalCode = true; // mark as set } /** @@ -208,6 +242,7 @@ public void setBillingAddressPostalCode(String billingAddressPostalCode) { public ResponseAdditionalDataBillingAddress billingAddressStateOrProvince( String billingAddressStateOrProvince) { this.billingAddressStateOrProvince = billingAddressStateOrProvince; + isSetBillingAddressStateOrProvince = true; // mark as set return this; } @@ -233,6 +268,7 @@ public String getBillingAddressStateOrProvince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressStateOrProvince(String billingAddressStateOrProvince) { this.billingAddressStateOrProvince = billingAddressStateOrProvince; + isSetBillingAddressStateOrProvince = true; // mark as set } /** @@ -244,6 +280,7 @@ public void setBillingAddressStateOrProvince(String billingAddressStateOrProvinc */ public ResponseAdditionalDataBillingAddress billingAddressStreet(String billingAddressStreet) { this.billingAddressStreet = billingAddressStreet; + isSetBillingAddressStreet = true; // mark as set return this; } @@ -267,6 +304,27 @@ public String getBillingAddressStreet() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddressStreet(String billingAddressStreet) { this.billingAddressStreet = billingAddressStreet; + isSetBillingAddressStreet = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataBillingAddress includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataBillingAddress object is equal to o. */ @@ -282,30 +340,54 @@ public boolean equals(Object o) { (ResponseAdditionalDataBillingAddress) o; return Objects.equals( this.billingAddressCity, responseAdditionalDataBillingAddress.billingAddressCity) + && Objects.equals( + this.isSetBillingAddressCity, + responseAdditionalDataBillingAddress.isSetBillingAddressCity) && Objects.equals( this.billingAddressCountry, responseAdditionalDataBillingAddress.billingAddressCountry) + && Objects.equals( + this.isSetBillingAddressCountry, + responseAdditionalDataBillingAddress.isSetBillingAddressCountry) && Objects.equals( this.billingAddressHouseNumberOrName, responseAdditionalDataBillingAddress.billingAddressHouseNumberOrName) + && Objects.equals( + this.isSetBillingAddressHouseNumberOrName, + responseAdditionalDataBillingAddress.isSetBillingAddressHouseNumberOrName) && Objects.equals( this.billingAddressPostalCode, responseAdditionalDataBillingAddress.billingAddressPostalCode) + && Objects.equals( + this.isSetBillingAddressPostalCode, + responseAdditionalDataBillingAddress.isSetBillingAddressPostalCode) && Objects.equals( this.billingAddressStateOrProvince, responseAdditionalDataBillingAddress.billingAddressStateOrProvince) && Objects.equals( - this.billingAddressStreet, responseAdditionalDataBillingAddress.billingAddressStreet); + this.isSetBillingAddressStateOrProvince, + responseAdditionalDataBillingAddress.isSetBillingAddressStateOrProvince) + && Objects.equals( + this.billingAddressStreet, responseAdditionalDataBillingAddress.billingAddressStreet) + && Objects.equals( + this.isSetBillingAddressStreet, + responseAdditionalDataBillingAddress.isSetBillingAddressStreet); } @Override public int hashCode() { return Objects.hash( billingAddressCity, + isSetBillingAddressCity, billingAddressCountry, + isSetBillingAddressCountry, billingAddressHouseNumberOrName, + isSetBillingAddressHouseNumberOrName, billingAddressPostalCode, + isSetBillingAddressPostalCode, billingAddressStateOrProvince, - billingAddressStreet); + isSetBillingAddressStateOrProvince, + billingAddressStreet, + isSetBillingAddressStreet); } @Override @@ -342,6 +424,51 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddressCity) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_CITY, this.billingAddressCity); + } + if (isSetBillingAddressCountry) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_COUNTRY, this.billingAddressCountry); + } + if (isSetBillingAddressHouseNumberOrName) { + addIfNull( + nulls, + JSON_PROPERTY_BILLING_ADDRESS_HOUSE_NUMBER_OR_NAME, + this.billingAddressHouseNumberOrName); + } + if (isSetBillingAddressPostalCode) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_POSTAL_CODE, this.billingAddressPostalCode); + } + if (isSetBillingAddressStateOrProvince) { + addIfNull( + nulls, + JSON_PROPERTY_BILLING_ADDRESS_STATE_OR_PROVINCE, + this.billingAddressStateOrProvince); + } + if (isSetBillingAddressStreet) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS_STREET, this.billingAddressStreet); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataBillingAddress given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java index 7621dafc0..fcf78d2ac 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCard.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,21 +39,39 @@ public class ResponseAdditionalDataCard { public static final String JSON_PROPERTY_CARD_BIN = "cardBin"; private String cardBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardBin = false; + public static final String JSON_PROPERTY_CARD_HOLDER_NAME = "cardHolderName"; private String cardHolderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolderName = false; + public static final String JSON_PROPERTY_CARD_ISSUING_BANK = "cardIssuingBank"; private String cardIssuingBank; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIssuingBank = false; + public static final String JSON_PROPERTY_CARD_ISSUING_COUNTRY = "cardIssuingCountry"; private String cardIssuingCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIssuingCountry = false; + public static final String JSON_PROPERTY_CARD_ISSUING_CURRENCY = "cardIssuingCurrency"; private String cardIssuingCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardIssuingCurrency = false; + public static final String JSON_PROPERTY_CARD_PAYMENT_METHOD = "cardPaymentMethod"; private String cardPaymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardPaymentMethod = false; + /** * The Card Product ID represents the type of card following card scheme product definitions and * can be returned for Adyen Acquiring service level payments. Possible values Visa: * **A** - @@ -122,12 +142,27 @@ public static CardProductIdEnum fromValue(String value) { public static final String JSON_PROPERTY_CARD_PRODUCT_ID = "cardProductId"; private CardProductIdEnum cardProductId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardProductId = false; + public static final String JSON_PROPERTY_CARD_SUMMARY = "cardSummary"; private String cardSummary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardSummary = false; + public static final String JSON_PROPERTY_ISSUER_BIN = "issuerBin"; private String issuerBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerBin = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataCard() {} /** @@ -142,6 +177,7 @@ public ResponseAdditionalDataCard() {} */ public ResponseAdditionalDataCard cardBin(String cardBin) { this.cardBin = cardBin; + isSetCardBin = true; // mark as set return this; } @@ -174,6 +210,7 @@ public String getCardBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardBin(String cardBin) { this.cardBin = cardBin; + isSetCardBin = true; // mark as set } /** @@ -184,6 +221,7 @@ public void setCardBin(String cardBin) { */ public ResponseAdditionalDataCard cardHolderName(String cardHolderName) { this.cardHolderName = cardHolderName; + isSetCardHolderName = true; // mark as set return this; } @@ -207,6 +245,7 @@ public String getCardHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolderName(String cardHolderName) { this.cardHolderName = cardHolderName; + isSetCardHolderName = true; // mark as set } /** @@ -219,6 +258,7 @@ public void setCardHolderName(String cardHolderName) { */ public ResponseAdditionalDataCard cardIssuingBank(String cardIssuingBank) { this.cardIssuingBank = cardIssuingBank; + isSetCardIssuingBank = true; // mark as set return this; } @@ -246,6 +286,7 @@ public String getCardIssuingBank() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIssuingBank(String cardIssuingBank) { this.cardIssuingBank = cardIssuingBank; + isSetCardIssuingBank = true; // mark as set } /** @@ -256,6 +297,7 @@ public void setCardIssuingBank(String cardIssuingBank) { */ public ResponseAdditionalDataCard cardIssuingCountry(String cardIssuingCountry) { this.cardIssuingCountry = cardIssuingCountry; + isSetCardIssuingCountry = true; // mark as set return this; } @@ -279,6 +321,7 @@ public String getCardIssuingCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIssuingCountry(String cardIssuingCountry) { this.cardIssuingCountry = cardIssuingCountry; + isSetCardIssuingCountry = true; // mark as set } /** @@ -292,6 +335,7 @@ public void setCardIssuingCountry(String cardIssuingCountry) { */ public ResponseAdditionalDataCard cardIssuingCurrency(String cardIssuingCurrency) { this.cardIssuingCurrency = cardIssuingCurrency; + isSetCardIssuingCurrency = true; // mark as set return this; } @@ -321,6 +365,7 @@ public String getCardIssuingCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardIssuingCurrency(String cardIssuingCurrency) { this.cardIssuingCurrency = cardIssuingCurrency; + isSetCardIssuingCurrency = true; // mark as set } /** @@ -331,6 +376,7 @@ public void setCardIssuingCurrency(String cardIssuingCurrency) { */ public ResponseAdditionalDataCard cardPaymentMethod(String cardPaymentMethod) { this.cardPaymentMethod = cardPaymentMethod; + isSetCardPaymentMethod = true; // mark as set return this; } @@ -354,6 +400,7 @@ public String getCardPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardPaymentMethod(String cardPaymentMethod) { this.cardPaymentMethod = cardPaymentMethod; + isSetCardPaymentMethod = true; // mark as set } /** @@ -376,6 +423,7 @@ public void setCardPaymentMethod(String cardPaymentMethod) { */ public ResponseAdditionalDataCard cardProductId(CardProductIdEnum cardProductId) { this.cardProductId = cardProductId; + isSetCardProductId = true; // mark as set return this; } @@ -423,6 +471,7 @@ public CardProductIdEnum getCardProductId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardProductId(CardProductIdEnum cardProductId) { this.cardProductId = cardProductId; + isSetCardProductId = true; // mark as set } /** @@ -434,6 +483,7 @@ public void setCardProductId(CardProductIdEnum cardProductId) { */ public ResponseAdditionalDataCard cardSummary(String cardSummary) { this.cardSummary = cardSummary; + isSetCardSummary = true; // mark as set return this; } @@ -459,6 +509,7 @@ public String getCardSummary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardSummary(String cardSummary) { this.cardSummary = cardSummary; + isSetCardSummary = true; // mark as set } /** @@ -475,6 +526,7 @@ public void setCardSummary(String cardSummary) { */ public ResponseAdditionalDataCard issuerBin(String issuerBin) { this.issuerBin = issuerBin; + isSetIssuerBin = true; // mark as set return this; } @@ -510,6 +562,27 @@ public String getIssuerBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerBin(String issuerBin) { this.issuerBin = issuerBin; + isSetIssuerBin = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataCard includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataCard object is equal to o. */ @@ -523,28 +596,50 @@ public boolean equals(Object o) { } ResponseAdditionalDataCard responseAdditionalDataCard = (ResponseAdditionalDataCard) o; return Objects.equals(this.cardBin, responseAdditionalDataCard.cardBin) + && Objects.equals(this.isSetCardBin, responseAdditionalDataCard.isSetCardBin) && Objects.equals(this.cardHolderName, responseAdditionalDataCard.cardHolderName) + && Objects.equals(this.isSetCardHolderName, responseAdditionalDataCard.isSetCardHolderName) && Objects.equals(this.cardIssuingBank, responseAdditionalDataCard.cardIssuingBank) + && Objects.equals( + this.isSetCardIssuingBank, responseAdditionalDataCard.isSetCardIssuingBank) && Objects.equals(this.cardIssuingCountry, responseAdditionalDataCard.cardIssuingCountry) + && Objects.equals( + this.isSetCardIssuingCountry, responseAdditionalDataCard.isSetCardIssuingCountry) && Objects.equals(this.cardIssuingCurrency, responseAdditionalDataCard.cardIssuingCurrency) + && Objects.equals( + this.isSetCardIssuingCurrency, responseAdditionalDataCard.isSetCardIssuingCurrency) && Objects.equals(this.cardPaymentMethod, responseAdditionalDataCard.cardPaymentMethod) + && Objects.equals( + this.isSetCardPaymentMethod, responseAdditionalDataCard.isSetCardPaymentMethod) && Objects.equals(this.cardProductId, responseAdditionalDataCard.cardProductId) + && Objects.equals(this.isSetCardProductId, responseAdditionalDataCard.isSetCardProductId) && Objects.equals(this.cardSummary, responseAdditionalDataCard.cardSummary) - && Objects.equals(this.issuerBin, responseAdditionalDataCard.issuerBin); + && Objects.equals(this.isSetCardSummary, responseAdditionalDataCard.isSetCardSummary) + && Objects.equals(this.issuerBin, responseAdditionalDataCard.issuerBin) + && Objects.equals(this.isSetIssuerBin, responseAdditionalDataCard.isSetIssuerBin); } @Override public int hashCode() { return Objects.hash( cardBin, + isSetCardBin, cardHolderName, + isSetCardHolderName, cardIssuingBank, + isSetCardIssuingBank, cardIssuingCountry, + isSetCardIssuingCountry, cardIssuingCurrency, + isSetCardIssuingCurrency, cardPaymentMethod, + isSetCardPaymentMethod, cardProductId, + isSetCardProductId, cardSummary, - issuerBin); + isSetCardSummary, + issuerBin, + isSetIssuerBin); } @Override @@ -576,6 +671,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCardBin) { + addIfNull(nulls, JSON_PROPERTY_CARD_BIN, this.cardBin); + } + if (isSetCardHolderName) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER_NAME, this.cardHolderName); + } + if (isSetCardIssuingBank) { + addIfNull(nulls, JSON_PROPERTY_CARD_ISSUING_BANK, this.cardIssuingBank); + } + if (isSetCardIssuingCountry) { + addIfNull(nulls, JSON_PROPERTY_CARD_ISSUING_COUNTRY, this.cardIssuingCountry); + } + if (isSetCardIssuingCurrency) { + addIfNull(nulls, JSON_PROPERTY_CARD_ISSUING_CURRENCY, this.cardIssuingCurrency); + } + if (isSetCardPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_CARD_PAYMENT_METHOD, this.cardPaymentMethod); + } + if (isSetCardProductId) { + addIfNull(nulls, JSON_PROPERTY_CARD_PRODUCT_ID, this.cardProductId); + } + if (isSetCardSummary) { + addIfNull(nulls, JSON_PROPERTY_CARD_SUMMARY, this.cardSummary); + } + if (isSetIssuerBin) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_BIN, this.issuerBin); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataCard given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java index e12e257d2..235d56e19 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataCommon.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -91,75 +93,143 @@ public class ResponseAdditionalDataCommon { public static final String JSON_PROPERTY_ACQUIRER_ACCOUNT_CODE = "acquirerAccountCode"; private String acquirerAccountCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerAccountCode = false; + public static final String JSON_PROPERTY_ACQUIRER_CODE = "acquirerCode"; private String acquirerCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerCode = false; + public static final String JSON_PROPERTY_ACQUIRER_REFERENCE = "acquirerReference"; private String acquirerReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerReference = false; + public static final String JSON_PROPERTY_ALIAS = "alias"; private String alias; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAlias = false; + public static final String JSON_PROPERTY_ALIAS_TYPE = "aliasType"; private String aliasType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAliasType = false; + public static final String JSON_PROPERTY_AUTH_CODE = "authCode"; private String authCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthCode = false; + public static final String JSON_PROPERTY_AUTHORISATION_MID = "authorisationMid"; private String authorisationMid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisationMid = false; + public static final String JSON_PROPERTY_AUTHORISED_AMOUNT_CURRENCY = "authorisedAmountCurrency"; private String authorisedAmountCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisedAmountCurrency = false; + public static final String JSON_PROPERTY_AUTHORISED_AMOUNT_VALUE = "authorisedAmountValue"; private String authorisedAmountValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthorisedAmountValue = false; + public static final String JSON_PROPERTY_AVS_RESULT = "avsResult"; private String avsResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvsResult = false; + public static final String JSON_PROPERTY_AVS_RESULT_RAW = "avsResultRaw"; private String avsResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAvsResultRaw = false; + public static final String JSON_PROPERTY_BIC = "bic"; private String bic; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBic = false; + public static final String JSON_PROPERTY_CO_BRANDED_WITH = "coBrandedWith"; private String coBrandedWith; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCoBrandedWith = false; + public static final String JSON_PROPERTY_CVC_RESULT = "cvcResult"; private String cvcResult; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvcResult = false; + public static final String JSON_PROPERTY_CVC_RESULT_RAW = "cvcResultRaw"; private String cvcResultRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvcResultRaw = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + public static final String JSON_PROPERTY_EXPIRY_DATE = "expiryDate"; private String expiryDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryDate = false; + public static final String JSON_PROPERTY_EXTRA_COSTS_CURRENCY = "extraCostsCurrency"; private String extraCostsCurrency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExtraCostsCurrency = false; + public static final String JSON_PROPERTY_EXTRA_COSTS_VALUE = "extraCostsValue"; private String extraCostsValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExtraCostsValue = false; + public static final String JSON_PROPERTY_FRAUD_CHECK_ITEM_NR_FRAUD_CHECKNAME = "fraudCheck-[itemNr]-[FraudCheckname]"; private String fraudCheckItemNrFraudCheckname; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudCheckItemNrFraudCheckname = false; + public static final String JSON_PROPERTY_FRAUD_MANUAL_REVIEW = "fraudManualReview"; private String fraudManualReview; - /** The fraud result properties of the payment. */ + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudManualReview = false; + + /** The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED */ public enum FraudResultTypeEnum { + AMBER(String.valueOf("AMBER")), + GREEN(String.valueOf("GREEN")), - FRAUD(String.valueOf("FRAUD")); + RED(String.valueOf("RED")); private static final Logger LOG = Logger.getLogger(FraudResultTypeEnum.class.getName()); @@ -199,11 +269,14 @@ public static FraudResultTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_FRAUD_RESULT_TYPE = "fraudResultType"; private FraudResultTypeEnum fraudResultType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudResultType = false; + /** * The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in a - * fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh + * fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh */ public enum FraudRiskLevelEnum { VERYLOW(String.valueOf("veryLow")), @@ -254,77 +327,143 @@ public static FraudRiskLevelEnum fromValue(String value) { public static final String JSON_PROPERTY_FRAUD_RISK_LEVEL = "fraudRiskLevel"; private FraudRiskLevelEnum fraudRiskLevel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudRiskLevel = false; + public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private String fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_FUNDS_AVAILABILITY = "fundsAvailability"; private String fundsAvailability; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundsAvailability = false; + public static final String JSON_PROPERTY_INFERRED_REFUSAL_REASON = "inferredRefusalReason"; private String inferredRefusalReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInferredRefusalReason = false; + public static final String JSON_PROPERTY_IS_CARD_COMMERCIAL = "isCardCommercial"; private String isCardCommercial; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIsCardCommercial = false; + public static final String JSON_PROPERTY_ISSUER_COUNTRY = "issuerCountry"; private String issuerCountry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerCountry = false; + public static final String JSON_PROPERTY_LIABILITY_SHIFT = "liabilityShift"; private String liabilityShift; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLiabilityShift = false; + public static final String JSON_PROPERTY_MC_BANK_NET_REFERENCE_NUMBER = "mcBankNetReferenceNumber"; private String mcBankNetReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcBankNetReferenceNumber = false; + public static final String JSON_PROPERTY_MERCHANT_ADVICE_CODE = "merchantAdviceCode"; private String merchantAdviceCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAdviceCode = false; + public static final String JSON_PROPERTY_MERCHANT_REFERENCE = "merchantReference"; private String merchantReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantReference = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE = "networkTxReference"; private String networkTxReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_PAYMENT_ACCOUNT_REFERENCE = "paymentAccountReference"; private String paymentAccountReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAccountReference = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private String paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD_VARIANT = "paymentMethodVariant"; private String paymentMethodVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethodVariant = false; + public static final String JSON_PROPERTY_PAYOUT_ELIGIBLE = "payoutEligible"; private String payoutEligible; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayoutEligible = false; + public static final String JSON_PROPERTY_REALTIME_ACCOUNT_UPDATER_STATUS = "realtimeAccountUpdaterStatus"; private String realtimeAccountUpdaterStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRealtimeAccountUpdaterStatus = false; + public static final String JSON_PROPERTY_RECEIPT_FREE_TEXT = "receiptFreeText"; private String receiptFreeText; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReceiptFreeText = false; + public static final String JSON_PROPERTY_RECURRING_CONTRACT_TYPES = "recurring.contractTypes"; private String recurringContractTypes; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringContractTypes = false; + public static final String JSON_PROPERTY_RECURRING_FIRST_PSP_REFERENCE = "recurring.firstPspReference"; private String recurringFirstPspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFirstPspReference = false; + public static final String JSON_PROPERTY_RECURRING_RECURRING_DETAIL_REFERENCE = "recurring.recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v68: Use tokenization.storedPaymentMethodId // instead. private String recurringRecurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringRecurringDetailReference = false; + public static final String JSON_PROPERTY_RECURRING_SHOPPER_REFERENCE = "recurring.shopperReference"; @Deprecated // deprecated since Adyen Checkout API v68: Use tokenization.shopperReference instead. private String recurringShopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringShopperReference = false; + /** The processing model used for the recurring transaction. */ public enum RecurringProcessingModelEnum { CARDONFILE(String.valueOf("CardOnFile")), @@ -372,47 +511,89 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_REFERRED = "referred"; private String referred; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReferred = false; + public static final String JSON_PROPERTY_REFUSAL_REASON_RAW = "refusalReasonRaw"; private String refusalReasonRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRefusalReasonRaw = false; + public static final String JSON_PROPERTY_REQUEST_AMOUNT = "requestAmount"; private String requestAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestAmount = false; + public static final String JSON_PROPERTY_REQUEST_CURRENCY_CODE = "requestCurrencyCode"; private String requestCurrencyCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestCurrencyCode = false; + public static final String JSON_PROPERTY_SHOPPER_INTERACTION = "shopperInteraction"; private String shopperInteraction; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperInteraction = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_TERMINAL_ID = "terminalId"; private String terminalId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTerminalId = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED = "threeDAuthenticated"; private String threeDAuthenticated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticated = false; + public static final String JSON_PROPERTY_THREE_D_AUTHENTICATED_RESPONSE = "threeDAuthenticatedResponse"; private String threeDAuthenticatedResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDAuthenticatedResponse = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED = "threeDOffered"; private String threeDOffered; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOffered = false; + public static final String JSON_PROPERTY_THREE_D_OFFERED_RESPONSE = "threeDOfferedResponse"; private String threeDOfferedResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDOfferedResponse = false; + public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private String threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + public static final String JSON_PROPERTY_TOKENIZATION_SHOPPER_REFERENCE = "tokenization.shopperReference"; private String tokenizationShopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenizationShopperReference = false; + /** * The operation performed on the token. Possible values: * **created**: the token has been * created. * **updated**: the existing token has been updated. * **alreadyExisting**: the details @@ -465,16 +646,34 @@ public static TokenizationStoreOperationTypeEnum fromValue(String value) { "tokenization.store.operationType"; private TokenizationStoreOperationTypeEnum tokenizationStoreOperationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenizationStoreOperationType = false; + public static final String JSON_PROPERTY_TOKENIZATION_STORED_PAYMENT_METHOD_ID = "tokenization.storedPaymentMethodId"; private String tokenizationStoredPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenizationStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_VISA_TRANSACTION_ID = "visaTransactionId"; private String visaTransactionId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisaTransactionId = false; + public static final String JSON_PROPERTY_XID = "xid"; private String xid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetXid = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataCommon() {} /** @@ -487,6 +686,7 @@ public ResponseAdditionalDataCommon() {} */ public ResponseAdditionalDataCommon acquirerAccountCode(String acquirerAccountCode) { this.acquirerAccountCode = acquirerAccountCode; + isSetAcquirerAccountCode = true; // mark as set return this; } @@ -514,6 +714,7 @@ public String getAcquirerAccountCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerAccountCode(String acquirerAccountCode) { this.acquirerAccountCode = acquirerAccountCode; + isSetAcquirerAccountCode = true; // mark as set } /** @@ -525,6 +726,7 @@ public void setAcquirerAccountCode(String acquirerAccountCode) { */ public ResponseAdditionalDataCommon acquirerCode(String acquirerCode) { this.acquirerCode = acquirerCode; + isSetAcquirerCode = true; // mark as set return this; } @@ -550,6 +752,7 @@ public String getAcquirerCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerCode(String acquirerCode) { this.acquirerCode = acquirerCode; + isSetAcquirerCode = true; // mark as set } /** @@ -562,6 +765,7 @@ public void setAcquirerCode(String acquirerCode) { */ public ResponseAdditionalDataCommon acquirerReference(String acquirerReference) { this.acquirerReference = acquirerReference; + isSetAcquirerReference = true; // mark as set return this; } @@ -589,6 +793,7 @@ public String getAcquirerReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerReference(String acquirerReference) { this.acquirerReference = acquirerReference; + isSetAcquirerReference = true; // mark as set } /** @@ -599,6 +804,7 @@ public void setAcquirerReference(String acquirerReference) { */ public ResponseAdditionalDataCommon alias(String alias) { this.alias = alias; + isSetAlias = true; // mark as set return this; } @@ -622,6 +828,7 @@ public String getAlias() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAlias(String alias) { this.alias = alias; + isSetAlias = true; // mark as set } /** @@ -632,6 +839,7 @@ public void setAlias(String alias) { */ public ResponseAdditionalDataCommon aliasType(String aliasType) { this.aliasType = aliasType; + isSetAliasType = true; // mark as set return this; } @@ -655,6 +863,7 @@ public String getAliasType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAliasType(String aliasType) { this.aliasType = aliasType; + isSetAliasType = true; // mark as set } /** @@ -669,6 +878,7 @@ public void setAliasType(String aliasType) { */ public ResponseAdditionalDataCommon authCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set return this; } @@ -700,6 +910,7 @@ public String getAuthCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthCode(String authCode) { this.authCode = authCode; + isSetAuthCode = true; // mark as set } /** @@ -710,6 +921,7 @@ public void setAuthCode(String authCode) { */ public ResponseAdditionalDataCommon authorisationMid(String authorisationMid) { this.authorisationMid = authorisationMid; + isSetAuthorisationMid = true; // mark as set return this; } @@ -733,6 +945,7 @@ public String getAuthorisationMid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisationMid(String authorisationMid) { this.authorisationMid = authorisationMid; + isSetAuthorisationMid = true; // mark as set } /** @@ -745,6 +958,7 @@ public void setAuthorisationMid(String authorisationMid) { */ public ResponseAdditionalDataCommon authorisedAmountCurrency(String authorisedAmountCurrency) { this.authorisedAmountCurrency = authorisedAmountCurrency; + isSetAuthorisedAmountCurrency = true; // mark as set return this; } @@ -772,6 +986,7 @@ public String getAuthorisedAmountCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisedAmountCurrency(String authorisedAmountCurrency) { this.authorisedAmountCurrency = authorisedAmountCurrency; + isSetAuthorisedAmountCurrency = true; // mark as set } /** @@ -785,6 +1000,7 @@ public void setAuthorisedAmountCurrency(String authorisedAmountCurrency) { */ public ResponseAdditionalDataCommon authorisedAmountValue(String authorisedAmountValue) { this.authorisedAmountValue = authorisedAmountValue; + isSetAuthorisedAmountValue = true; // mark as set return this; } @@ -814,6 +1030,7 @@ public String getAuthorisedAmountValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthorisedAmountValue(String authorisedAmountValue) { this.authorisedAmountValue = authorisedAmountValue; + isSetAuthorisedAmountValue = true; // mark as set } /** @@ -828,6 +1045,7 @@ public void setAuthorisedAmountValue(String authorisedAmountValue) { */ public ResponseAdditionalDataCommon avsResult(String avsResult) { this.avsResult = avsResult; + isSetAvsResult = true; // mark as set return this; } @@ -859,6 +1077,7 @@ public String getAvsResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvsResult(String avsResult) { this.avsResult = avsResult; + isSetAvsResult = true; // mark as set } /** @@ -869,6 +1088,7 @@ public void setAvsResult(String avsResult) { */ public ResponseAdditionalDataCommon avsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set return this; } @@ -892,6 +1112,7 @@ public String getAvsResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAvsResultRaw(String avsResultRaw) { this.avsResultRaw = avsResultRaw; + isSetAvsResultRaw = true; // mark as set } /** @@ -903,6 +1124,7 @@ public void setAvsResultRaw(String avsResultRaw) { */ public ResponseAdditionalDataCommon bic(String bic) { this.bic = bic; + isSetBic = true; // mark as set return this; } @@ -928,6 +1150,7 @@ public String getBic() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBic(String bic) { this.bic = bic; + isSetBic = true; // mark as set } /** @@ -938,6 +1161,7 @@ public void setBic(String bic) { */ public ResponseAdditionalDataCommon coBrandedWith(String coBrandedWith) { this.coBrandedWith = coBrandedWith; + isSetCoBrandedWith = true; // mark as set return this; } @@ -961,6 +1185,7 @@ public String getCoBrandedWith() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCoBrandedWith(String coBrandedWith) { this.coBrandedWith = coBrandedWith; + isSetCoBrandedWith = true; // mark as set } /** @@ -971,6 +1196,7 @@ public void setCoBrandedWith(String coBrandedWith) { */ public ResponseAdditionalDataCommon cvcResult(String cvcResult) { this.cvcResult = cvcResult; + isSetCvcResult = true; // mark as set return this; } @@ -994,6 +1220,7 @@ public String getCvcResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvcResult(String cvcResult) { this.cvcResult = cvcResult; + isSetCvcResult = true; // mark as set } /** @@ -1004,6 +1231,7 @@ public void setCvcResult(String cvcResult) { */ public ResponseAdditionalDataCommon cvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set return this; } @@ -1027,6 +1255,7 @@ public String getCvcResultRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCvcResultRaw(String cvcResultRaw) { this.cvcResultRaw = cvcResultRaw; + isSetCvcResultRaw = true; // mark as set } /** @@ -1039,6 +1268,7 @@ public void setCvcResultRaw(String cvcResultRaw) { */ public ResponseAdditionalDataCommon dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -1066,6 +1296,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -1078,6 +1309,7 @@ public void setDsTransID(String dsTransID) { */ public ResponseAdditionalDataCommon eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -1105,6 +1337,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -1116,6 +1349,7 @@ public void setEci(String eci) { */ public ResponseAdditionalDataCommon expiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set return this; } @@ -1141,6 +1375,7 @@ public String getExpiryDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryDate(String expiryDate) { this.expiryDate = expiryDate; + isSetExpiryDate = true; // mark as set } /** @@ -1153,6 +1388,7 @@ public void setExpiryDate(String expiryDate) { */ public ResponseAdditionalDataCommon extraCostsCurrency(String extraCostsCurrency) { this.extraCostsCurrency = extraCostsCurrency; + isSetExtraCostsCurrency = true; // mark as set return this; } @@ -1180,6 +1416,7 @@ public String getExtraCostsCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtraCostsCurrency(String extraCostsCurrency) { this.extraCostsCurrency = extraCostsCurrency; + isSetExtraCostsCurrency = true; // mark as set } /** @@ -1192,6 +1429,7 @@ public void setExtraCostsCurrency(String extraCostsCurrency) { */ public ResponseAdditionalDataCommon extraCostsValue(String extraCostsValue) { this.extraCostsValue = extraCostsValue; + isSetExtraCostsValue = true; // mark as set return this; } @@ -1219,6 +1457,7 @@ public String getExtraCostsValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtraCostsValue(String extraCostsValue) { this.extraCostsValue = extraCostsValue; + isSetExtraCostsValue = true; // mark as set } /** @@ -1232,6 +1471,7 @@ public void setExtraCostsValue(String extraCostsValue) { public ResponseAdditionalDataCommon fraudCheckItemNrFraudCheckname( String fraudCheckItemNrFraudCheckname) { this.fraudCheckItemNrFraudCheckname = fraudCheckItemNrFraudCheckname; + isSetFraudCheckItemNrFraudCheckname = true; // mark as set return this; } @@ -1259,6 +1499,7 @@ public String getFraudCheckItemNrFraudCheckname() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudCheckItemNrFraudCheckname(String fraudCheckItemNrFraudCheckname) { this.fraudCheckItemNrFraudCheckname = fraudCheckItemNrFraudCheckname; + isSetFraudCheckItemNrFraudCheckname = true; // mark as set } /** @@ -1269,6 +1510,7 @@ public void setFraudCheckItemNrFraudCheckname(String fraudCheckItemNrFraudCheckn */ public ResponseAdditionalDataCommon fraudManualReview(String fraudManualReview) { this.fraudManualReview = fraudManualReview; + isSetFraudManualReview = true; // mark as set return this; } @@ -1292,23 +1534,27 @@ public String getFraudManualReview() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudManualReview(String fraudManualReview) { this.fraudManualReview = fraudManualReview; + isSetFraudManualReview = true; // mark as set } /** - * The fraud result properties of the payment. + * The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED * - * @param fraudResultType The fraud result properties of the payment. + * @param fraudResultType The fraud result properties of the payment. Possible values: * AMBER * + * GREEN * RED * @return the current {@code ResponseAdditionalDataCommon} instance, allowing for method chaining */ public ResponseAdditionalDataCommon fraudResultType(FraudResultTypeEnum fraudResultType) { this.fraudResultType = fraudResultType; + isSetFraudResultType = true; // mark as set return this; } /** - * The fraud result properties of the payment. + * The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED * - * @return fraudResultType The fraud result properties of the payment. + * @return fraudResultType The fraud result properties of the payment. Possible values: * AMBER * + * GREEN * RED */ @JsonProperty(JSON_PROPERTY_FRAUD_RESULT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1317,31 +1563,33 @@ public FraudResultTypeEnum getFraudResultType() { } /** - * The fraud result properties of the payment. + * The fraud result properties of the payment. Possible values: * AMBER * GREEN * RED * - * @param fraudResultType The fraud result properties of the payment. + * @param fraudResultType The fraud result properties of the payment. Possible values: * AMBER * + * GREEN * RED */ @JsonProperty(JSON_PROPERTY_FRAUD_RESULT_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudResultType(FraudResultTypeEnum fraudResultType) { this.fraudResultType = fraudResultType; + isSetFraudResultType = true; // mark as set } /** * The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in a - * fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh + * fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh * * @param fraudRiskLevel The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in - * a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * - * veryHigh + * a fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh * @return the current {@code ResponseAdditionalDataCommon} instance, allowing for method chaining */ public ResponseAdditionalDataCommon fraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) { this.fraudRiskLevel = fraudRiskLevel; + isSetFraudRiskLevel = true; // mark as set return this; } @@ -1349,13 +1597,12 @@ public ResponseAdditionalDataCommon fraudRiskLevel(FraudRiskLevelEnum fraudRiskL * The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in a - * fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh + * fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh * * @return fraudRiskLevel The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in - * a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * - * veryHigh + * a fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh */ @JsonProperty(JSON_PROPERTY_FRAUD_RISK_LEVEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -1367,18 +1614,18 @@ public FraudRiskLevelEnum getFraudRiskLevel() { * The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in a - * fraudulent dispute. The possible return values are: * veryLow * low * medium * high * veryHigh + * fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh * * @param fraudRiskLevel The risk level of the transaction as classified by the [machine * learning](https://docs.adyen.com/risk-management/configure-your-risk-profile/machine-learning-rules/) * fraud risk rule. The risk level indicates the likelihood that a transaction will result in - * a fraudulent dispute. The possible return values are: * veryLow * low * medium * high * - * veryHigh + * a fraudulent dispute. Possible values: * veryLow * low * medium * high * veryHigh */ @JsonProperty(JSON_PROPERTY_FRAUD_RISK_LEVEL) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) { this.fraudRiskLevel = fraudRiskLevel; + isSetFraudRiskLevel = true; // mark as set } /** @@ -1398,6 +1645,7 @@ public void setFraudRiskLevel(FraudRiskLevelEnum fraudRiskLevel) { */ public ResponseAdditionalDataCommon fundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -1439,6 +1687,7 @@ public String getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(String fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -1457,6 +1706,7 @@ public void setFundingSource(String fundingSource) { */ public ResponseAdditionalDataCommon fundsAvailability(String fundsAvailability) { this.fundsAvailability = fundsAvailability; + isSetFundsAvailability = true; // mark as set return this; } @@ -1496,6 +1746,7 @@ public String getFundsAvailability() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundsAvailability(String fundsAvailability) { this.fundsAvailability = fundsAvailability; + isSetFundsAvailability = true; // mark as set } /** @@ -1523,6 +1774,7 @@ public void setFundsAvailability(String fundsAvailability) { */ public ResponseAdditionalDataCommon inferredRefusalReason(String inferredRefusalReason) { this.inferredRefusalReason = inferredRefusalReason; + isSetInferredRefusalReason = true; // mark as set return this; } @@ -1580,6 +1832,7 @@ public String getInferredRefusalReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInferredRefusalReason(String inferredRefusalReason) { this.inferredRefusalReason = inferredRefusalReason; + isSetInferredRefusalReason = true; // mark as set } /** @@ -1590,6 +1843,7 @@ public void setInferredRefusalReason(String inferredRefusalReason) { */ public ResponseAdditionalDataCommon isCardCommercial(String isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set return this; } @@ -1613,6 +1867,7 @@ public String getIsCardCommercial() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIsCardCommercial(String isCardCommercial) { this.isCardCommercial = isCardCommercial; + isSetIsCardCommercial = true; // mark as set } /** @@ -1624,6 +1879,7 @@ public void setIsCardCommercial(String isCardCommercial) { */ public ResponseAdditionalDataCommon issuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set return this; } @@ -1649,6 +1905,7 @@ public String getIssuerCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerCountry(String issuerCountry) { this.issuerCountry = issuerCountry; + isSetIssuerCountry = true; // mark as set } /** @@ -1660,6 +1917,7 @@ public void setIssuerCountry(String issuerCountry) { */ public ResponseAdditionalDataCommon liabilityShift(String liabilityShift) { this.liabilityShift = liabilityShift; + isSetLiabilityShift = true; // mark as set return this; } @@ -1685,6 +1943,7 @@ public String getLiabilityShift() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLiabilityShift(String liabilityShift) { this.liabilityShift = liabilityShift; + isSetLiabilityShift = true; // mark as set } /** @@ -1698,6 +1957,7 @@ public void setLiabilityShift(String liabilityShift) { */ public ResponseAdditionalDataCommon mcBankNetReferenceNumber(String mcBankNetReferenceNumber) { this.mcBankNetReferenceNumber = mcBankNetReferenceNumber; + isSetMcBankNetReferenceNumber = true; // mark as set return this; } @@ -1727,6 +1987,7 @@ public String getMcBankNetReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcBankNetReferenceNumber(String mcBankNetReferenceNumber) { this.mcBankNetReferenceNumber = mcBankNetReferenceNumber; + isSetMcBankNetReferenceNumber = true; // mark as set } /** @@ -1743,6 +2004,7 @@ public void setMcBankNetReferenceNumber(String mcBankNetReferenceNumber) { */ public ResponseAdditionalDataCommon merchantAdviceCode(String merchantAdviceCode) { this.merchantAdviceCode = merchantAdviceCode; + isSetMerchantAdviceCode = true; // mark as set return this; } @@ -1778,6 +2040,7 @@ public String getMerchantAdviceCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAdviceCode(String merchantAdviceCode) { this.merchantAdviceCode = merchantAdviceCode; + isSetMerchantAdviceCode = true; // mark as set } /** @@ -1788,6 +2051,7 @@ public void setMerchantAdviceCode(String merchantAdviceCode) { */ public ResponseAdditionalDataCommon merchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set return this; } @@ -1811,6 +2075,7 @@ public String getMerchantReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantReference(String merchantReference) { this.merchantReference = merchantReference; + isSetMerchantReference = true; // mark as set } /** @@ -1825,6 +2090,7 @@ public void setMerchantReference(String merchantReference) { */ public ResponseAdditionalDataCommon networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -1856,6 +2122,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -1867,6 +2134,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public ResponseAdditionalDataCommon ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -1892,6 +2160,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -1905,6 +2174,7 @@ public void setOwnerName(String ownerName) { */ public ResponseAdditionalDataCommon paymentAccountReference(String paymentAccountReference) { this.paymentAccountReference = paymentAccountReference; + isSetPaymentAccountReference = true; // mark as set return this; } @@ -1934,6 +2204,7 @@ public String getPaymentAccountReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAccountReference(String paymentAccountReference) { this.paymentAccountReference = paymentAccountReference; + isSetPaymentAccountReference = true; // mark as set } /** @@ -1944,6 +2215,7 @@ public void setPaymentAccountReference(String paymentAccountReference) { */ public ResponseAdditionalDataCommon paymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -1967,6 +2239,7 @@ public String getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -1983,6 +2256,7 @@ public void setPaymentMethod(String paymentMethod) { */ public ResponseAdditionalDataCommon paymentMethodVariant(String paymentMethodVariant) { this.paymentMethodVariant = paymentMethodVariant; + isSetPaymentMethodVariant = true; // mark as set return this; } @@ -2018,6 +2292,7 @@ public String getPaymentMethodVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethodVariant(String paymentMethodVariant) { this.paymentMethodVariant = paymentMethodVariant; + isSetPaymentMethodVariant = true; // mark as set } /** @@ -2033,6 +2308,7 @@ public void setPaymentMethodVariant(String paymentMethodVariant) { */ public ResponseAdditionalDataCommon payoutEligible(String payoutEligible) { this.payoutEligible = payoutEligible; + isSetPayoutEligible = true; // mark as set return this; } @@ -2066,6 +2342,7 @@ public String getPayoutEligible() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayoutEligible(String payoutEligible) { this.payoutEligible = payoutEligible; + isSetPayoutEligible = true; // mark as set } /** @@ -2080,6 +2357,7 @@ public void setPayoutEligible(String payoutEligible) { public ResponseAdditionalDataCommon realtimeAccountUpdaterStatus( String realtimeAccountUpdaterStatus) { this.realtimeAccountUpdaterStatus = realtimeAccountUpdaterStatus; + isSetRealtimeAccountUpdaterStatus = true; // mark as set return this; } @@ -2109,6 +2387,7 @@ public String getRealtimeAccountUpdaterStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRealtimeAccountUpdaterStatus(String realtimeAccountUpdaterStatus) { this.realtimeAccountUpdaterStatus = realtimeAccountUpdaterStatus; + isSetRealtimeAccountUpdaterStatus = true; // mark as set } /** @@ -2119,6 +2398,7 @@ public void setRealtimeAccountUpdaterStatus(String realtimeAccountUpdaterStatus) */ public ResponseAdditionalDataCommon receiptFreeText(String receiptFreeText) { this.receiptFreeText = receiptFreeText; + isSetReceiptFreeText = true; // mark as set return this; } @@ -2142,6 +2422,7 @@ public String getReceiptFreeText() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReceiptFreeText(String receiptFreeText) { this.receiptFreeText = receiptFreeText; + isSetReceiptFreeText = true; // mark as set } /** @@ -2152,6 +2433,7 @@ public void setReceiptFreeText(String receiptFreeText) { */ public ResponseAdditionalDataCommon recurringContractTypes(String recurringContractTypes) { this.recurringContractTypes = recurringContractTypes; + isSetRecurringContractTypes = true; // mark as set return this; } @@ -2175,6 +2457,7 @@ public String getRecurringContractTypes() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringContractTypes(String recurringContractTypes) { this.recurringContractTypes = recurringContractTypes; + isSetRecurringContractTypes = true; // mark as set } /** @@ -2190,6 +2473,7 @@ public void setRecurringContractTypes(String recurringContractTypes) { public ResponseAdditionalDataCommon recurringFirstPspReference( String recurringFirstPspReference) { this.recurringFirstPspReference = recurringFirstPspReference; + isSetRecurringFirstPspReference = true; // mark as set return this; } @@ -2221,6 +2505,7 @@ public String getRecurringFirstPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFirstPspReference(String recurringFirstPspReference) { this.recurringFirstPspReference = recurringFirstPspReference; + isSetRecurringFirstPspReference = true; // mark as set } /** @@ -2236,6 +2521,7 @@ public void setRecurringFirstPspReference(String recurringFirstPspReference) { public ResponseAdditionalDataCommon recurringRecurringDetailReference( String recurringRecurringDetailReference) { this.recurringRecurringDetailReference = recurringRecurringDetailReference; + isSetRecurringRecurringDetailReference = true; // mark as set return this; } @@ -2268,6 +2554,7 @@ public String getRecurringRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringRecurringDetailReference(String recurringRecurringDetailReference) { this.recurringRecurringDetailReference = recurringRecurringDetailReference; + isSetRecurringRecurringDetailReference = true; // mark as set } /** @@ -2281,6 +2568,7 @@ public void setRecurringRecurringDetailReference(String recurringRecurringDetail @Deprecated // deprecated since Adyen Checkout API v68: Use tokenization.shopperReference instead. public ResponseAdditionalDataCommon recurringShopperReference(String recurringShopperReference) { this.recurringShopperReference = recurringShopperReference; + isSetRecurringShopperReference = true; // mark as set return this; } @@ -2311,6 +2599,7 @@ public String getRecurringShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringShopperReference(String recurringShopperReference) { this.recurringShopperReference = recurringShopperReference; + isSetRecurringShopperReference = true; // mark as set } /** @@ -2322,6 +2611,7 @@ public void setRecurringShopperReference(String recurringShopperReference) { public ResponseAdditionalDataCommon recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -2345,6 +2635,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -2358,6 +2649,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public ResponseAdditionalDataCommon referred(String referred) { this.referred = referred; + isSetReferred = true; // mark as set return this; } @@ -2387,6 +2679,7 @@ public String getReferred() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReferred(String referred) { this.referred = referred; + isSetReferred = true; // mark as set } /** @@ -2398,6 +2691,7 @@ public void setReferred(String referred) { */ public ResponseAdditionalDataCommon refusalReasonRaw(String refusalReasonRaw) { this.refusalReasonRaw = refusalReasonRaw; + isSetRefusalReasonRaw = true; // mark as set return this; } @@ -2423,6 +2717,7 @@ public String getRefusalReasonRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRefusalReasonRaw(String refusalReasonRaw) { this.refusalReasonRaw = refusalReasonRaw; + isSetRefusalReasonRaw = true; // mark as set } /** @@ -2433,6 +2728,7 @@ public void setRefusalReasonRaw(String refusalReasonRaw) { */ public ResponseAdditionalDataCommon requestAmount(String requestAmount) { this.requestAmount = requestAmount; + isSetRequestAmount = true; // mark as set return this; } @@ -2456,6 +2752,7 @@ public String getRequestAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestAmount(String requestAmount) { this.requestAmount = requestAmount; + isSetRequestAmount = true; // mark as set } /** @@ -2466,6 +2763,7 @@ public void setRequestAmount(String requestAmount) { */ public ResponseAdditionalDataCommon requestCurrencyCode(String requestCurrencyCode) { this.requestCurrencyCode = requestCurrencyCode; + isSetRequestCurrencyCode = true; // mark as set return this; } @@ -2489,6 +2787,7 @@ public String getRequestCurrencyCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRequestCurrencyCode(String requestCurrencyCode) { this.requestCurrencyCode = requestCurrencyCode; + isSetRequestCurrencyCode = true; // mark as set } /** @@ -2500,6 +2799,7 @@ public void setRequestCurrencyCode(String requestCurrencyCode) { */ public ResponseAdditionalDataCommon shopperInteraction(String shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set return this; } @@ -2525,6 +2825,7 @@ public String getShopperInteraction() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperInteraction(String shopperInteraction) { this.shopperInteraction = shopperInteraction; + isSetShopperInteraction = true; // mark as set } /** @@ -2536,6 +2837,7 @@ public void setShopperInteraction(String shopperInteraction) { */ public ResponseAdditionalDataCommon shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -2561,6 +2863,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -2571,6 +2874,7 @@ public void setShopperReference(String shopperReference) { */ public ResponseAdditionalDataCommon terminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set return this; } @@ -2594,6 +2898,7 @@ public String getTerminalId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTerminalId(String terminalId) { this.terminalId = terminalId; + isSetTerminalId = true; // mark as set } /** @@ -2606,6 +2911,7 @@ public void setTerminalId(String terminalId) { */ public ResponseAdditionalDataCommon threeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set return this; } @@ -2633,6 +2939,7 @@ public String getThreeDAuthenticated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticated(String threeDAuthenticated) { this.threeDAuthenticated = threeDAuthenticated; + isSetThreeDAuthenticated = true; // mark as set } /** @@ -2645,6 +2952,7 @@ public void setThreeDAuthenticated(String threeDAuthenticated) { public ResponseAdditionalDataCommon threeDAuthenticatedResponse( String threeDAuthenticatedResponse) { this.threeDAuthenticatedResponse = threeDAuthenticatedResponse; + isSetThreeDAuthenticatedResponse = true; // mark as set return this; } @@ -2670,6 +2978,7 @@ public String getThreeDAuthenticatedResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDAuthenticatedResponse(String threeDAuthenticatedResponse) { this.threeDAuthenticatedResponse = threeDAuthenticatedResponse; + isSetThreeDAuthenticatedResponse = true; // mark as set } /** @@ -2681,6 +2990,7 @@ public void setThreeDAuthenticatedResponse(String threeDAuthenticatedResponse) { */ public ResponseAdditionalDataCommon threeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set return this; } @@ -2706,6 +3016,7 @@ public String getThreeDOffered() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOffered(String threeDOffered) { this.threeDOffered = threeDOffered; + isSetThreeDOffered = true; // mark as set } /** @@ -2717,6 +3028,7 @@ public void setThreeDOffered(String threeDOffered) { */ public ResponseAdditionalDataCommon threeDOfferedResponse(String threeDOfferedResponse) { this.threeDOfferedResponse = threeDOfferedResponse; + isSetThreeDOfferedResponse = true; // mark as set return this; } @@ -2742,6 +3054,7 @@ public String getThreeDOfferedResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDOfferedResponse(String threeDOfferedResponse) { this.threeDOfferedResponse = threeDOfferedResponse; + isSetThreeDOfferedResponse = true; // mark as set } /** @@ -2752,6 +3065,7 @@ public void setThreeDOfferedResponse(String threeDOfferedResponse) { */ public ResponseAdditionalDataCommon threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -2775,6 +3089,7 @@ public String getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set } /** @@ -2787,6 +3102,7 @@ public void setThreeDSVersion(String threeDSVersion) { public ResponseAdditionalDataCommon tokenizationShopperReference( String tokenizationShopperReference) { this.tokenizationShopperReference = tokenizationShopperReference; + isSetTokenizationShopperReference = true; // mark as set return this; } @@ -2812,6 +3128,7 @@ public String getTokenizationShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenizationShopperReference(String tokenizationShopperReference) { this.tokenizationShopperReference = tokenizationShopperReference; + isSetTokenizationShopperReference = true; // mark as set } /** @@ -2827,6 +3144,7 @@ public void setTokenizationShopperReference(String tokenizationShopperReference) public ResponseAdditionalDataCommon tokenizationStoreOperationType( TokenizationStoreOperationTypeEnum tokenizationStoreOperationType) { this.tokenizationStoreOperationType = tokenizationStoreOperationType; + isSetTokenizationStoreOperationType = true; // mark as set return this; } @@ -2859,6 +3177,7 @@ public TokenizationStoreOperationTypeEnum getTokenizationStoreOperationType() { public void setTokenizationStoreOperationType( TokenizationStoreOperationTypeEnum tokenizationStoreOperationType) { this.tokenizationStoreOperationType = tokenizationStoreOperationType; + isSetTokenizationStoreOperationType = true; // mark as set } /** @@ -2871,6 +3190,7 @@ public void setTokenizationStoreOperationType( public ResponseAdditionalDataCommon tokenizationStoredPaymentMethodId( String tokenizationStoredPaymentMethodId) { this.tokenizationStoredPaymentMethodId = tokenizationStoredPaymentMethodId; + isSetTokenizationStoredPaymentMethodId = true; // mark as set return this; } @@ -2896,6 +3216,7 @@ public String getTokenizationStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenizationStoredPaymentMethodId(String tokenizationStoredPaymentMethodId) { this.tokenizationStoredPaymentMethodId = tokenizationStoredPaymentMethodId; + isSetTokenizationStoredPaymentMethodId = true; // mark as set } /** @@ -2908,6 +3229,7 @@ public void setTokenizationStoredPaymentMethodId(String tokenizationStoredPaymen */ public ResponseAdditionalDataCommon visaTransactionId(String visaTransactionId) { this.visaTransactionId = visaTransactionId; + isSetVisaTransactionId = true; // mark as set return this; } @@ -2935,6 +3257,7 @@ public String getVisaTransactionId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisaTransactionId(String visaTransactionId) { this.visaTransactionId = visaTransactionId; + isSetVisaTransactionId = true; // mark as set } /** @@ -2949,6 +3272,7 @@ public void setVisaTransactionId(String visaTransactionId) { */ public ResponseAdditionalDataCommon xid(String xid) { this.xid = xid; + isSetXid = true; // mark as set return this; } @@ -2980,6 +3304,27 @@ public String getXid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setXid(String xid) { this.xid = xid; + isSetXid = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataCommon includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataCommon object is equal to o. */ @@ -2994,164 +3339,348 @@ public boolean equals(Object o) { ResponseAdditionalDataCommon responseAdditionalDataCommon = (ResponseAdditionalDataCommon) o; return Objects.equals( this.acquirerAccountCode, responseAdditionalDataCommon.acquirerAccountCode) + && Objects.equals( + this.isSetAcquirerAccountCode, responseAdditionalDataCommon.isSetAcquirerAccountCode) && Objects.equals(this.acquirerCode, responseAdditionalDataCommon.acquirerCode) + && Objects.equals(this.isSetAcquirerCode, responseAdditionalDataCommon.isSetAcquirerCode) && Objects.equals(this.acquirerReference, responseAdditionalDataCommon.acquirerReference) + && Objects.equals( + this.isSetAcquirerReference, responseAdditionalDataCommon.isSetAcquirerReference) && Objects.equals(this.alias, responseAdditionalDataCommon.alias) + && Objects.equals(this.isSetAlias, responseAdditionalDataCommon.isSetAlias) && Objects.equals(this.aliasType, responseAdditionalDataCommon.aliasType) + && Objects.equals(this.isSetAliasType, responseAdditionalDataCommon.isSetAliasType) && Objects.equals(this.authCode, responseAdditionalDataCommon.authCode) + && Objects.equals(this.isSetAuthCode, responseAdditionalDataCommon.isSetAuthCode) && Objects.equals(this.authorisationMid, responseAdditionalDataCommon.authorisationMid) + && Objects.equals( + this.isSetAuthorisationMid, responseAdditionalDataCommon.isSetAuthorisationMid) && Objects.equals( this.authorisedAmountCurrency, responseAdditionalDataCommon.authorisedAmountCurrency) + && Objects.equals( + this.isSetAuthorisedAmountCurrency, + responseAdditionalDataCommon.isSetAuthorisedAmountCurrency) && Objects.equals( this.authorisedAmountValue, responseAdditionalDataCommon.authorisedAmountValue) + && Objects.equals( + this.isSetAuthorisedAmountValue, + responseAdditionalDataCommon.isSetAuthorisedAmountValue) && Objects.equals(this.avsResult, responseAdditionalDataCommon.avsResult) + && Objects.equals(this.isSetAvsResult, responseAdditionalDataCommon.isSetAvsResult) && Objects.equals(this.avsResultRaw, responseAdditionalDataCommon.avsResultRaw) + && Objects.equals(this.isSetAvsResultRaw, responseAdditionalDataCommon.isSetAvsResultRaw) && Objects.equals(this.bic, responseAdditionalDataCommon.bic) + && Objects.equals(this.isSetBic, responseAdditionalDataCommon.isSetBic) && Objects.equals(this.coBrandedWith, responseAdditionalDataCommon.coBrandedWith) + && Objects.equals(this.isSetCoBrandedWith, responseAdditionalDataCommon.isSetCoBrandedWith) && Objects.equals(this.cvcResult, responseAdditionalDataCommon.cvcResult) + && Objects.equals(this.isSetCvcResult, responseAdditionalDataCommon.isSetCvcResult) && Objects.equals(this.cvcResultRaw, responseAdditionalDataCommon.cvcResultRaw) + && Objects.equals(this.isSetCvcResultRaw, responseAdditionalDataCommon.isSetCvcResultRaw) && Objects.equals(this.dsTransID, responseAdditionalDataCommon.dsTransID) + && Objects.equals(this.isSetDsTransID, responseAdditionalDataCommon.isSetDsTransID) && Objects.equals(this.eci, responseAdditionalDataCommon.eci) + && Objects.equals(this.isSetEci, responseAdditionalDataCommon.isSetEci) && Objects.equals(this.expiryDate, responseAdditionalDataCommon.expiryDate) + && Objects.equals(this.isSetExpiryDate, responseAdditionalDataCommon.isSetExpiryDate) && Objects.equals(this.extraCostsCurrency, responseAdditionalDataCommon.extraCostsCurrency) + && Objects.equals( + this.isSetExtraCostsCurrency, responseAdditionalDataCommon.isSetExtraCostsCurrency) && Objects.equals(this.extraCostsValue, responseAdditionalDataCommon.extraCostsValue) + && Objects.equals( + this.isSetExtraCostsValue, responseAdditionalDataCommon.isSetExtraCostsValue) && Objects.equals( this.fraudCheckItemNrFraudCheckname, responseAdditionalDataCommon.fraudCheckItemNrFraudCheckname) + && Objects.equals( + this.isSetFraudCheckItemNrFraudCheckname, + responseAdditionalDataCommon.isSetFraudCheckItemNrFraudCheckname) && Objects.equals(this.fraudManualReview, responseAdditionalDataCommon.fraudManualReview) + && Objects.equals( + this.isSetFraudManualReview, responseAdditionalDataCommon.isSetFraudManualReview) && Objects.equals(this.fraudResultType, responseAdditionalDataCommon.fraudResultType) + && Objects.equals( + this.isSetFraudResultType, responseAdditionalDataCommon.isSetFraudResultType) && Objects.equals(this.fraudRiskLevel, responseAdditionalDataCommon.fraudRiskLevel) + && Objects.equals( + this.isSetFraudRiskLevel, responseAdditionalDataCommon.isSetFraudRiskLevel) && Objects.equals(this.fundingSource, responseAdditionalDataCommon.fundingSource) + && Objects.equals(this.isSetFundingSource, responseAdditionalDataCommon.isSetFundingSource) && Objects.equals(this.fundsAvailability, responseAdditionalDataCommon.fundsAvailability) + && Objects.equals( + this.isSetFundsAvailability, responseAdditionalDataCommon.isSetFundsAvailability) && Objects.equals( this.inferredRefusalReason, responseAdditionalDataCommon.inferredRefusalReason) + && Objects.equals( + this.isSetInferredRefusalReason, + responseAdditionalDataCommon.isSetInferredRefusalReason) && Objects.equals(this.isCardCommercial, responseAdditionalDataCommon.isCardCommercial) + && Objects.equals( + this.isSetIsCardCommercial, responseAdditionalDataCommon.isSetIsCardCommercial) && Objects.equals(this.issuerCountry, responseAdditionalDataCommon.issuerCountry) + && Objects.equals(this.isSetIssuerCountry, responseAdditionalDataCommon.isSetIssuerCountry) && Objects.equals(this.liabilityShift, responseAdditionalDataCommon.liabilityShift) + && Objects.equals( + this.isSetLiabilityShift, responseAdditionalDataCommon.isSetLiabilityShift) && Objects.equals( this.mcBankNetReferenceNumber, responseAdditionalDataCommon.mcBankNetReferenceNumber) + && Objects.equals( + this.isSetMcBankNetReferenceNumber, + responseAdditionalDataCommon.isSetMcBankNetReferenceNumber) && Objects.equals(this.merchantAdviceCode, responseAdditionalDataCommon.merchantAdviceCode) + && Objects.equals( + this.isSetMerchantAdviceCode, responseAdditionalDataCommon.isSetMerchantAdviceCode) && Objects.equals(this.merchantReference, responseAdditionalDataCommon.merchantReference) + && Objects.equals( + this.isSetMerchantReference, responseAdditionalDataCommon.isSetMerchantReference) && Objects.equals(this.networkTxReference, responseAdditionalDataCommon.networkTxReference) + && Objects.equals( + this.isSetNetworkTxReference, responseAdditionalDataCommon.isSetNetworkTxReference) && Objects.equals(this.ownerName, responseAdditionalDataCommon.ownerName) + && Objects.equals(this.isSetOwnerName, responseAdditionalDataCommon.isSetOwnerName) && Objects.equals( this.paymentAccountReference, responseAdditionalDataCommon.paymentAccountReference) + && Objects.equals( + this.isSetPaymentAccountReference, + responseAdditionalDataCommon.isSetPaymentAccountReference) && Objects.equals(this.paymentMethod, responseAdditionalDataCommon.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, responseAdditionalDataCommon.isSetPaymentMethod) && Objects.equals( this.paymentMethodVariant, responseAdditionalDataCommon.paymentMethodVariant) + && Objects.equals( + this.isSetPaymentMethodVariant, responseAdditionalDataCommon.isSetPaymentMethodVariant) && Objects.equals(this.payoutEligible, responseAdditionalDataCommon.payoutEligible) + && Objects.equals( + this.isSetPayoutEligible, responseAdditionalDataCommon.isSetPayoutEligible) && Objects.equals( this.realtimeAccountUpdaterStatus, responseAdditionalDataCommon.realtimeAccountUpdaterStatus) + && Objects.equals( + this.isSetRealtimeAccountUpdaterStatus, + responseAdditionalDataCommon.isSetRealtimeAccountUpdaterStatus) && Objects.equals(this.receiptFreeText, responseAdditionalDataCommon.receiptFreeText) + && Objects.equals( + this.isSetReceiptFreeText, responseAdditionalDataCommon.isSetReceiptFreeText) && Objects.equals( this.recurringContractTypes, responseAdditionalDataCommon.recurringContractTypes) + && Objects.equals( + this.isSetRecurringContractTypes, + responseAdditionalDataCommon.isSetRecurringContractTypes) && Objects.equals( this.recurringFirstPspReference, responseAdditionalDataCommon.recurringFirstPspReference) + && Objects.equals( + this.isSetRecurringFirstPspReference, + responseAdditionalDataCommon.isSetRecurringFirstPspReference) && Objects.equals( this.recurringRecurringDetailReference, responseAdditionalDataCommon.recurringRecurringDetailReference) + && Objects.equals( + this.isSetRecurringRecurringDetailReference, + responseAdditionalDataCommon.isSetRecurringRecurringDetailReference) && Objects.equals( this.recurringShopperReference, responseAdditionalDataCommon.recurringShopperReference) + && Objects.equals( + this.isSetRecurringShopperReference, + responseAdditionalDataCommon.isSetRecurringShopperReference) && Objects.equals( this.recurringProcessingModel, responseAdditionalDataCommon.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, + responseAdditionalDataCommon.isSetRecurringProcessingModel) && Objects.equals(this.referred, responseAdditionalDataCommon.referred) + && Objects.equals(this.isSetReferred, responseAdditionalDataCommon.isSetReferred) && Objects.equals(this.refusalReasonRaw, responseAdditionalDataCommon.refusalReasonRaw) + && Objects.equals( + this.isSetRefusalReasonRaw, responseAdditionalDataCommon.isSetRefusalReasonRaw) && Objects.equals(this.requestAmount, responseAdditionalDataCommon.requestAmount) + && Objects.equals(this.isSetRequestAmount, responseAdditionalDataCommon.isSetRequestAmount) && Objects.equals( this.requestCurrencyCode, responseAdditionalDataCommon.requestCurrencyCode) + && Objects.equals( + this.isSetRequestCurrencyCode, responseAdditionalDataCommon.isSetRequestCurrencyCode) && Objects.equals(this.shopperInteraction, responseAdditionalDataCommon.shopperInteraction) + && Objects.equals( + this.isSetShopperInteraction, responseAdditionalDataCommon.isSetShopperInteraction) && Objects.equals(this.shopperReference, responseAdditionalDataCommon.shopperReference) + && Objects.equals( + this.isSetShopperReference, responseAdditionalDataCommon.isSetShopperReference) && Objects.equals(this.terminalId, responseAdditionalDataCommon.terminalId) + && Objects.equals(this.isSetTerminalId, responseAdditionalDataCommon.isSetTerminalId) && Objects.equals( this.threeDAuthenticated, responseAdditionalDataCommon.threeDAuthenticated) + && Objects.equals( + this.isSetThreeDAuthenticated, responseAdditionalDataCommon.isSetThreeDAuthenticated) && Objects.equals( this.threeDAuthenticatedResponse, responseAdditionalDataCommon.threeDAuthenticatedResponse) + && Objects.equals( + this.isSetThreeDAuthenticatedResponse, + responseAdditionalDataCommon.isSetThreeDAuthenticatedResponse) && Objects.equals(this.threeDOffered, responseAdditionalDataCommon.threeDOffered) + && Objects.equals(this.isSetThreeDOffered, responseAdditionalDataCommon.isSetThreeDOffered) && Objects.equals( this.threeDOfferedResponse, responseAdditionalDataCommon.threeDOfferedResponse) + && Objects.equals( + this.isSetThreeDOfferedResponse, + responseAdditionalDataCommon.isSetThreeDOfferedResponse) && Objects.equals(this.threeDSVersion, responseAdditionalDataCommon.threeDSVersion) + && Objects.equals( + this.isSetThreeDSVersion, responseAdditionalDataCommon.isSetThreeDSVersion) && Objects.equals( this.tokenizationShopperReference, responseAdditionalDataCommon.tokenizationShopperReference) + && Objects.equals( + this.isSetTokenizationShopperReference, + responseAdditionalDataCommon.isSetTokenizationShopperReference) && Objects.equals( this.tokenizationStoreOperationType, responseAdditionalDataCommon.tokenizationStoreOperationType) + && Objects.equals( + this.isSetTokenizationStoreOperationType, + responseAdditionalDataCommon.isSetTokenizationStoreOperationType) && Objects.equals( this.tokenizationStoredPaymentMethodId, responseAdditionalDataCommon.tokenizationStoredPaymentMethodId) + && Objects.equals( + this.isSetTokenizationStoredPaymentMethodId, + responseAdditionalDataCommon.isSetTokenizationStoredPaymentMethodId) && Objects.equals(this.visaTransactionId, responseAdditionalDataCommon.visaTransactionId) - && Objects.equals(this.xid, responseAdditionalDataCommon.xid); + && Objects.equals( + this.isSetVisaTransactionId, responseAdditionalDataCommon.isSetVisaTransactionId) + && Objects.equals(this.xid, responseAdditionalDataCommon.xid) + && Objects.equals(this.isSetXid, responseAdditionalDataCommon.isSetXid); } @Override public int hashCode() { return Objects.hash( acquirerAccountCode, + isSetAcquirerAccountCode, acquirerCode, + isSetAcquirerCode, acquirerReference, + isSetAcquirerReference, alias, + isSetAlias, aliasType, + isSetAliasType, authCode, + isSetAuthCode, authorisationMid, + isSetAuthorisationMid, authorisedAmountCurrency, + isSetAuthorisedAmountCurrency, authorisedAmountValue, + isSetAuthorisedAmountValue, avsResult, + isSetAvsResult, avsResultRaw, + isSetAvsResultRaw, bic, + isSetBic, coBrandedWith, + isSetCoBrandedWith, cvcResult, + isSetCvcResult, cvcResultRaw, + isSetCvcResultRaw, dsTransID, + isSetDsTransID, eci, + isSetEci, expiryDate, + isSetExpiryDate, extraCostsCurrency, + isSetExtraCostsCurrency, extraCostsValue, + isSetExtraCostsValue, fraudCheckItemNrFraudCheckname, + isSetFraudCheckItemNrFraudCheckname, fraudManualReview, + isSetFraudManualReview, fraudResultType, + isSetFraudResultType, fraudRiskLevel, + isSetFraudRiskLevel, fundingSource, + isSetFundingSource, fundsAvailability, + isSetFundsAvailability, inferredRefusalReason, + isSetInferredRefusalReason, isCardCommercial, + isSetIsCardCommercial, issuerCountry, + isSetIssuerCountry, liabilityShift, + isSetLiabilityShift, mcBankNetReferenceNumber, + isSetMcBankNetReferenceNumber, merchantAdviceCode, + isSetMerchantAdviceCode, merchantReference, + isSetMerchantReference, networkTxReference, + isSetNetworkTxReference, ownerName, + isSetOwnerName, paymentAccountReference, + isSetPaymentAccountReference, paymentMethod, + isSetPaymentMethod, paymentMethodVariant, + isSetPaymentMethodVariant, payoutEligible, + isSetPayoutEligible, realtimeAccountUpdaterStatus, + isSetRealtimeAccountUpdaterStatus, receiptFreeText, + isSetReceiptFreeText, recurringContractTypes, + isSetRecurringContractTypes, recurringFirstPspReference, + isSetRecurringFirstPspReference, recurringRecurringDetailReference, + isSetRecurringRecurringDetailReference, recurringShopperReference, + isSetRecurringShopperReference, recurringProcessingModel, + isSetRecurringProcessingModel, referred, + isSetReferred, refusalReasonRaw, + isSetRefusalReasonRaw, requestAmount, + isSetRequestAmount, requestCurrencyCode, + isSetRequestCurrencyCode, shopperInteraction, + isSetShopperInteraction, shopperReference, + isSetShopperReference, terminalId, + isSetTerminalId, threeDAuthenticated, + isSetThreeDAuthenticated, threeDAuthenticatedResponse, + isSetThreeDAuthenticatedResponse, threeDOffered, + isSetThreeDOffered, threeDOfferedResponse, + isSetThreeDOfferedResponse, threeDSVersion, + isSetThreeDSVersion, tokenizationShopperReference, + isSetTokenizationShopperReference, tokenizationStoreOperationType, + isSetTokenizationStoreOperationType, tokenizationStoredPaymentMethodId, + isSetTokenizationStoredPaymentMethodId, visaTransactionId, - xid); + isSetVisaTransactionId, + xid, + isSetXid); } @Override @@ -3277,6 +3806,232 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcquirerAccountCode) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_ACCOUNT_CODE, this.acquirerAccountCode); + } + if (isSetAcquirerCode) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_CODE, this.acquirerCode); + } + if (isSetAcquirerReference) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_REFERENCE, this.acquirerReference); + } + if (isSetAlias) { + addIfNull(nulls, JSON_PROPERTY_ALIAS, this.alias); + } + if (isSetAliasType) { + addIfNull(nulls, JSON_PROPERTY_ALIAS_TYPE, this.aliasType); + } + if (isSetAuthCode) { + addIfNull(nulls, JSON_PROPERTY_AUTH_CODE, this.authCode); + } + if (isSetAuthorisationMid) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISATION_MID, this.authorisationMid); + } + if (isSetAuthorisedAmountCurrency) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISED_AMOUNT_CURRENCY, this.authorisedAmountCurrency); + } + if (isSetAuthorisedAmountValue) { + addIfNull(nulls, JSON_PROPERTY_AUTHORISED_AMOUNT_VALUE, this.authorisedAmountValue); + } + if (isSetAvsResult) { + addIfNull(nulls, JSON_PROPERTY_AVS_RESULT, this.avsResult); + } + if (isSetAvsResultRaw) { + addIfNull(nulls, JSON_PROPERTY_AVS_RESULT_RAW, this.avsResultRaw); + } + if (isSetBic) { + addIfNull(nulls, JSON_PROPERTY_BIC, this.bic); + } + if (isSetCoBrandedWith) { + addIfNull(nulls, JSON_PROPERTY_CO_BRANDED_WITH, this.coBrandedWith); + } + if (isSetCvcResult) { + addIfNull(nulls, JSON_PROPERTY_CVC_RESULT, this.cvcResult); + } + if (isSetCvcResultRaw) { + addIfNull(nulls, JSON_PROPERTY_CVC_RESULT_RAW, this.cvcResultRaw); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetExpiryDate) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_DATE, this.expiryDate); + } + if (isSetExtraCostsCurrency) { + addIfNull(nulls, JSON_PROPERTY_EXTRA_COSTS_CURRENCY, this.extraCostsCurrency); + } + if (isSetExtraCostsValue) { + addIfNull(nulls, JSON_PROPERTY_EXTRA_COSTS_VALUE, this.extraCostsValue); + } + if (isSetFraudCheckItemNrFraudCheckname) { + addIfNull( + nulls, + JSON_PROPERTY_FRAUD_CHECK_ITEM_NR_FRAUD_CHECKNAME, + this.fraudCheckItemNrFraudCheckname); + } + if (isSetFraudManualReview) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_MANUAL_REVIEW, this.fraudManualReview); + } + if (isSetFraudResultType) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RESULT_TYPE, this.fraudResultType); + } + if (isSetFraudRiskLevel) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_RISK_LEVEL, this.fraudRiskLevel); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetFundsAvailability) { + addIfNull(nulls, JSON_PROPERTY_FUNDS_AVAILABILITY, this.fundsAvailability); + } + if (isSetInferredRefusalReason) { + addIfNull(nulls, JSON_PROPERTY_INFERRED_REFUSAL_REASON, this.inferredRefusalReason); + } + if (isSetIsCardCommercial) { + addIfNull(nulls, JSON_PROPERTY_IS_CARD_COMMERCIAL, this.isCardCommercial); + } + if (isSetIssuerCountry) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_COUNTRY, this.issuerCountry); + } + if (isSetLiabilityShift) { + addIfNull(nulls, JSON_PROPERTY_LIABILITY_SHIFT, this.liabilityShift); + } + if (isSetMcBankNetReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_MC_BANK_NET_REFERENCE_NUMBER, this.mcBankNetReferenceNumber); + } + if (isSetMerchantAdviceCode) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ADVICE_CODE, this.merchantAdviceCode); + } + if (isSetMerchantReference) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_REFERENCE, this.merchantReference); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetPaymentAccountReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_ACCOUNT_REFERENCE, this.paymentAccountReference); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetPaymentMethodVariant) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD_VARIANT, this.paymentMethodVariant); + } + if (isSetPayoutEligible) { + addIfNull(nulls, JSON_PROPERTY_PAYOUT_ELIGIBLE, this.payoutEligible); + } + if (isSetRealtimeAccountUpdaterStatus) { + addIfNull( + nulls, JSON_PROPERTY_REALTIME_ACCOUNT_UPDATER_STATUS, this.realtimeAccountUpdaterStatus); + } + if (isSetReceiptFreeText) { + addIfNull(nulls, JSON_PROPERTY_RECEIPT_FREE_TEXT, this.receiptFreeText); + } + if (isSetRecurringContractTypes) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_CONTRACT_TYPES, this.recurringContractTypes); + } + if (isSetRecurringFirstPspReference) { + addIfNull( + nulls, JSON_PROPERTY_RECURRING_FIRST_PSP_REFERENCE, this.recurringFirstPspReference); + } + if (isSetRecurringRecurringDetailReference) { + addIfNull( + nulls, + JSON_PROPERTY_RECURRING_RECURRING_DETAIL_REFERENCE, + this.recurringRecurringDetailReference); + } + if (isSetRecurringShopperReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_SHOPPER_REFERENCE, this.recurringShopperReference); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetReferred) { + addIfNull(nulls, JSON_PROPERTY_REFERRED, this.referred); + } + if (isSetRefusalReasonRaw) { + addIfNull(nulls, JSON_PROPERTY_REFUSAL_REASON_RAW, this.refusalReasonRaw); + } + if (isSetRequestAmount) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_AMOUNT, this.requestAmount); + } + if (isSetRequestCurrencyCode) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_CURRENCY_CODE, this.requestCurrencyCode); + } + if (isSetShopperInteraction) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_INTERACTION, this.shopperInteraction); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetTerminalId) { + addIfNull(nulls, JSON_PROPERTY_TERMINAL_ID, this.terminalId); + } + if (isSetThreeDAuthenticated) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED, this.threeDAuthenticated); + } + if (isSetThreeDAuthenticatedResponse) { + addIfNull( + nulls, JSON_PROPERTY_THREE_D_AUTHENTICATED_RESPONSE, this.threeDAuthenticatedResponse); + } + if (isSetThreeDOffered) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED, this.threeDOffered); + } + if (isSetThreeDOfferedResponse) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_OFFERED_RESPONSE, this.threeDOfferedResponse); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + if (isSetTokenizationShopperReference) { + addIfNull( + nulls, JSON_PROPERTY_TOKENIZATION_SHOPPER_REFERENCE, this.tokenizationShopperReference); + } + if (isSetTokenizationStoreOperationType) { + addIfNull( + nulls, + JSON_PROPERTY_TOKENIZATION_STORE_OPERATION_TYPE, + this.tokenizationStoreOperationType); + } + if (isSetTokenizationStoredPaymentMethodId) { + addIfNull( + nulls, + JSON_PROPERTY_TOKENIZATION_STORED_PAYMENT_METHOD_ID, + this.tokenizationStoredPaymentMethodId); + } + if (isSetVisaTransactionId) { + addIfNull(nulls, JSON_PROPERTY_VISA_TRANSACTION_ID, this.visaTransactionId); + } + if (isSetXid) { + addIfNull(nulls, JSON_PROPERTY_XID, this.xid); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataCommon given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java index 7471b0b53..fc4e02d16 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataDomesticError.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class ResponseAdditionalDataDomesticError { public static final String JSON_PROPERTY_DOMESTIC_REFUSAL_REASON_RAW = "domesticRefusalReasonRaw"; private String domesticRefusalReasonRaw; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDomesticRefusalReasonRaw = false; + public static final String JSON_PROPERTY_DOMESTIC_SHOPPER_ADVICE = "domesticShopperAdvice"; private String domesticShopperAdvice; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDomesticShopperAdvice = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataDomesticError() {} /** @@ -43,6 +57,7 @@ public ResponseAdditionalDataDomesticError() {} public ResponseAdditionalDataDomesticError domesticRefusalReasonRaw( String domesticRefusalReasonRaw) { this.domesticRefusalReasonRaw = domesticRefusalReasonRaw; + isSetDomesticRefusalReasonRaw = true; // mark as set return this; } @@ -70,6 +85,7 @@ public String getDomesticRefusalReasonRaw() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDomesticRefusalReasonRaw(String domesticRefusalReasonRaw) { this.domesticRefusalReasonRaw = domesticRefusalReasonRaw; + isSetDomesticRefusalReasonRaw = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setDomesticRefusalReasonRaw(String domesticRefusalReasonRaw) { */ public ResponseAdditionalDataDomesticError domesticShopperAdvice(String domesticShopperAdvice) { this.domesticShopperAdvice = domesticShopperAdvice; + isSetDomesticShopperAdvice = true; // mark as set return this; } @@ -110,6 +127,27 @@ public String getDomesticShopperAdvice() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDomesticShopperAdvice(String domesticShopperAdvice) { this.domesticShopperAdvice = domesticShopperAdvice; + isSetDomesticShopperAdvice = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataDomesticError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataDomesticError object is equal to o. */ @@ -127,12 +165,22 @@ public boolean equals(Object o) { this.domesticRefusalReasonRaw, responseAdditionalDataDomesticError.domesticRefusalReasonRaw) && Objects.equals( - this.domesticShopperAdvice, responseAdditionalDataDomesticError.domesticShopperAdvice); + this.isSetDomesticRefusalReasonRaw, + responseAdditionalDataDomesticError.isSetDomesticRefusalReasonRaw) + && Objects.equals( + this.domesticShopperAdvice, responseAdditionalDataDomesticError.domesticShopperAdvice) + && Objects.equals( + this.isSetDomesticShopperAdvice, + responseAdditionalDataDomesticError.isSetDomesticShopperAdvice); } @Override public int hashCode() { - return Objects.hash(domesticRefusalReasonRaw, domesticShopperAdvice); + return Objects.hash( + domesticRefusalReasonRaw, + isSetDomesticRefusalReasonRaw, + domesticShopperAdvice, + isSetDomesticShopperAdvice); } @Override @@ -159,6 +207,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDomesticRefusalReasonRaw) { + addIfNull(nulls, JSON_PROPERTY_DOMESTIC_REFUSAL_REASON_RAW, this.domesticRefusalReasonRaw); + } + if (isSetDomesticShopperAdvice) { + addIfNull(nulls, JSON_PROPERTY_DOMESTIC_SHOPPER_ADVICE, this.domesticShopperAdvice); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataDomesticError given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java index 2f4587e4c..79a1d4d2f 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataInstallments.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -46,56 +48,98 @@ public class ResponseAdditionalDataInstallments { "installmentPaymentData.installmentType"; private String installmentPaymentDataInstallmentType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataInstallmentType = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_ANNUAL_PERCENTAGE_RATE = "installmentPaymentData.option[itemNr].annualPercentageRate"; private String installmentPaymentDataOptionItemNrAnnualPercentageRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_FIRST_INSTALLMENT_AMOUNT = "installmentPaymentData.option[itemNr].firstInstallmentAmount"; private String installmentPaymentDataOptionItemNrFirstInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INSTALLMENT_FEE = "installmentPaymentData.option[itemNr].installmentFee"; private String installmentPaymentDataOptionItemNrInstallmentFee; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrInstallmentFee = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INTEREST_RATE = "installmentPaymentData.option[itemNr].interestRate"; private String installmentPaymentDataOptionItemNrInterestRate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrInterestRate = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MAXIMUM_NUMBER_OF_INSTALLMENTS = "installmentPaymentData.option[itemNr].maximumNumberOfInstallments"; private String installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MINIMUM_NUMBER_OF_INSTALLMENTS = "installmentPaymentData.option[itemNr].minimumNumberOfInstallments"; private String installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_NUMBER_OF_INSTALLMENTS = "installmentPaymentData.option[itemNr].numberOfInstallments"; private String installmentPaymentDataOptionItemNrNumberOfInstallments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_SUBSEQUENT_INSTALLMENT_AMOUNT = "installmentPaymentData.option[itemNr].subsequentInstallmentAmount"; private String installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_TOTAL_AMOUNT_DUE = "installmentPaymentData.option[itemNr].totalAmountDue"; private String installmentPaymentDataOptionItemNrTotalAmountDue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataOptionItemNrTotalAmountDue = false; + public static final String JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_PAYMENT_OPTIONS = "installmentPaymentData.paymentOptions"; private String installmentPaymentDataPaymentOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentPaymentDataPaymentOptions = false; + public static final String JSON_PROPERTY_INSTALLMENTS_VALUE = "installments.value"; private String installmentsValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallmentsValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataInstallments() {} /** @@ -109,6 +153,7 @@ public ResponseAdditionalDataInstallments() {} public ResponseAdditionalDataInstallments installmentPaymentDataInstallmentType( String installmentPaymentDataInstallmentType) { this.installmentPaymentDataInstallmentType = installmentPaymentDataInstallmentType; + isSetInstallmentPaymentDataInstallmentType = true; // mark as set return this; } @@ -135,6 +180,7 @@ public String getInstallmentPaymentDataInstallmentType() { public void setInstallmentPaymentDataInstallmentType( String installmentPaymentDataInstallmentType) { this.installmentPaymentDataInstallmentType = installmentPaymentDataInstallmentType; + isSetInstallmentPaymentDataInstallmentType = true; // mark as set } /** @@ -148,6 +194,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrAnnu String installmentPaymentDataOptionItemNrAnnualPercentageRate) { this.installmentPaymentDataOptionItemNrAnnualPercentageRate = installmentPaymentDataOptionItemNrAnnualPercentageRate; + isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate = true; // mark as set return this; } @@ -173,6 +220,7 @@ public void setInstallmentPaymentDataOptionItemNrAnnualPercentageRate( String installmentPaymentDataOptionItemNrAnnualPercentageRate) { this.installmentPaymentDataOptionItemNrAnnualPercentageRate = installmentPaymentDataOptionItemNrAnnualPercentageRate; + isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate = true; // mark as set } /** @@ -188,6 +236,7 @@ public void setInstallmentPaymentDataOptionItemNrAnnualPercentageRate( String installmentPaymentDataOptionItemNrFirstInstallmentAmount) { this.installmentPaymentDataOptionItemNrFirstInstallmentAmount = installmentPaymentDataOptionItemNrFirstInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount = true; // mark as set return this; } @@ -215,6 +264,7 @@ public void setInstallmentPaymentDataOptionItemNrFirstInstallmentAmount( String installmentPaymentDataOptionItemNrFirstInstallmentAmount) { this.installmentPaymentDataOptionItemNrFirstInstallmentAmount = installmentPaymentDataOptionItemNrFirstInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount = true; // mark as set } /** @@ -228,6 +278,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrInst String installmentPaymentDataOptionItemNrInstallmentFee) { this.installmentPaymentDataOptionItemNrInstallmentFee = installmentPaymentDataOptionItemNrInstallmentFee; + isSetInstallmentPaymentDataOptionItemNrInstallmentFee = true; // mark as set return this; } @@ -253,6 +304,7 @@ public void setInstallmentPaymentDataOptionItemNrInstallmentFee( String installmentPaymentDataOptionItemNrInstallmentFee) { this.installmentPaymentDataOptionItemNrInstallmentFee = installmentPaymentDataOptionItemNrInstallmentFee; + isSetInstallmentPaymentDataOptionItemNrInstallmentFee = true; // mark as set } /** @@ -266,6 +318,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrInte String installmentPaymentDataOptionItemNrInterestRate) { this.installmentPaymentDataOptionItemNrInterestRate = installmentPaymentDataOptionItemNrInterestRate; + isSetInstallmentPaymentDataOptionItemNrInterestRate = true; // mark as set return this; } @@ -292,6 +345,7 @@ public void setInstallmentPaymentDataOptionItemNrInterestRate( String installmentPaymentDataOptionItemNrInterestRate) { this.installmentPaymentDataOptionItemNrInterestRate = installmentPaymentDataOptionItemNrInterestRate; + isSetInstallmentPaymentDataOptionItemNrInterestRate = true; // mark as set } /** @@ -307,6 +361,7 @@ public void setInstallmentPaymentDataOptionItemNrInterestRate( String installmentPaymentDataOptionItemNrMaximumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = true; // mark as set return this; } @@ -336,6 +391,7 @@ public void setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments( String installmentPaymentDataOptionItemNrMaximumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments = installmentPaymentDataOptionItemNrMaximumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments = true; // mark as set } /** @@ -351,6 +407,7 @@ public void setInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments( String installmentPaymentDataOptionItemNrMinimumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = true; // mark as set return this; } @@ -380,6 +437,7 @@ public void setInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments( String installmentPaymentDataOptionItemNrMinimumNumberOfInstallments) { this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments = installmentPaymentDataOptionItemNrMinimumNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments = true; // mark as set } /** @@ -394,6 +452,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrNumb String installmentPaymentDataOptionItemNrNumberOfInstallments) { this.installmentPaymentDataOptionItemNrNumberOfInstallments = installmentPaymentDataOptionItemNrNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments = true; // mark as set return this; } @@ -421,6 +480,7 @@ public void setInstallmentPaymentDataOptionItemNrNumberOfInstallments( String installmentPaymentDataOptionItemNrNumberOfInstallments) { this.installmentPaymentDataOptionItemNrNumberOfInstallments = installmentPaymentDataOptionItemNrNumberOfInstallments; + isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments = true; // mark as set } /** @@ -436,6 +496,7 @@ public void setInstallmentPaymentDataOptionItemNrNumberOfInstallments( String installmentPaymentDataOptionItemNrSubsequentInstallmentAmount) { this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = true; // mark as set return this; } @@ -463,6 +524,7 @@ public void setInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount( String installmentPaymentDataOptionItemNrSubsequentInstallmentAmount) { this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount = installmentPaymentDataOptionItemNrSubsequentInstallmentAmount; + isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount = true; // mark as set } /** @@ -476,6 +538,7 @@ public ResponseAdditionalDataInstallments installmentPaymentDataOptionItemNrTota String installmentPaymentDataOptionItemNrTotalAmountDue) { this.installmentPaymentDataOptionItemNrTotalAmountDue = installmentPaymentDataOptionItemNrTotalAmountDue; + isSetInstallmentPaymentDataOptionItemNrTotalAmountDue = true; // mark as set return this; } @@ -501,6 +564,7 @@ public void setInstallmentPaymentDataOptionItemNrTotalAmountDue( String installmentPaymentDataOptionItemNrTotalAmountDue) { this.installmentPaymentDataOptionItemNrTotalAmountDue = installmentPaymentDataOptionItemNrTotalAmountDue; + isSetInstallmentPaymentDataOptionItemNrTotalAmountDue = true; // mark as set } /** @@ -514,6 +578,7 @@ public void setInstallmentPaymentDataOptionItemNrTotalAmountDue( public ResponseAdditionalDataInstallments installmentPaymentDataPaymentOptions( String installmentPaymentDataPaymentOptions) { this.installmentPaymentDataPaymentOptions = installmentPaymentDataPaymentOptions; + isSetInstallmentPaymentDataPaymentOptions = true; // mark as set return this; } @@ -539,6 +604,7 @@ public String getInstallmentPaymentDataPaymentOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentPaymentDataPaymentOptions(String installmentPaymentDataPaymentOptions) { this.installmentPaymentDataPaymentOptions = installmentPaymentDataPaymentOptions; + isSetInstallmentPaymentDataPaymentOptions = true; // mark as set } /** @@ -553,6 +619,7 @@ public void setInstallmentPaymentDataPaymentOptions(String installmentPaymentDat */ public ResponseAdditionalDataInstallments installmentsValue(String installmentsValue) { this.installmentsValue = installmentsValue; + isSetInstallmentsValue = true; // mark as set return this; } @@ -582,6 +649,27 @@ public String getInstallmentsValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setInstallmentsValue(String installmentsValue) { this.installmentsValue = installmentsValue; + isSetInstallmentsValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataInstallments includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataInstallments object is equal to o. */ @@ -598,61 +686,116 @@ public boolean equals(Object o) { return Objects.equals( this.installmentPaymentDataInstallmentType, responseAdditionalDataInstallments.installmentPaymentDataInstallmentType) + && Objects.equals( + this.isSetInstallmentPaymentDataInstallmentType, + responseAdditionalDataInstallments.isSetInstallmentPaymentDataInstallmentType) && Objects.equals( this.installmentPaymentDataOptionItemNrAnnualPercentageRate, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrAnnualPercentageRate) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate) && Objects.equals( this.installmentPaymentDataOptionItemNrFirstInstallmentAmount, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrFirstInstallmentAmount) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount) && Objects.equals( this.installmentPaymentDataOptionItemNrInstallmentFee, responseAdditionalDataInstallments.installmentPaymentDataOptionItemNrInstallmentFee) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrInstallmentFee, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrInstallmentFee) && Objects.equals( this.installmentPaymentDataOptionItemNrInterestRate, responseAdditionalDataInstallments.installmentPaymentDataOptionItemNrInterestRate) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrInterestRate, + responseAdditionalDataInstallments.isSetInstallmentPaymentDataOptionItemNrInterestRate) && Objects.equals( this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrMaximumNumberOfInstallments) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments) && Objects.equals( this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrMinimumNumberOfInstallments) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments) && Objects.equals( this.installmentPaymentDataOptionItemNrNumberOfInstallments, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrNumberOfInstallments) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments) && Objects.equals( this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount, responseAdditionalDataInstallments .installmentPaymentDataOptionItemNrSubsequentInstallmentAmount) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount) && Objects.equals( this.installmentPaymentDataOptionItemNrTotalAmountDue, responseAdditionalDataInstallments.installmentPaymentDataOptionItemNrTotalAmountDue) + && Objects.equals( + this.isSetInstallmentPaymentDataOptionItemNrTotalAmountDue, + responseAdditionalDataInstallments + .isSetInstallmentPaymentDataOptionItemNrTotalAmountDue) && Objects.equals( this.installmentPaymentDataPaymentOptions, responseAdditionalDataInstallments.installmentPaymentDataPaymentOptions) && Objects.equals( - this.installmentsValue, responseAdditionalDataInstallments.installmentsValue); + this.isSetInstallmentPaymentDataPaymentOptions, + responseAdditionalDataInstallments.isSetInstallmentPaymentDataPaymentOptions) + && Objects.equals( + this.installmentsValue, responseAdditionalDataInstallments.installmentsValue) + && Objects.equals( + this.isSetInstallmentsValue, responseAdditionalDataInstallments.isSetInstallmentsValue); } @Override public int hashCode() { return Objects.hash( installmentPaymentDataInstallmentType, + isSetInstallmentPaymentDataInstallmentType, installmentPaymentDataOptionItemNrAnnualPercentageRate, + isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate, installmentPaymentDataOptionItemNrFirstInstallmentAmount, + isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount, installmentPaymentDataOptionItemNrInstallmentFee, + isSetInstallmentPaymentDataOptionItemNrInstallmentFee, installmentPaymentDataOptionItemNrInterestRate, + isSetInstallmentPaymentDataOptionItemNrInterestRate, installmentPaymentDataOptionItemNrMaximumNumberOfInstallments, + isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments, installmentPaymentDataOptionItemNrMinimumNumberOfInstallments, + isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments, installmentPaymentDataOptionItemNrNumberOfInstallments, + isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments, installmentPaymentDataOptionItemNrSubsequentInstallmentAmount, + isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount, installmentPaymentDataOptionItemNrTotalAmountDue, + isSetInstallmentPaymentDataOptionItemNrTotalAmountDue, installmentPaymentDataPaymentOptions, - installmentsValue); + isSetInstallmentPaymentDataPaymentOptions, + installmentsValue, + isSetInstallmentsValue); } @Override @@ -707,6 +850,96 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetInstallmentPaymentDataInstallmentType) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_INSTALLMENT_TYPE, + this.installmentPaymentDataInstallmentType); + } + if (isSetInstallmentPaymentDataOptionItemNrAnnualPercentageRate) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_ANNUAL_PERCENTAGE_RATE, + this.installmentPaymentDataOptionItemNrAnnualPercentageRate); + } + if (isSetInstallmentPaymentDataOptionItemNrFirstInstallmentAmount) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_FIRST_INSTALLMENT_AMOUNT, + this.installmentPaymentDataOptionItemNrFirstInstallmentAmount); + } + if (isSetInstallmentPaymentDataOptionItemNrInstallmentFee) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INSTALLMENT_FEE, + this.installmentPaymentDataOptionItemNrInstallmentFee); + } + if (isSetInstallmentPaymentDataOptionItemNrInterestRate) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_INTEREST_RATE, + this.installmentPaymentDataOptionItemNrInterestRate); + } + if (isSetInstallmentPaymentDataOptionItemNrMaximumNumberOfInstallments) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MAXIMUM_NUMBER_OF_INSTALLMENTS, + this.installmentPaymentDataOptionItemNrMaximumNumberOfInstallments); + } + if (isSetInstallmentPaymentDataOptionItemNrMinimumNumberOfInstallments) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_MINIMUM_NUMBER_OF_INSTALLMENTS, + this.installmentPaymentDataOptionItemNrMinimumNumberOfInstallments); + } + if (isSetInstallmentPaymentDataOptionItemNrNumberOfInstallments) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_NUMBER_OF_INSTALLMENTS, + this.installmentPaymentDataOptionItemNrNumberOfInstallments); + } + if (isSetInstallmentPaymentDataOptionItemNrSubsequentInstallmentAmount) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_SUBSEQUENT_INSTALLMENT_AMOUNT, + this.installmentPaymentDataOptionItemNrSubsequentInstallmentAmount); + } + if (isSetInstallmentPaymentDataOptionItemNrTotalAmountDue) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_OPTION_ITEM_NR_TOTAL_AMOUNT_DUE, + this.installmentPaymentDataOptionItemNrTotalAmountDue); + } + if (isSetInstallmentPaymentDataPaymentOptions) { + addIfNull( + nulls, + JSON_PROPERTY_INSTALLMENT_PAYMENT_DATA_PAYMENT_OPTIONS, + this.installmentPaymentDataPaymentOptions); + } + if (isSetInstallmentsValue) { + addIfNull(nulls, JSON_PROPERTY_INSTALLMENTS_VALUE, this.installmentsValue); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataInstallments given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java index 61ecf202c..a480a0def 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataNetworkTokens.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,13 +29,28 @@ public class ResponseAdditionalDataNetworkTokens { public static final String JSON_PROPERTY_NETWORK_TOKEN_AVAILABLE = "networkToken.available"; private String networkTokenAvailable; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokenAvailable = false; + public static final String JSON_PROPERTY_NETWORK_TOKEN_BIN = "networkToken.bin"; private String networkTokenBin; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokenBin = false; + public static final String JSON_PROPERTY_NETWORK_TOKEN_TOKEN_SUMMARY = "networkToken.tokenSummary"; private String networkTokenTokenSummary; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTokenTokenSummary = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataNetworkTokens() {} /** @@ -46,6 +63,7 @@ public ResponseAdditionalDataNetworkTokens() {} */ public ResponseAdditionalDataNetworkTokens networkTokenAvailable(String networkTokenAvailable) { this.networkTokenAvailable = networkTokenAvailable; + isSetNetworkTokenAvailable = true; // mark as set return this; } @@ -71,6 +89,7 @@ public String getNetworkTokenAvailable() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokenAvailable(String networkTokenAvailable) { this.networkTokenAvailable = networkTokenAvailable; + isSetNetworkTokenAvailable = true; // mark as set } /** @@ -84,6 +103,7 @@ public void setNetworkTokenAvailable(String networkTokenAvailable) { */ public ResponseAdditionalDataNetworkTokens networkTokenBin(String networkTokenBin) { this.networkTokenBin = networkTokenBin; + isSetNetworkTokenBin = true; // mark as set return this; } @@ -111,6 +131,7 @@ public String getNetworkTokenBin() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokenBin(String networkTokenBin) { this.networkTokenBin = networkTokenBin; + isSetNetworkTokenBin = true; // mark as set } /** @@ -123,6 +144,7 @@ public void setNetworkTokenBin(String networkTokenBin) { public ResponseAdditionalDataNetworkTokens networkTokenTokenSummary( String networkTokenTokenSummary) { this.networkTokenTokenSummary = networkTokenTokenSummary; + isSetNetworkTokenTokenSummary = true; // mark as set return this; } @@ -146,6 +168,27 @@ public String getNetworkTokenTokenSummary() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTokenTokenSummary(String networkTokenTokenSummary) { this.networkTokenTokenSummary = networkTokenTokenSummary; + isSetNetworkTokenTokenSummary = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataNetworkTokens includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataNetworkTokens object is equal to o. */ @@ -161,15 +204,29 @@ public boolean equals(Object o) { (ResponseAdditionalDataNetworkTokens) o; return Objects.equals( this.networkTokenAvailable, responseAdditionalDataNetworkTokens.networkTokenAvailable) + && Objects.equals( + this.isSetNetworkTokenAvailable, + responseAdditionalDataNetworkTokens.isSetNetworkTokenAvailable) && Objects.equals(this.networkTokenBin, responseAdditionalDataNetworkTokens.networkTokenBin) + && Objects.equals( + this.isSetNetworkTokenBin, responseAdditionalDataNetworkTokens.isSetNetworkTokenBin) && Objects.equals( this.networkTokenTokenSummary, - responseAdditionalDataNetworkTokens.networkTokenTokenSummary); + responseAdditionalDataNetworkTokens.networkTokenTokenSummary) + && Objects.equals( + this.isSetNetworkTokenTokenSummary, + responseAdditionalDataNetworkTokens.isSetNetworkTokenTokenSummary); } @Override public int hashCode() { - return Objects.hash(networkTokenAvailable, networkTokenBin, networkTokenTokenSummary); + return Objects.hash( + networkTokenAvailable, + isSetNetworkTokenAvailable, + networkTokenBin, + isSetNetworkTokenBin, + networkTokenTokenSummary, + isSetNetworkTokenTokenSummary); } @Override @@ -197,6 +254,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetNetworkTokenAvailable) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN_AVAILABLE, this.networkTokenAvailable); + } + if (isSetNetworkTokenBin) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN_BIN, this.networkTokenBin); + } + if (isSetNetworkTokenTokenSummary) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN_TOKEN_SUMMARY, this.networkTokenTokenSummary); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataNetworkTokens given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java index 3729a6abc..ea635ef08 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataOpi.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ResponseAdditionalDataOpi { public static final String JSON_PROPERTY_OPI_TRANS_TOKEN = "opi.transToken"; private String opiTransToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpiTransToken = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataOpi() {} /** @@ -41,6 +52,7 @@ public ResponseAdditionalDataOpi() {} */ public ResponseAdditionalDataOpi opiTransToken(String opiTransToken) { this.opiTransToken = opiTransToken; + isSetOpiTransToken = true; // mark as set return this; } @@ -80,6 +92,27 @@ public String getOpiTransToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpiTransToken(String opiTransToken) { this.opiTransToken = opiTransToken; + isSetOpiTransToken = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataOpi includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataOpi object is equal to o. */ @@ -92,12 +125,13 @@ public boolean equals(Object o) { return false; } ResponseAdditionalDataOpi responseAdditionalDataOpi = (ResponseAdditionalDataOpi) o; - return Objects.equals(this.opiTransToken, responseAdditionalDataOpi.opiTransToken); + return Objects.equals(this.opiTransToken, responseAdditionalDataOpi.opiTransToken) + && Objects.equals(this.isSetOpiTransToken, responseAdditionalDataOpi.isSetOpiTransToken); } @Override public int hashCode() { - return Objects.hash(opiTransToken); + return Objects.hash(opiTransToken, isSetOpiTransToken); } @Override @@ -119,6 +153,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOpiTransToken) { + addIfNull(nulls, JSON_PROPERTY_OPI_TRANS_TOKEN, this.opiTransToken); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataOpi given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java index 033d6db99..ec472b6a3 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSepa.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,17 +31,35 @@ public class ResponseAdditionalDataSepa { "sepadirectdebit.dateOfSignature"; private String sepadirectdebitDateOfSignature; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitDateOfSignature = false; + public static final String JSON_PROPERTY_SEPADIRECTDEBIT_MANDATE_ID = "sepadirectdebit.mandateId"; private String sepadirectdebitMandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitMandateId = false; + public static final String JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE = "sepadirectdebit.sepadirectdebit.dueDate"; private String sepadirectdebitSepadirectdebitDueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitSepadirectdebitDueDate = false; + public static final String JSON_PROPERTY_SEPADIRECTDEBIT_SEQUENCE_TYPE = "sepadirectdebit.sequenceType"; private String sepadirectdebitSequenceType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSepadirectdebitSequenceType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataSepa() {} /** @@ -51,6 +71,7 @@ public ResponseAdditionalDataSepa() {} public ResponseAdditionalDataSepa sepadirectdebitDateOfSignature( String sepadirectdebitDateOfSignature) { this.sepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; + isSetSepadirectdebitDateOfSignature = true; // mark as set return this; } @@ -74,6 +95,7 @@ public String getSepadirectdebitDateOfSignature() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitDateOfSignature(String sepadirectdebitDateOfSignature) { this.sepadirectdebitDateOfSignature = sepadirectdebitDateOfSignature; + isSetSepadirectdebitDateOfSignature = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setSepadirectdebitDateOfSignature(String sepadirectdebitDateOfSignat */ public ResponseAdditionalDataSepa sepadirectdebitMandateId(String sepadirectdebitMandateId) { this.sepadirectdebitMandateId = sepadirectdebitMandateId; + isSetSepadirectdebitMandateId = true; // mark as set return this; } @@ -110,6 +133,7 @@ public String getSepadirectdebitMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitMandateId(String sepadirectdebitMandateId) { this.sepadirectdebitMandateId = sepadirectdebitMandateId; + isSetSepadirectdebitMandateId = true; // mark as set } /** @@ -122,6 +146,7 @@ public void setSepadirectdebitMandateId(String sepadirectdebitMandateId) { public ResponseAdditionalDataSepa sepadirectdebitSepadirectdebitDueDate( String sepadirectdebitSepadirectdebitDueDate) { this.sepadirectdebitSepadirectdebitDueDate = sepadirectdebitSepadirectdebitDueDate; + isSetSepadirectdebitSepadirectdebitDueDate = true; // mark as set return this; } @@ -148,6 +173,7 @@ public String getSepadirectdebitSepadirectdebitDueDate() { public void setSepadirectdebitSepadirectdebitDueDate( String sepadirectdebitSepadirectdebitDueDate) { this.sepadirectdebitSepadirectdebitDueDate = sepadirectdebitSepadirectdebitDueDate; + isSetSepadirectdebitSepadirectdebitDueDate = true; // mark as set } /** @@ -168,6 +194,7 @@ public void setSepadirectdebitSepadirectdebitDueDate( public ResponseAdditionalDataSepa sepadirectdebitSequenceType( String sepadirectdebitSequenceType) { this.sepadirectdebitSequenceType = sepadirectdebitSequenceType; + isSetSepadirectdebitSequenceType = true; // mark as set return this; } @@ -209,6 +236,27 @@ public String getSepadirectdebitSequenceType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSepadirectdebitSequenceType(String sepadirectdebitSequenceType) { this.sepadirectdebitSequenceType = sepadirectdebitSequenceType; + isSetSepadirectdebitSequenceType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataSepa includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataSepa object is equal to o. */ @@ -224,23 +272,39 @@ public boolean equals(Object o) { return Objects.equals( this.sepadirectdebitDateOfSignature, responseAdditionalDataSepa.sepadirectdebitDateOfSignature) + && Objects.equals( + this.isSetSepadirectdebitDateOfSignature, + responseAdditionalDataSepa.isSetSepadirectdebitDateOfSignature) && Objects.equals( this.sepadirectdebitMandateId, responseAdditionalDataSepa.sepadirectdebitMandateId) + && Objects.equals( + this.isSetSepadirectdebitMandateId, + responseAdditionalDataSepa.isSetSepadirectdebitMandateId) && Objects.equals( this.sepadirectdebitSepadirectdebitDueDate, responseAdditionalDataSepa.sepadirectdebitSepadirectdebitDueDate) + && Objects.equals( + this.isSetSepadirectdebitSepadirectdebitDueDate, + responseAdditionalDataSepa.isSetSepadirectdebitSepadirectdebitDueDate) && Objects.equals( this.sepadirectdebitSequenceType, - responseAdditionalDataSepa.sepadirectdebitSequenceType); + responseAdditionalDataSepa.sepadirectdebitSequenceType) + && Objects.equals( + this.isSetSepadirectdebitSequenceType, + responseAdditionalDataSepa.isSetSepadirectdebitSequenceType); } @Override public int hashCode() { return Objects.hash( sepadirectdebitDateOfSignature, + isSetSepadirectdebitDateOfSignature, sepadirectdebitMandateId, + isSetSepadirectdebitMandateId, sepadirectdebitSepadirectdebitDueDate, - sepadirectdebitSequenceType); + isSetSepadirectdebitSepadirectdebitDueDate, + sepadirectdebitSequenceType, + isSetSepadirectdebitSequenceType); } @Override @@ -273,6 +337,46 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSepadirectdebitDateOfSignature) { + addIfNull( + nulls, + JSON_PROPERTY_SEPADIRECTDEBIT_DATE_OF_SIGNATURE, + this.sepadirectdebitDateOfSignature); + } + if (isSetSepadirectdebitMandateId) { + addIfNull(nulls, JSON_PROPERTY_SEPADIRECTDEBIT_MANDATE_ID, this.sepadirectdebitMandateId); + } + if (isSetSepadirectdebitSepadirectdebitDueDate) { + addIfNull( + nulls, + JSON_PROPERTY_SEPADIRECTDEBIT_SEPADIRECTDEBIT_DUE_DATE, + this.sepadirectdebitSepadirectdebitDueDate); + } + if (isSetSepadirectdebitSequenceType) { + addIfNull( + nulls, JSON_PROPERTY_SEPADIRECTDEBIT_SEQUENCE_TYPE, this.sepadirectdebitSequenceType); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataSepa given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java index d359fa625..2459d70c5 100644 --- a/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java +++ b/src/main/java/com/adyen/model/checkout/ResponseAdditionalDataSwish.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class ResponseAdditionalDataSwish { public static final String JSON_PROPERTY_SWISH_PAYER_ALIAS = "swish.payerAlias"; private String swishPayerAlias; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSwishPayerAlias = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponseAdditionalDataSwish() {} /** @@ -33,6 +44,7 @@ public ResponseAdditionalDataSwish() {} */ public ResponseAdditionalDataSwish swishPayerAlias(String swishPayerAlias) { this.swishPayerAlias = swishPayerAlias; + isSetSwishPayerAlias = true; // mark as set return this; } @@ -56,6 +68,27 @@ public String getSwishPayerAlias() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSwishPayerAlias(String swishPayerAlias) { this.swishPayerAlias = swishPayerAlias; + isSetSwishPayerAlias = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponseAdditionalDataSwish includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponseAdditionalDataSwish object is equal to o. */ @@ -68,12 +101,14 @@ public boolean equals(Object o) { return false; } ResponseAdditionalDataSwish responseAdditionalDataSwish = (ResponseAdditionalDataSwish) o; - return Objects.equals(this.swishPayerAlias, responseAdditionalDataSwish.swishPayerAlias); + return Objects.equals(this.swishPayerAlias, responseAdditionalDataSwish.swishPayerAlias) + && Objects.equals( + this.isSetSwishPayerAlias, responseAdditionalDataSwish.isSetSwishPayerAlias); } @Override public int hashCode() { - return Objects.hash(swishPayerAlias); + return Objects.hash(swishPayerAlias, isSetSwishPayerAlias); } @Override @@ -95,6 +130,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetSwishPayerAlias) { + addIfNull(nulls, JSON_PROPERTY_SWISH_PAYER_ALIAS, this.swishPayerAlias); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponseAdditionalDataSwish given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java b/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java index 0d1d63ca3..ee1bb9941 100644 --- a/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/ResponsePaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class ResponsePaymentMethod { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ResponsePaymentMethod() {} /** @@ -41,6 +55,7 @@ public ResponsePaymentMethod() {} */ public ResponsePaymentMethod brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -68,6 +83,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -78,6 +94,7 @@ public void setBrand(String brand) { */ public ResponsePaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -101,6 +118,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ResponsePaymentMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ResponsePaymentMethod object is equal to o. */ @@ -114,12 +152,14 @@ public boolean equals(Object o) { } ResponsePaymentMethod responsePaymentMethod = (ResponsePaymentMethod) o; return Objects.equals(this.brand, responsePaymentMethod.brand) - && Objects.equals(this.type, responsePaymentMethod.type); + && Objects.equals(this.isSetBrand, responsePaymentMethod.isSetBrand) + && Objects.equals(this.type, responsePaymentMethod.type) + && Objects.equals(this.isSetType, responsePaymentMethod.isSetType); } @Override public int hashCode() { - return Objects.hash(brand, type); + return Objects.hash(brand, isSetBrand, type, isSetType); } @Override @@ -142,6 +182,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ResponsePaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RiskData.java b/src/main/java/com/adyen/model/checkout/RiskData.java index b9c430932..77d6f91c9 100644 --- a/src/main/java/com/adyen/model/checkout/RiskData.java +++ b/src/main/java/com/adyen/model/checkout/RiskData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -30,15 +32,33 @@ public class RiskData { public static final String JSON_PROPERTY_CLIENT_DATA = "clientData"; private String clientData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClientData = false; + public static final String JSON_PROPERTY_CUSTOM_FIELDS = "customFields"; private Map customFields; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCustomFields = false; + public static final String JSON_PROPERTY_FRAUD_OFFSET = "fraudOffset"; private Integer fraudOffset; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFraudOffset = false; + public static final String JSON_PROPERTY_PROFILE_REFERENCE = "profileReference"; private String profileReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProfileReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RiskData() {} /** @@ -50,6 +70,7 @@ public RiskData() {} */ public RiskData clientData(String clientData) { this.clientData = clientData; + isSetClientData = true; // mark as set return this; } @@ -75,6 +96,7 @@ public String getClientData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClientData(String clientData) { this.clientData = clientData; + isSetClientData = true; // mark as set } /** @@ -85,6 +107,7 @@ public void setClientData(String clientData) { */ public RiskData customFields(Map customFields) { this.customFields = customFields; + isSetCustomFields = true; // mark as set return this; } @@ -116,6 +139,7 @@ public Map getCustomFields() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCustomFields(Map customFields) { this.customFields = customFields; + isSetCustomFields = true; // mark as set } /** @@ -128,6 +152,7 @@ public void setCustomFields(Map customFields) { */ public RiskData fraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set return this; } @@ -155,6 +180,7 @@ public Integer getFraudOffset() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFraudOffset(Integer fraudOffset) { this.fraudOffset = fraudOffset; + isSetFraudOffset = true; // mark as set } /** @@ -167,6 +193,7 @@ public void setFraudOffset(Integer fraudOffset) { */ public RiskData profileReference(String profileReference) { this.profileReference = profileReference; + isSetProfileReference = true; // mark as set return this; } @@ -194,6 +221,27 @@ public String getProfileReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProfileReference(String profileReference) { this.profileReference = profileReference; + isSetProfileReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RiskData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RiskData object is equal to o. */ @@ -207,14 +255,26 @@ public boolean equals(Object o) { } RiskData riskData = (RiskData) o; return Objects.equals(this.clientData, riskData.clientData) + && Objects.equals(this.isSetClientData, riskData.isSetClientData) && Objects.equals(this.customFields, riskData.customFields) + && Objects.equals(this.isSetCustomFields, riskData.isSetCustomFields) && Objects.equals(this.fraudOffset, riskData.fraudOffset) - && Objects.equals(this.profileReference, riskData.profileReference); + && Objects.equals(this.isSetFraudOffset, riskData.isSetFraudOffset) + && Objects.equals(this.profileReference, riskData.profileReference) + && Objects.equals(this.isSetProfileReference, riskData.isSetProfileReference); } @Override public int hashCode() { - return Objects.hash(clientData, customFields, fraudOffset, profileReference); + return Objects.hash( + clientData, + isSetClientData, + customFields, + isSetCustomFields, + fraudOffset, + isSetFraudOffset, + profileReference, + isSetProfileReference); } @Override @@ -239,6 +299,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetClientData) { + addIfNull(nulls, JSON_PROPERTY_CLIENT_DATA, this.clientData); + } + if (isSetCustomFields) { + addIfNull(nulls, JSON_PROPERTY_CUSTOM_FIELDS, this.customFields); + } + if (isSetFraudOffset) { + addIfNull(nulls, JSON_PROPERTY_FRAUD_OFFSET, this.fraudOffset); + } + if (isSetProfileReference) { + addIfNull(nulls, JSON_PROPERTY_PROFILE_REFERENCE, this.profileReference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RiskData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/RivertyDetails.java b/src/main/java/com/adyen/model/checkout/RivertyDetails.java index 68c495cae..95ccd69f7 100644 --- a/src/main/java/com/adyen/model/checkout/RivertyDetails.java +++ b/src/main/java/com/adyen/model/checkout/RivertyDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -39,34 +41,64 @@ public class RivertyDetails { public static final String JSON_PROPERTY_BILLING_ADDRESS = "billingAddress"; private String billingAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAddress = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DELIVERY_ADDRESS = "deliveryAddress"; private String deliveryAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeliveryAddress = false; + public static final String JSON_PROPERTY_DEVICE_FINGERPRINT = "deviceFingerprint"; private String deviceFingerprint; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceFingerprint = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_PERSONAL_DETAILS = "personalDetails"; private String personalDetails; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPersonalDetails = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** **riverty** */ public enum TypeEnum { RIVERTY(String.valueOf("riverty")), @@ -115,6 +147,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public RivertyDetails() {} /** @@ -125,6 +166,7 @@ public RivertyDetails() {} */ public RivertyDetails billingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set return this; } @@ -148,6 +190,7 @@ public String getBillingAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAddress(String billingAddress) { this.billingAddress = billingAddress; + isSetBillingAddress = true; // mark as set } /** @@ -158,6 +201,7 @@ public void setBillingAddress(String billingAddress) { */ public RivertyDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -181,6 +225,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -191,6 +236,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public RivertyDetails deliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set return this; } @@ -214,6 +260,7 @@ public String getDeliveryAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeliveryAddress(String deliveryAddress) { this.deliveryAddress = deliveryAddress; + isSetDeliveryAddress = true; // mark as set } /** @@ -227,6 +274,7 @@ public void setDeliveryAddress(String deliveryAddress) { */ public RivertyDetails deviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set return this; } @@ -256,6 +304,7 @@ public String getDeviceFingerprint() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceFingerprint(String deviceFingerprint) { this.deviceFingerprint = deviceFingerprint; + isSetDeviceFingerprint = true; // mark as set } /** @@ -266,6 +315,7 @@ public void setDeviceFingerprint(String deviceFingerprint) { */ public RivertyDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -289,6 +339,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -299,6 +350,7 @@ public void setIban(String iban) { */ public RivertyDetails personalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set return this; } @@ -322,6 +374,7 @@ public String getPersonalDetails() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPersonalDetails(String personalDetails) { this.personalDetails = personalDetails; + isSetPersonalDetails = true; // mark as set } /** @@ -336,6 +389,7 @@ public void setPersonalDetails(String personalDetails) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public RivertyDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -367,6 +421,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -377,6 +432,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public RivertyDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -401,6 +457,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -413,6 +470,7 @@ public void setSdkData(String sdkData) { */ public RivertyDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -440,6 +498,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -450,6 +509,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public RivertyDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -473,6 +533,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -483,6 +544,7 @@ public void setSubtype(String subtype) { */ public RivertyDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -506,6 +568,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public RivertyDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this RivertyDetails object is equal to o. */ @@ -519,32 +602,56 @@ public boolean equals(Object o) { } RivertyDetails rivertyDetails = (RivertyDetails) o; return Objects.equals(this.billingAddress, rivertyDetails.billingAddress) + && Objects.equals(this.isSetBillingAddress, rivertyDetails.isSetBillingAddress) && Objects.equals(this.checkoutAttemptId, rivertyDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, rivertyDetails.isSetCheckoutAttemptId) && Objects.equals(this.deliveryAddress, rivertyDetails.deliveryAddress) + && Objects.equals(this.isSetDeliveryAddress, rivertyDetails.isSetDeliveryAddress) && Objects.equals(this.deviceFingerprint, rivertyDetails.deviceFingerprint) + && Objects.equals(this.isSetDeviceFingerprint, rivertyDetails.isSetDeviceFingerprint) && Objects.equals(this.iban, rivertyDetails.iban) + && Objects.equals(this.isSetIban, rivertyDetails.isSetIban) && Objects.equals(this.personalDetails, rivertyDetails.personalDetails) + && Objects.equals(this.isSetPersonalDetails, rivertyDetails.isSetPersonalDetails) && Objects.equals(this.recurringDetailReference, rivertyDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, rivertyDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, rivertyDetails.sdkData) + && Objects.equals(this.isSetSdkData, rivertyDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, rivertyDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, rivertyDetails.isSetStoredPaymentMethodId) && Objects.equals(this.subtype, rivertyDetails.subtype) - && Objects.equals(this.type, rivertyDetails.type); + && Objects.equals(this.isSetSubtype, rivertyDetails.isSetSubtype) + && Objects.equals(this.type, rivertyDetails.type) + && Objects.equals(this.isSetType, rivertyDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingAddress, + isSetBillingAddress, checkoutAttemptId, + isSetCheckoutAttemptId, deliveryAddress, + isSetDeliveryAddress, deviceFingerprint, + isSetDeviceFingerprint, iban, + isSetIban, personalDetails, + isSetPersonalDetails, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, subtype, - type); + isSetSubtype, + type, + isSetType); } @Override @@ -580,6 +687,60 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingAddress) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ADDRESS, this.billingAddress); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDeliveryAddress) { + addIfNull(nulls, JSON_PROPERTY_DELIVERY_ADDRESS, this.deliveryAddress); + } + if (isSetDeviceFingerprint) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_FINGERPRINT, this.deviceFingerprint); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetPersonalDetails) { + addIfNull(nulls, JSON_PROPERTY_PERSONAL_DETAILS, this.personalDetails); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of RivertyDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java b/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java index 547873cbf..4aadbca2e 100644 --- a/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java +++ b/src/main/java/com/adyen/model/checkout/SDKEphemPubKey.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,15 +30,33 @@ public class SDKEphemPubKey { public static final String JSON_PROPERTY_CRV = "crv"; private String crv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCrv = false; + public static final String JSON_PROPERTY_KTY = "kty"; private String kty; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKty = false; + public static final String JSON_PROPERTY_X = "x"; private String x; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetX = false; + public static final String JSON_PROPERTY_Y = "y"; private String y; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetY = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SDKEphemPubKey() {} /** @@ -47,6 +67,7 @@ public SDKEphemPubKey() {} */ public SDKEphemPubKey crv(String crv) { this.crv = crv; + isSetCrv = true; // mark as set return this; } @@ -70,6 +91,7 @@ public String getCrv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCrv(String crv) { this.crv = crv; + isSetCrv = true; // mark as set } /** @@ -80,6 +102,7 @@ public void setCrv(String crv) { */ public SDKEphemPubKey kty(String kty) { this.kty = kty; + isSetKty = true; // mark as set return this; } @@ -103,6 +126,7 @@ public String getKty() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setKty(String kty) { this.kty = kty; + isSetKty = true; // mark as set } /** @@ -113,6 +137,7 @@ public void setKty(String kty) { */ public SDKEphemPubKey x(String x) { this.x = x; + isSetX = true; // mark as set return this; } @@ -136,6 +161,7 @@ public String getX() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setX(String x) { this.x = x; + isSetX = true; // mark as set } /** @@ -146,6 +172,7 @@ public void setX(String x) { */ public SDKEphemPubKey y(String y) { this.y = y; + isSetY = true; // mark as set return this; } @@ -169,6 +196,27 @@ public String getY() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setY(String y) { this.y = y; + isSetY = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SDKEphemPubKey includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SDKEphemPubKey object is equal to o. */ @@ -182,14 +230,18 @@ public boolean equals(Object o) { } SDKEphemPubKey sdKEphemPubKey = (SDKEphemPubKey) o; return Objects.equals(this.crv, sdKEphemPubKey.crv) + && Objects.equals(this.isSetCrv, sdKEphemPubKey.isSetCrv) && Objects.equals(this.kty, sdKEphemPubKey.kty) + && Objects.equals(this.isSetKty, sdKEphemPubKey.isSetKty) && Objects.equals(this.x, sdKEphemPubKey.x) - && Objects.equals(this.y, sdKEphemPubKey.y); + && Objects.equals(this.isSetX, sdKEphemPubKey.isSetX) + && Objects.equals(this.y, sdKEphemPubKey.y) + && Objects.equals(this.isSetY, sdKEphemPubKey.isSetY); } @Override public int hashCode() { - return Objects.hash(crv, kty, x, y); + return Objects.hash(crv, isSetCrv, kty, isSetKty, x, isSetX, y, isSetY); } @Override @@ -214,6 +266,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCrv) { + addIfNull(nulls, JSON_PROPERTY_CRV, this.crv); + } + if (isSetKty) { + addIfNull(nulls, JSON_PROPERTY_KTY, this.kty); + } + if (isSetX) { + addIfNull(nulls, JSON_PROPERTY_X, this.x); + } + if (isSetY) { + addIfNull(nulls, JSON_PROPERTY_Y, this.y); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SDKEphemPubKey given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java index e941614f3..194fb5b2d 100644 --- a/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/SamsungPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,6 +37,9 @@ public class SamsungPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -42,7 +47,9 @@ public class SamsungPayDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -82,19 +89,34 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SAMSUNG_PAY_TOKEN = "samsungPayToken"; private String samsungPayToken; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSamsungPayToken = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **samsungpay** */ public enum TypeEnum { SAMSUNGPAY(String.valueOf("samsungpay")); @@ -137,6 +159,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SamsungPayDetails() {} /** @@ -147,6 +178,7 @@ public SamsungPayDetails() {} */ public SamsungPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -170,6 +202,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -183,6 +216,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public SamsungPayDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -212,6 +246,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -226,6 +261,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public SamsungPayDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -257,6 +293,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -267,6 +304,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public SamsungPayDetails samsungPayToken(String samsungPayToken) { this.samsungPayToken = samsungPayToken; + isSetSamsungPayToken = true; // mark as set return this; } @@ -290,6 +328,7 @@ public String getSamsungPayToken() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSamsungPayToken(String samsungPayToken) { this.samsungPayToken = samsungPayToken; + isSetSamsungPayToken = true; // mark as set } /** @@ -300,6 +339,7 @@ public void setSamsungPayToken(String samsungPayToken) { */ public SamsungPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -324,6 +364,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -336,6 +377,7 @@ public void setSdkData(String sdkData) { */ public SamsungPayDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -363,6 +405,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -373,6 +416,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public SamsungPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -396,6 +440,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SamsungPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SamsungPayDetails object is equal to o. */ @@ -409,24 +474,40 @@ public boolean equals(Object o) { } SamsungPayDetails samsungPayDetails = (SamsungPayDetails) o; return Objects.equals(this.checkoutAttemptId, samsungPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, samsungPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, samsungPayDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, samsungPayDetails.isSetFundingSource) && Objects.equals(this.recurringDetailReference, samsungPayDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, samsungPayDetails.isSetRecurringDetailReference) && Objects.equals(this.samsungPayToken, samsungPayDetails.samsungPayToken) + && Objects.equals(this.isSetSamsungPayToken, samsungPayDetails.isSetSamsungPayToken) && Objects.equals(this.sdkData, samsungPayDetails.sdkData) + && Objects.equals(this.isSetSdkData, samsungPayDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, samsungPayDetails.storedPaymentMethodId) - && Objects.equals(this.type, samsungPayDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, samsungPayDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, samsungPayDetails.type) + && Objects.equals(this.isSetType, samsungPayDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, fundingSource, + isSetFundingSource, recurringDetailReference, + isSetRecurringDetailReference, samsungPayToken, + isSetSamsungPayToken, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -458,6 +539,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSamsungPayToken) { + addIfNull(nulls, JSON_PROPERTY_SAMSUNG_PAY_TOKEN, this.samsungPayToken); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SamsungPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java index b6dc04af6..6009ba883 100644 --- a/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java +++ b/src/main/java/com/adyen/model/checkout/SepaDirectDebitDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,28 +39,52 @@ public class SepaDirectDebitDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_DUE_DATE = "dueDate"; private String dueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDueDate = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TRANSFER_INSTRUMENT_ID = "transferInstrumentId"; private String transferInstrumentId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransferInstrumentId = false; + /** **sepadirectdebit** */ public enum TypeEnum { SEPADIRECTDEBIT(String.valueOf("sepadirectdebit")), @@ -103,6 +129,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SepaDirectDebitDetails() {} /** @@ -113,6 +148,7 @@ public SepaDirectDebitDetails() {} */ public SepaDirectDebitDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -136,6 +172,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -146,6 +183,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public SepaDirectDebitDetails dueDate(String dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set return this; } @@ -169,6 +207,7 @@ public String getDueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDueDate(String dueDate) { this.dueDate = dueDate; + isSetDueDate = true; // mark as set } /** @@ -179,6 +218,7 @@ public void setDueDate(String dueDate) { */ public SepaDirectDebitDetails iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -202,6 +242,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -212,6 +253,7 @@ public void setIban(String iban) { */ public SepaDirectDebitDetails ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -235,6 +277,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -249,6 +292,7 @@ public void setOwnerName(String ownerName) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public SepaDirectDebitDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -280,6 +324,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -290,6 +335,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public SepaDirectDebitDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -314,6 +360,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -326,6 +373,7 @@ public void setSdkData(String sdkData) { */ public SepaDirectDebitDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -353,6 +401,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -365,6 +414,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public SepaDirectDebitDetails transferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set return this; } @@ -392,6 +442,7 @@ public String getTransferInstrumentId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransferInstrumentId(String transferInstrumentId) { this.transferInstrumentId = transferInstrumentId; + isSetTransferInstrumentId = true; // mark as set } /** @@ -402,6 +453,7 @@ public void setTransferInstrumentId(String transferInstrumentId) { */ public SepaDirectDebitDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -425,6 +477,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SepaDirectDebitDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SepaDirectDebitDetails object is equal to o. */ @@ -438,29 +511,52 @@ public boolean equals(Object o) { } SepaDirectDebitDetails sepaDirectDebitDetails = (SepaDirectDebitDetails) o; return Objects.equals(this.checkoutAttemptId, sepaDirectDebitDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, sepaDirectDebitDetails.isSetCheckoutAttemptId) && Objects.equals(this.dueDate, sepaDirectDebitDetails.dueDate) + && Objects.equals(this.isSetDueDate, sepaDirectDebitDetails.isSetDueDate) && Objects.equals(this.iban, sepaDirectDebitDetails.iban) + && Objects.equals(this.isSetIban, sepaDirectDebitDetails.isSetIban) && Objects.equals(this.ownerName, sepaDirectDebitDetails.ownerName) + && Objects.equals(this.isSetOwnerName, sepaDirectDebitDetails.isSetOwnerName) && Objects.equals( this.recurringDetailReference, sepaDirectDebitDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + sepaDirectDebitDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, sepaDirectDebitDetails.sdkData) + && Objects.equals(this.isSetSdkData, sepaDirectDebitDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, sepaDirectDebitDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, sepaDirectDebitDetails.isSetStoredPaymentMethodId) && Objects.equals(this.transferInstrumentId, sepaDirectDebitDetails.transferInstrumentId) - && Objects.equals(this.type, sepaDirectDebitDetails.type); + && Objects.equals( + this.isSetTransferInstrumentId, sepaDirectDebitDetails.isSetTransferInstrumentId) + && Objects.equals(this.type, sepaDirectDebitDetails.type) + && Objects.equals(this.isSetType, sepaDirectDebitDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, dueDate, + isSetDueDate, iban, + isSetIban, ownerName, + isSetOwnerName, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, transferInstrumentId, - type); + isSetTransferInstrumentId, + type, + isSetType); } @Override @@ -496,6 +592,54 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetDueDate) { + addIfNull(nulls, JSON_PROPERTY_DUE_DATE, this.dueDate); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTransferInstrumentId) { + addIfNull(nulls, JSON_PROPERTY_TRANSFER_INSTRUMENT_ID, this.transferInstrumentId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SepaDirectDebitDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ServiceError.java b/src/main/java/com/adyen/model/checkout/ServiceError.java index d81699410..f4386b2bd 100644 --- a/src/main/java/com/adyen/model/checkout/ServiceError.java +++ b/src/main/java/com/adyen/model/checkout/ServiceError.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -32,21 +34,45 @@ public class ServiceError { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; private String errorCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + public static final String JSON_PROPERTY_ERROR_TYPE = "errorType"; private String errorType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorType = false; + public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_STATUS = "status"; private Integer status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ServiceError() {} /** @@ -60,6 +86,7 @@ public ServiceError() {} */ public ServiceError additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -97,6 +124,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -107,6 +135,7 @@ public void setAdditionalData(Map additionalData) { */ public ServiceError errorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set return this; } @@ -130,6 +159,7 @@ public String getErrorCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorCode(String errorCode) { this.errorCode = errorCode; + isSetErrorCode = true; // mark as set } /** @@ -140,6 +170,7 @@ public void setErrorCode(String errorCode) { */ public ServiceError errorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set return this; } @@ -163,6 +194,7 @@ public String getErrorType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setErrorType(String errorType) { this.errorType = errorType; + isSetErrorType = true; // mark as set } /** @@ -173,6 +205,7 @@ public void setErrorType(String errorType) { */ public ServiceError message(String message) { this.message = message; + isSetMessage = true; // mark as set return this; } @@ -196,6 +229,7 @@ public String getMessage() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessage(String message) { this.message = message; + isSetMessage = true; // mark as set } /** @@ -206,6 +240,7 @@ public void setMessage(String message) { */ public ServiceError pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -229,6 +264,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -239,6 +275,7 @@ public void setPspReference(String pspReference) { */ public ServiceError status(Integer status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -262,6 +299,27 @@ public Integer getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(Integer status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ServiceError includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ServiceError object is equal to o. */ @@ -275,16 +333,34 @@ public boolean equals(Object o) { } ServiceError serviceError = (ServiceError) o; return Objects.equals(this.additionalData, serviceError.additionalData) + && Objects.equals(this.isSetAdditionalData, serviceError.isSetAdditionalData) && Objects.equals(this.errorCode, serviceError.errorCode) + && Objects.equals(this.isSetErrorCode, serviceError.isSetErrorCode) && Objects.equals(this.errorType, serviceError.errorType) + && Objects.equals(this.isSetErrorType, serviceError.isSetErrorType) && Objects.equals(this.message, serviceError.message) + && Objects.equals(this.isSetMessage, serviceError.isSetMessage) && Objects.equals(this.pspReference, serviceError.pspReference) - && Objects.equals(this.status, serviceError.status); + && Objects.equals(this.isSetPspReference, serviceError.isSetPspReference) + && Objects.equals(this.status, serviceError.status) + && Objects.equals(this.isSetStatus, serviceError.isSetStatus); } @Override public int hashCode() { - return Objects.hash(additionalData, errorCode, errorType, message, pspReference, status); + return Objects.hash( + additionalData, + isSetAdditionalData, + errorCode, + isSetErrorCode, + errorType, + isSetErrorType, + message, + isSetMessage, + pspReference, + isSetPspReference, + status, + isSetStatus); } @Override @@ -311,6 +387,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetErrorType) { + addIfNull(nulls, JSON_PROPERTY_ERROR_TYPE, this.errorType); + } + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ServiceError given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SessionResultResponse.java b/src/main/java/com/adyen/model/checkout/SessionResultResponse.java index d792465e3..5f338e145 100644 --- a/src/main/java/com/adyen/model/checkout/SessionResultResponse.java +++ b/src/main/java/com/adyen/model/checkout/SessionResultResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -37,15 +39,27 @@ public class SessionResultResponse { public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData"; private Map additionalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAdditionalData = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_PAYMENTS = "payments"; private List payments; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayments = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The status of the session. The status included in the response doesn't get updated. * Don't make the request again to check for payment status updates. Possible values: * @@ -109,6 +123,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SessionResultResponse() {} /** @@ -123,6 +146,7 @@ public SessionResultResponse() {} */ public SessionResultResponse additionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set return this; } @@ -162,6 +186,7 @@ public Map getAdditionalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAdditionalData(Map additionalData) { this.additionalData = additionalData; + isSetAdditionalData = true; // mark as set } /** @@ -172,6 +197,7 @@ public void setAdditionalData(Map additionalData) { */ public SessionResultResponse id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -195,6 +221,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -205,6 +232,7 @@ public void setId(String id) { */ public SessionResultResponse payments(List payments) { this.payments = payments; + isSetPayments = true; // mark as set return this; } @@ -236,6 +264,7 @@ public List getPayments() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayments(List payments) { this.payments = payments; + isSetPayments = true; // mark as set } /** @@ -249,6 +278,7 @@ public void setPayments(List payments) { */ public SessionResultResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -278,6 +308,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -306,6 +337,7 @@ public void setReference(String reference) { */ public SessionResultResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -365,6 +397,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SessionResultResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SessionResultResponse object is equal to o. */ @@ -378,15 +431,30 @@ public boolean equals(Object o) { } SessionResultResponse sessionResultResponse = (SessionResultResponse) o; return Objects.equals(this.additionalData, sessionResultResponse.additionalData) + && Objects.equals(this.isSetAdditionalData, sessionResultResponse.isSetAdditionalData) && Objects.equals(this.id, sessionResultResponse.id) + && Objects.equals(this.isSetId, sessionResultResponse.isSetId) && Objects.equals(this.payments, sessionResultResponse.payments) + && Objects.equals(this.isSetPayments, sessionResultResponse.isSetPayments) && Objects.equals(this.reference, sessionResultResponse.reference) - && Objects.equals(this.status, sessionResultResponse.status); + && Objects.equals(this.isSetReference, sessionResultResponse.isSetReference) + && Objects.equals(this.status, sessionResultResponse.status) + && Objects.equals(this.isSetStatus, sessionResultResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(additionalData, id, payments, reference, status); + return Objects.hash( + additionalData, + isSetAdditionalData, + id, + isSetId, + payments, + isSetPayments, + reference, + isSetReference, + status, + isSetStatus); } @Override @@ -412,6 +480,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAdditionalData) { + addIfNull(nulls, JSON_PROPERTY_ADDITIONAL_DATA, this.additionalData); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetPayments) { + addIfNull(nulls, JSON_PROPERTY_PAYMENTS, this.payments); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SessionResultResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java b/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java index 65788ae8e..9cc3da19a 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/ShopperIdPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -41,6 +43,15 @@ public class ShopperIdPaymentMethod { public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ShopperIdPaymentMethod() {} /** @@ -51,6 +62,7 @@ public ShopperIdPaymentMethod() {} */ public ShopperIdPaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -74,6 +86,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ShopperIdPaymentMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ShopperIdPaymentMethod object is equal to o. */ @@ -86,12 +119,13 @@ public boolean equals(Object o) { return false; } ShopperIdPaymentMethod shopperIdPaymentMethod = (ShopperIdPaymentMethod) o; - return Objects.equals(this.type, shopperIdPaymentMethod.type); + return Objects.equals(this.type, shopperIdPaymentMethod.type) + && Objects.equals(this.isSetType, shopperIdPaymentMethod.isSetType); } @Override public int hashCode() { - return Objects.hash(type); + return Objects.hash(type, isSetType); } @Override @@ -122,6 +156,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(ShopperIdPaymentMethod.class, "type", mappings); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ShopperIdPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java b/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java index 7b77c7b42..50426eeb2 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java +++ b/src/main/java/com/adyen/model/checkout/ShopperInteractionDevice.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -27,12 +29,27 @@ public class ShopperInteractionDevice { public static final String JSON_PROPERTY_LOCALE = "locale"; private String locale; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLocale = false; + public static final String JSON_PROPERTY_OS = "os"; private String os; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOs = false; + public static final String JSON_PROPERTY_OS_VERSION = "osVersion"; private String osVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOsVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ShopperInteractionDevice() {} /** @@ -43,6 +60,7 @@ public ShopperInteractionDevice() {} */ public ShopperInteractionDevice locale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set return this; } @@ -66,6 +84,7 @@ public String getLocale() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocale(String locale) { this.locale = locale; + isSetLocale = true; // mark as set } /** @@ -76,6 +95,7 @@ public void setLocale(String locale) { */ public ShopperInteractionDevice os(String os) { this.os = os; + isSetOs = true; // mark as set return this; } @@ -99,6 +119,7 @@ public String getOs() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOs(String os) { this.os = os; + isSetOs = true; // mark as set } /** @@ -109,6 +130,7 @@ public void setOs(String os) { */ public ShopperInteractionDevice osVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set return this; } @@ -132,6 +154,27 @@ public String getOsVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsVersion(String osVersion) { this.osVersion = osVersion; + isSetOsVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ShopperInteractionDevice includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ShopperInteractionDevice object is equal to o. */ @@ -145,13 +188,16 @@ public boolean equals(Object o) { } ShopperInteractionDevice shopperInteractionDevice = (ShopperInteractionDevice) o; return Objects.equals(this.locale, shopperInteractionDevice.locale) + && Objects.equals(this.isSetLocale, shopperInteractionDevice.isSetLocale) && Objects.equals(this.os, shopperInteractionDevice.os) - && Objects.equals(this.osVersion, shopperInteractionDevice.osVersion); + && Objects.equals(this.isSetOs, shopperInteractionDevice.isSetOs) + && Objects.equals(this.osVersion, shopperInteractionDevice.osVersion) + && Objects.equals(this.isSetOsVersion, shopperInteractionDevice.isSetOsVersion); } @Override public int hashCode() { - return Objects.hash(locale, os, osVersion); + return Objects.hash(locale, isSetLocale, os, isSetOs, osVersion, isSetOsVersion); } @Override @@ -175,6 +221,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetLocale) { + addIfNull(nulls, JSON_PROPERTY_LOCALE, this.locale); + } + if (isSetOs) { + addIfNull(nulls, JSON_PROPERTY_OS, this.os); + } + if (isSetOsVersion) { + addIfNull(nulls, JSON_PROPERTY_OS_VERSION, this.osVersion); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ShopperInteractionDevice given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ShopperName.java b/src/main/java/com/adyen/model/checkout/ShopperName.java index b7ca4eef2..725bf0ab8 100644 --- a/src/main/java/com/adyen/model/checkout/ShopperName.java +++ b/src/main/java/com/adyen/model/checkout/ShopperName.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class ShopperName { public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; private String firstName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFirstName = false; + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; private String lastName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ShopperName() {} /** @@ -36,6 +50,7 @@ public ShopperName() {} */ public ShopperName firstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set return this; } @@ -59,6 +74,7 @@ public String getFirstName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstName(String firstName) { this.firstName = firstName; + isSetFirstName = true; // mark as set } /** @@ -69,6 +85,7 @@ public void setFirstName(String firstName) { */ public ShopperName lastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set return this; } @@ -92,6 +109,27 @@ public String getLastName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastName(String lastName) { this.lastName = lastName; + isSetLastName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ShopperName includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ShopperName object is equal to o. */ @@ -105,12 +143,14 @@ public boolean equals(Object o) { } ShopperName shopperName = (ShopperName) o; return Objects.equals(this.firstName, shopperName.firstName) - && Objects.equals(this.lastName, shopperName.lastName); + && Objects.equals(this.isSetFirstName, shopperName.isSetFirstName) + && Objects.equals(this.lastName, shopperName.lastName) + && Objects.equals(this.isSetLastName, shopperName.isSetLastName); } @Override public int hashCode() { - return Objects.hash(firstName, lastName); + return Objects.hash(firstName, isSetFirstName, lastName, isSetLastName); } @Override @@ -133,6 +173,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetFirstName) { + addIfNull(nulls, JSON_PROPERTY_FIRST_NAME, this.firstName); + } + if (isSetLastName) { + addIfNull(nulls, JSON_PROPERTY_LAST_NAME, this.lastName); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ShopperName given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Split.java b/src/main/java/com/adyen/model/checkout/Split.java index 6801ac0d9..20738efe8 100644 --- a/src/main/java/com/adyen/model/checkout/Split.java +++ b/src/main/java/com/adyen/model/checkout/Split.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,38 +35,52 @@ public class Split { public static final String JSON_PROPERTY_ACCOUNT = "account"; private String account; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccount = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private SplitAmount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; private String description; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDescription = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** * The part of the payment you want to book to the specified `account`. Possible values * for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * - * **BalanceAccount**: books part of the payment (specified in `amount`) to the + * **BalanceAccount**: Books part of the payment (specified in `amount`) to the * specified `account`. * Transaction fees types that you can book to the specified - * `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme - * fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * `account`: * **AcquiringFees**: The aggregated amount of the interchange and scheme + * fees. * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended - * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the + * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: The * transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: - * the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the - * fees paid to the card scheme for using their network. * **Commission**: your platform's + * The fees paid to the issuer for each payment made with the card network. * **SchemeFee**: The + * fees paid to the card scheme for using their network. * **Commission**: Your platform's * commission on the payment (specified in `amount`), booked to your liable balance - * account. * **Remainder**: the amount left over after a currency conversion, booked to the - * specified `account`. * **TopUp**: allows you and your users to top up balance - * accounts using direct debit, card payments, or other payment methods. * **VAT**: the - * value-added tax charged on the payment, booked to your platforms liable balance account. * - * **Default**: in very specific use cases, allows you to book the specified `amount` to - * the specified `account`. For more information, contact Adyen support. Possible values - * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): - * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. + * account. * **Remainder**: The amount left over after a currency conversion, booked to the + * specified `account`. * **Surcharge**: The payment acceptance fee imposed by the card + * scheme or debit network provider, paid by your user's customer. * **TopUp**: Allows you and + * your users to top up balance accounts using direct debit, card payments, or other payment + * methods. * **VAT**: The value-added tax charged on the payment, booked to your platforms liable + * balance account. * **Default**: In very specific use cases, allows you to book the specified + * `amount` to the specified `account`. For more information, contact Adyen + * support. Possible values for the [Classic Platforms + * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, + * **MarketPlace**, **PaymentFee**, **VAT**. */ public enum TypeEnum { ACQUIRINGFEES(String.valueOf("AcquiringFees")), @@ -137,6 +153,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Split() {} /** @@ -161,6 +186,7 @@ public Split() {} */ public Split account(String account) { this.account = account; + isSetAccount = true; // mark as set return this; } @@ -212,6 +238,7 @@ public String getAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccount(String account) { this.account = account; + isSetAccount = true; // mark as set } /** @@ -222,6 +249,7 @@ public void setAccount(String account) { */ public Split amount(SplitAmount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -245,6 +273,7 @@ public SplitAmount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(SplitAmount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -255,6 +284,7 @@ public void setAmount(SplitAmount amount) { */ public Split description(String description) { this.description = description; + isSetDescription = true; // mark as set return this; } @@ -278,6 +308,7 @@ public String getDescription() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(String description) { this.description = description; + isSetDescription = true; // mark as set } /** @@ -298,6 +329,7 @@ public void setDescription(String description) { */ public Split reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -341,111 +373,119 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** * The part of the payment you want to book to the specified `account`. Possible values * for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * - * **BalanceAccount**: books part of the payment (specified in `amount`) to the + * **BalanceAccount**: Books part of the payment (specified in `amount`) to the * specified `account`. * Transaction fees types that you can book to the specified - * `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme - * fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * `account`: * **AcquiringFees**: The aggregated amount of the interchange and scheme + * fees. * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended - * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the + * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: The * transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: - * the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the - * fees paid to the card scheme for using their network. * **Commission**: your platform's + * The fees paid to the issuer for each payment made with the card network. * **SchemeFee**: The + * fees paid to the card scheme for using their network. * **Commission**: Your platform's * commission on the payment (specified in `amount`), booked to your liable balance - * account. * **Remainder**: the amount left over after a currency conversion, booked to the - * specified `account`. * **TopUp**: allows you and your users to top up balance - * accounts using direct debit, card payments, or other payment methods. * **VAT**: the - * value-added tax charged on the payment, booked to your platforms liable balance account. * - * **Default**: in very specific use cases, allows you to book the specified `amount` to - * the specified `account`. For more information, contact Adyen support. Possible values - * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): - * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. + * account. * **Remainder**: The amount left over after a currency conversion, booked to the + * specified `account`. * **Surcharge**: The payment acceptance fee imposed by the card + * scheme or debit network provider, paid by your user's customer. * **TopUp**: Allows you and + * your users to top up balance accounts using direct debit, card payments, or other payment + * methods. * **VAT**: The value-added tax charged on the payment, booked to your platforms liable + * balance account. * **Default**: In very specific use cases, allows you to book the specified + * `amount` to the specified `account`. For more information, contact Adyen + * support. Possible values for the [Classic Platforms + * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, + * **MarketPlace**, **PaymentFee**, **VAT**. * * @param type The part of the payment you want to book to the specified `account`. * Possible values for the [Balance - * Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books + * Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: Books * part of the payment (specified in `amount`) to the specified `account`. * * Transaction fees types that you can book to the specified `account`: * - * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * **AcquiringFees**: The aggregated amount of the interchange and scheme fees. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: - * the transaction fees due to Adyen under [Interchange ++ + * The transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * - * **Interchange**: the fees paid to the issuer for each payment made with the card network. * - * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: - * your platform's commission on the payment (specified in `amount`), booked to - * your liable balance account. * **Remainder**: the amount left over after a currency - * conversion, booked to the specified `account`. * **TopUp**: allows you and your - * users to top up balance accounts using direct debit, card payments, or other payment - * methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms - * liable balance account. * **Default**: in very specific use cases, allows you to book the - * specified `amount` to the specified `account`. For more information, - * contact Adyen support. Possible values for the [Classic Platforms - * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, - * **MarketPlace**, **PaymentFee**, **VAT**. + * **Interchange**: The fees paid to the issuer for each payment made with the card network. * + * **SchemeFee**: The fees paid to the card scheme for using their network. * **Commission**: + * Your platform's commission on the payment (specified in `amount`), booked to + * your liable balance account. * **Remainder**: The amount left over after a currency + * conversion, booked to the specified `account`. * **Surcharge**: The payment + * acceptance fee imposed by the card scheme or debit network provider, paid by your + * user's customer. * **TopUp**: Allows you and your users to top up balance accounts + * using direct debit, card payments, or other payment methods. * **VAT**: The value-added tax + * charged on the payment, booked to your platforms liable balance account. * **Default**: In + * very specific use cases, allows you to book the specified `amount` to the + * specified `account`. For more information, contact Adyen support. Possible values + * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): + * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. * @return the current {@code Split} instance, allowing for method chaining */ public Split type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } /** * The part of the payment you want to book to the specified `account`. Possible values * for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * - * **BalanceAccount**: books part of the payment (specified in `amount`) to the + * **BalanceAccount**: Books part of the payment (specified in `amount`) to the * specified `account`. * Transaction fees types that you can book to the specified - * `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme - * fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * `account`: * **AcquiringFees**: The aggregated amount of the interchange and scheme + * fees. * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended - * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the + * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: The * transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: - * the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the - * fees paid to the card scheme for using their network. * **Commission**: your platform's + * The fees paid to the issuer for each payment made with the card network. * **SchemeFee**: The + * fees paid to the card scheme for using their network. * **Commission**: Your platform's * commission on the payment (specified in `amount`), booked to your liable balance - * account. * **Remainder**: the amount left over after a currency conversion, booked to the - * specified `account`. * **TopUp**: allows you and your users to top up balance - * accounts using direct debit, card payments, or other payment methods. * **VAT**: the - * value-added tax charged on the payment, booked to your platforms liable balance account. * - * **Default**: in very specific use cases, allows you to book the specified `amount` to - * the specified `account`. For more information, contact Adyen support. Possible values - * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): - * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. + * account. * **Remainder**: The amount left over after a currency conversion, booked to the + * specified `account`. * **Surcharge**: The payment acceptance fee imposed by the card + * scheme or debit network provider, paid by your user's customer. * **TopUp**: Allows you and + * your users to top up balance accounts using direct debit, card payments, or other payment + * methods. * **VAT**: The value-added tax charged on the payment, booked to your platforms liable + * balance account. * **Default**: In very specific use cases, allows you to book the specified + * `amount` to the specified `account`. For more information, contact Adyen + * support. Possible values for the [Classic Platforms + * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, + * **MarketPlace**, **PaymentFee**, **VAT**. * * @return type The part of the payment you want to book to the specified `account`. * Possible values for the [Balance - * Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books + * Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: Books * part of the payment (specified in `amount`) to the specified `account`. * * Transaction fees types that you can book to the specified `account`: * - * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * **AcquiringFees**: The aggregated amount of the interchange and scheme fees. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: - * the transaction fees due to Adyen under [Interchange ++ + * The transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * - * **Interchange**: the fees paid to the issuer for each payment made with the card network. * - * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: - * your platform's commission on the payment (specified in `amount`), booked to - * your liable balance account. * **Remainder**: the amount left over after a currency - * conversion, booked to the specified `account`. * **TopUp**: allows you and your - * users to top up balance accounts using direct debit, card payments, or other payment - * methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms - * liable balance account. * **Default**: in very specific use cases, allows you to book the - * specified `amount` to the specified `account`. For more information, - * contact Adyen support. Possible values for the [Classic Platforms - * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, - * **MarketPlace**, **PaymentFee**, **VAT**. + * **Interchange**: The fees paid to the issuer for each payment made with the card network. * + * **SchemeFee**: The fees paid to the card scheme for using their network. * **Commission**: + * Your platform's commission on the payment (specified in `amount`), booked to + * your liable balance account. * **Remainder**: The amount left over after a currency + * conversion, booked to the specified `account`. * **Surcharge**: The payment + * acceptance fee imposed by the card scheme or debit network provider, paid by your + * user's customer. * **TopUp**: Allows you and your users to top up balance accounts + * using direct debit, card payments, or other payment methods. * **VAT**: The value-added tax + * charged on the payment, booked to your platforms liable balance account. * **Default**: In + * very specific use cases, allows you to book the specified `amount` to the + * specified `account`. For more information, contact Adyen support. Possible values + * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): + * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -456,56 +496,80 @@ public TypeEnum getType() { /** * The part of the payment you want to book to the specified `account`. Possible values * for the [Balance Platform](https://docs.adyen.com/adyen-for-platforms-model): * - * **BalanceAccount**: books part of the payment (specified in `amount`) to the + * **BalanceAccount**: Books part of the payment (specified in `amount`) to the * specified `account`. * Transaction fees types that you can book to the specified - * `account`: * **AcquiringFees**: the aggregated amount of the interchange and scheme - * fees. * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * `account`: * **AcquiringFees**: The aggregated amount of the interchange and scheme + * fees. * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended - * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: the + * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: The * transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **Interchange**: - * the fees paid to the issuer for each payment made with the card network. * **SchemeFee**: the - * fees paid to the card scheme for using their network. * **Commission**: your platform's + * The fees paid to the issuer for each payment made with the card network. * **SchemeFee**: The + * fees paid to the card scheme for using their network. * **Commission**: Your platform's * commission on the payment (specified in `amount`), booked to your liable balance - * account. * **Remainder**: the amount left over after a currency conversion, booked to the - * specified `account`. * **TopUp**: allows you and your users to top up balance - * accounts using direct debit, card payments, or other payment methods. * **VAT**: the - * value-added tax charged on the payment, booked to your platforms liable balance account. * - * **Default**: in very specific use cases, allows you to book the specified `amount` to - * the specified `account`. For more information, contact Adyen support. Possible values - * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): - * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. + * account. * **Remainder**: The amount left over after a currency conversion, booked to the + * specified `account`. * **Surcharge**: The payment acceptance fee imposed by the card + * scheme or debit network provider, paid by your user's customer. * **TopUp**: Allows you and + * your users to top up balance accounts using direct debit, card payments, or other payment + * methods. * **VAT**: The value-added tax charged on the payment, booked to your platforms liable + * balance account. * **Default**: In very specific use cases, allows you to book the specified + * `amount` to the specified `account`. For more information, contact Adyen + * support. Possible values for the [Classic Platforms + * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, + * **MarketPlace**, **PaymentFee**, **VAT**. * * @param type The part of the payment you want to book to the specified `account`. * Possible values for the [Balance - * Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: books + * Platform](https://docs.adyen.com/adyen-for-platforms-model): * **BalanceAccount**: Books * part of the payment (specified in `amount`) to the specified `account`. * * Transaction fees types that you can book to the specified `account`: * - * **AcquiringFees**: the aggregated amount of the interchange and scheme fees. * - * **PaymentFee**: the aggregated amount of all transaction fees. * **AdyenFees**: the - * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: the + * **AcquiringFees**: The aggregated amount of the interchange and scheme fees. * + * **PaymentFee**: The aggregated amount of all transaction fees. * **AdyenFees**: The + * aggregated amount of Adyen's commission and markup fees. * **AdyenCommission**: The * transaction fees due to Adyen under [blended * rates](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * **AdyenMarkup**: - * the transaction fees due to Adyen under [Interchange ++ + * The transaction fees due to Adyen under [Interchange ++ * pricing](https://www.adyen.com/knowledge-hub/interchange-fees-explained). * - * **Interchange**: the fees paid to the issuer for each payment made with the card network. * - * **SchemeFee**: the fees paid to the card scheme for using their network. * **Commission**: - * your platform's commission on the payment (specified in `amount`), booked to - * your liable balance account. * **Remainder**: the amount left over after a currency - * conversion, booked to the specified `account`. * **TopUp**: allows you and your - * users to top up balance accounts using direct debit, card payments, or other payment - * methods. * **VAT**: the value-added tax charged on the payment, booked to your platforms - * liable balance account. * **Default**: in very specific use cases, allows you to book the - * specified `amount` to the specified `account`. For more information, - * contact Adyen support. Possible values for the [Classic Platforms - * integration](https://docs.adyen.com/classic-platforms): **Commission**, **Default**, - * **MarketPlace**, **PaymentFee**, **VAT**. + * **Interchange**: The fees paid to the issuer for each payment made with the card network. * + * **SchemeFee**: The fees paid to the card scheme for using their network. * **Commission**: + * Your platform's commission on the payment (specified in `amount`), booked to + * your liable balance account. * **Remainder**: The amount left over after a currency + * conversion, booked to the specified `account`. * **Surcharge**: The payment + * acceptance fee imposed by the card scheme or debit network provider, paid by your + * user's customer. * **TopUp**: Allows you and your users to top up balance accounts + * using direct debit, card payments, or other payment methods. * **VAT**: The value-added tax + * charged on the payment, booked to your platforms liable balance account. * **Default**: In + * very specific use cases, allows you to book the specified `amount` to the + * specified `account`. For more information, contact Adyen support. Possible values + * for the [Classic Platforms integration](https://docs.adyen.com/classic-platforms): + * **Commission**, **Default**, **MarketPlace**, **PaymentFee**, **VAT**. */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Split includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Split object is equal to o. */ @@ -519,15 +583,30 @@ public boolean equals(Object o) { } Split split = (Split) o; return Objects.equals(this.account, split.account) + && Objects.equals(this.isSetAccount, split.isSetAccount) && Objects.equals(this.amount, split.amount) + && Objects.equals(this.isSetAmount, split.isSetAmount) && Objects.equals(this.description, split.description) + && Objects.equals(this.isSetDescription, split.isSetDescription) && Objects.equals(this.reference, split.reference) - && Objects.equals(this.type, split.type); + && Objects.equals(this.isSetReference, split.isSetReference) + && Objects.equals(this.type, split.type) + && Objects.equals(this.isSetType, split.isSetType); } @Override public int hashCode() { - return Objects.hash(account, amount, description, reference, type); + return Objects.hash( + account, + isSetAccount, + amount, + isSetAmount, + description, + isSetDescription, + reference, + isSetReference, + type, + isSetType); } @Override @@ -553,6 +632,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccount) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT, this.account); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetDescription) { + addIfNull(nulls, JSON_PROPERTY_DESCRIPTION, this.description); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Split given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SplitAmount.java b/src/main/java/com/adyen/model/checkout/SplitAmount.java index 6720faae2..d0fe6927f 100644 --- a/src/main/java/com/adyen/model/checkout/SplitAmount.java +++ b/src/main/java/com/adyen/model/checkout/SplitAmount.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class SplitAmount { public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SplitAmount() {} /** @@ -40,6 +54,7 @@ public SplitAmount() {} */ public SplitAmount currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -71,6 +86,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -83,6 +99,7 @@ public void setCurrency(String currency) { */ public SplitAmount value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -110,6 +127,27 @@ public Long getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SplitAmount includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SplitAmount object is equal to o. */ @@ -123,12 +161,14 @@ public boolean equals(Object o) { } SplitAmount splitAmount = (SplitAmount) o; return Objects.equals(this.currency, splitAmount.currency) - && Objects.equals(this.value, splitAmount.value); + && Objects.equals(this.isSetCurrency, splitAmount.isSetCurrency) + && Objects.equals(this.value, splitAmount.value) + && Objects.equals(this.isSetValue, splitAmount.isSetValue); } @Override public int hashCode() { - return Objects.hash(currency, value); + return Objects.hash(currency, isSetCurrency, value, isSetValue); } @Override @@ -151,6 +191,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SplitAmount given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java index f237aaab1..d07566e17 100644 --- a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java +++ b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class StandalonePaymentCancelRequest { public static final String JSON_PROPERTY_APPLICATION_INFO = "applicationInfo"; private ApplicationInfo applicationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetApplicationInfo = false; + public static final String JSON_PROPERTY_ENHANCED_SCHEME_DATA = "enhancedSchemeData"; private EnhancedSchemeData enhancedSchemeData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEnhancedSchemeData = false; + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_REFERENCE = "paymentReference"; private String paymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StandalonePaymentCancelRequest() {} /** @@ -52,6 +75,7 @@ public StandalonePaymentCancelRequest() {} */ public StandalonePaymentCancelRequest applicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set return this; } @@ -75,6 +99,7 @@ public ApplicationInfo getApplicationInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApplicationInfo(ApplicationInfo applicationInfo) { this.applicationInfo = applicationInfo; + isSetApplicationInfo = true; // mark as set } /** @@ -86,6 +111,7 @@ public void setApplicationInfo(ApplicationInfo applicationInfo) { */ public StandalonePaymentCancelRequest enhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set return this; } @@ -109,6 +135,7 @@ public EnhancedSchemeData getEnhancedSchemeData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { this.enhancedSchemeData = enhancedSchemeData; + isSetEnhancedSchemeData = true; // mark as set } /** @@ -120,6 +147,7 @@ public void setEnhancedSchemeData(EnhancedSchemeData enhancedSchemeData) { */ public StandalonePaymentCancelRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -143,6 +171,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -158,6 +187,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StandalonePaymentCancelRequest paymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set return this; } @@ -189,6 +219,7 @@ public String getPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set } /** @@ -200,6 +231,7 @@ public void setPaymentReference(String paymentReference) { */ public StandalonePaymentCancelRequest reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -223,6 +255,27 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StandalonePaymentCancelRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StandalonePaymentCancelRequest object is equal to o. */ @@ -237,17 +290,35 @@ public boolean equals(Object o) { StandalonePaymentCancelRequest standalonePaymentCancelRequest = (StandalonePaymentCancelRequest) o; return Objects.equals(this.applicationInfo, standalonePaymentCancelRequest.applicationInfo) + && Objects.equals( + this.isSetApplicationInfo, standalonePaymentCancelRequest.isSetApplicationInfo) && Objects.equals( this.enhancedSchemeData, standalonePaymentCancelRequest.enhancedSchemeData) + && Objects.equals( + this.isSetEnhancedSchemeData, standalonePaymentCancelRequest.isSetEnhancedSchemeData) && Objects.equals(this.merchantAccount, standalonePaymentCancelRequest.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, standalonePaymentCancelRequest.isSetMerchantAccount) && Objects.equals(this.paymentReference, standalonePaymentCancelRequest.paymentReference) - && Objects.equals(this.reference, standalonePaymentCancelRequest.reference); + && Objects.equals( + this.isSetPaymentReference, standalonePaymentCancelRequest.isSetPaymentReference) + && Objects.equals(this.reference, standalonePaymentCancelRequest.reference) + && Objects.equals(this.isSetReference, standalonePaymentCancelRequest.isSetReference); } @Override public int hashCode() { return Objects.hash( - applicationInfo, enhancedSchemeData, merchantAccount, paymentReference, reference); + applicationInfo, + isSetApplicationInfo, + enhancedSchemeData, + isSetEnhancedSchemeData, + merchantAccount, + isSetMerchantAccount, + paymentReference, + isSetPaymentReference, + reference, + isSetReference); } @Override @@ -273,6 +344,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetApplicationInfo) { + addIfNull(nulls, JSON_PROPERTY_APPLICATION_INFO, this.applicationInfo); + } + if (isSetEnhancedSchemeData) { + addIfNull(nulls, JSON_PROPERTY_ENHANCED_SCHEME_DATA, this.enhancedSchemeData); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_REFERENCE, this.paymentReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StandalonePaymentCancelRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java index bb5a4eaae..f48900818 100644 --- a/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java +++ b/src/main/java/com/adyen/model/checkout/StandalonePaymentCancelResponse.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,15 +35,27 @@ public class StandalonePaymentCancelResponse { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_REFERENCE = "paymentReference"; private String paymentReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentReference = false; + public static final String JSON_PROPERTY_PSP_REFERENCE = "pspReference"; private String pspReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPspReference = false; + public static final String JSON_PROPERTY_REFERENCE = "reference"; private String reference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReference = false; + /** The status of your request. This will always have the value **received**. */ public enum StatusEnum { RECEIVED(String.valueOf("received")); @@ -84,6 +98,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StandalonePaymentCancelResponse() {} /** @@ -95,6 +118,7 @@ public StandalonePaymentCancelResponse() {} */ public StandalonePaymentCancelResponse merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -118,6 +142,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -133,6 +158,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StandalonePaymentCancelResponse paymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set return this; } @@ -164,6 +190,7 @@ public String getPaymentReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentReference(String paymentReference) { this.paymentReference = paymentReference; + isSetPaymentReference = true; // mark as set } /** @@ -175,6 +202,7 @@ public void setPaymentReference(String paymentReference) { */ public StandalonePaymentCancelResponse pspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set return this; } @@ -198,6 +226,7 @@ public String getPspReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPspReference(String pspReference) { this.pspReference = pspReference; + isSetPspReference = true; // mark as set } /** @@ -209,6 +238,7 @@ public void setPspReference(String pspReference) { */ public StandalonePaymentCancelResponse reference(String reference) { this.reference = reference; + isSetReference = true; // mark as set return this; } @@ -232,6 +262,7 @@ public String getReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReference(String reference) { this.reference = reference; + isSetReference = true; // mark as set } /** @@ -243,6 +274,7 @@ public void setReference(String reference) { */ public StandalonePaymentCancelResponse status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -266,6 +298,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StandalonePaymentCancelResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StandalonePaymentCancelResponse object is equal to o. */ @@ -280,15 +333,32 @@ public boolean equals(Object o) { StandalonePaymentCancelResponse standalonePaymentCancelResponse = (StandalonePaymentCancelResponse) o; return Objects.equals(this.merchantAccount, standalonePaymentCancelResponse.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, standalonePaymentCancelResponse.isSetMerchantAccount) && Objects.equals(this.paymentReference, standalonePaymentCancelResponse.paymentReference) + && Objects.equals( + this.isSetPaymentReference, standalonePaymentCancelResponse.isSetPaymentReference) && Objects.equals(this.pspReference, standalonePaymentCancelResponse.pspReference) + && Objects.equals(this.isSetPspReference, standalonePaymentCancelResponse.isSetPspReference) && Objects.equals(this.reference, standalonePaymentCancelResponse.reference) - && Objects.equals(this.status, standalonePaymentCancelResponse.status); + && Objects.equals(this.isSetReference, standalonePaymentCancelResponse.isSetReference) + && Objects.equals(this.status, standalonePaymentCancelResponse.status) + && Objects.equals(this.isSetStatus, standalonePaymentCancelResponse.isSetStatus); } @Override public int hashCode() { - return Objects.hash(merchantAccount, paymentReference, pspReference, reference, status); + return Objects.hash( + merchantAccount, + isSetMerchantAccount, + paymentReference, + isSetPaymentReference, + pspReference, + isSetPspReference, + reference, + isSetReference, + status, + isSetStatus); } @Override @@ -314,6 +384,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentReference) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_REFERENCE, this.paymentReference); + } + if (isSetPspReference) { + addIfNull(nulls, JSON_PROPERTY_PSP_REFERENCE, this.pspReference); + } + if (isSetReference) { + addIfNull(nulls, JSON_PROPERTY_REFERENCE, this.reference); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StandalonePaymentCancelResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java index 7f1a34426..ca013c0b7 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,56 +45,113 @@ public class StoredPaymentMethod { public static final String JSON_PROPERTY_BANK_ACCOUNT_NUMBER = "bankAccountNumber"; private String bankAccountNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankAccountNumber = false; + public static final String JSON_PROPERTY_BANK_LOCATION_ID = "bankLocationId"; private String bankLocationId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBankLocationId = false; + public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_LABEL = "label"; private String label; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLabel = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE = "networkTxReference"; private String networkTxReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS = "supportedRecurringProcessingModels"; private List supportedRecurringProcessingModels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedRecurringProcessingModels = false; + public static final String JSON_PROPERTY_SUPPORTED_SHOPPER_INTERACTIONS = "supportedShopperInteractions"; private List supportedShopperInteractions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedShopperInteractions = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredPaymentMethod() {} /** @@ -103,6 +162,7 @@ public StoredPaymentMethod() {} */ public StoredPaymentMethod bankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set return this; } @@ -126,6 +186,7 @@ public String getBankAccountNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankAccountNumber(String bankAccountNumber) { this.bankAccountNumber = bankAccountNumber; + isSetBankAccountNumber = true; // mark as set } /** @@ -137,6 +198,7 @@ public void setBankAccountNumber(String bankAccountNumber) { */ public StoredPaymentMethod bankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set return this; } @@ -162,6 +224,7 @@ public String getBankLocationId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBankLocationId(String bankLocationId) { this.bankLocationId = bankLocationId; + isSetBankLocationId = true; // mark as set } /** @@ -172,6 +235,7 @@ public void setBankLocationId(String bankLocationId) { */ public StoredPaymentMethod brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -195,6 +259,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -205,6 +270,7 @@ public void setBrand(String brand) { */ public StoredPaymentMethod expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -228,6 +294,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -239,6 +306,7 @@ public void setExpiryMonth(String expiryMonth) { */ public StoredPaymentMethod expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -264,6 +332,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -274,6 +343,7 @@ public void setExpiryYear(String expiryYear) { */ public StoredPaymentMethod holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -297,6 +367,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -307,6 +378,7 @@ public void setHolderName(String holderName) { */ public StoredPaymentMethod iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -330,6 +402,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -340,6 +413,7 @@ public void setIban(String iban) { */ public StoredPaymentMethod id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -363,6 +437,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -373,6 +448,7 @@ public void setId(String id) { */ public StoredPaymentMethod label(String label) { this.label = label; + isSetLabel = true; // mark as set return this; } @@ -396,6 +472,7 @@ public String getLabel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLabel(String label) { this.label = label; + isSetLabel = true; // mark as set } /** @@ -406,6 +483,7 @@ public void setLabel(String label) { */ public StoredPaymentMethod lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -429,6 +507,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -439,6 +518,7 @@ public void setLastFour(String lastFour) { */ public StoredPaymentMethod name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -462,6 +542,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -476,6 +557,7 @@ public void setName(String name) { */ public StoredPaymentMethod networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -507,6 +589,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -517,6 +600,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public StoredPaymentMethod ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -540,6 +624,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -550,6 +635,7 @@ public void setOwnerName(String ownerName) { */ public StoredPaymentMethod shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -573,6 +659,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -585,6 +672,7 @@ public void setShopperEmail(String shopperEmail) { public StoredPaymentMethod supportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set return this; } @@ -620,6 +708,7 @@ public List getSupportedRecurringProcessingModels() { public void setSupportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set } /** @@ -632,6 +721,7 @@ public void setSupportedRecurringProcessingModels( public StoredPaymentMethod supportedShopperInteractions( List supportedShopperInteractions) { this.supportedShopperInteractions = supportedShopperInteractions; + isSetSupportedShopperInteractions = true; // mark as set return this; } @@ -666,6 +756,7 @@ public List getSupportedShopperInteractions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSupportedShopperInteractions(List supportedShopperInteractions) { this.supportedShopperInteractions = supportedShopperInteractions; + isSetSupportedShopperInteractions = true; // mark as set } /** @@ -676,6 +767,7 @@ public void setSupportedShopperInteractions(List supportedShopperInterac */ public StoredPaymentMethod type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -699,6 +791,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StoredPaymentMethod object is equal to o. */ @@ -712,47 +825,85 @@ public boolean equals(Object o) { } StoredPaymentMethod storedPaymentMethod = (StoredPaymentMethod) o; return Objects.equals(this.bankAccountNumber, storedPaymentMethod.bankAccountNumber) + && Objects.equals(this.isSetBankAccountNumber, storedPaymentMethod.isSetBankAccountNumber) && Objects.equals(this.bankLocationId, storedPaymentMethod.bankLocationId) + && Objects.equals(this.isSetBankLocationId, storedPaymentMethod.isSetBankLocationId) && Objects.equals(this.brand, storedPaymentMethod.brand) + && Objects.equals(this.isSetBrand, storedPaymentMethod.isSetBrand) && Objects.equals(this.expiryMonth, storedPaymentMethod.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, storedPaymentMethod.isSetExpiryMonth) && Objects.equals(this.expiryYear, storedPaymentMethod.expiryYear) + && Objects.equals(this.isSetExpiryYear, storedPaymentMethod.isSetExpiryYear) && Objects.equals(this.holderName, storedPaymentMethod.holderName) + && Objects.equals(this.isSetHolderName, storedPaymentMethod.isSetHolderName) && Objects.equals(this.iban, storedPaymentMethod.iban) + && Objects.equals(this.isSetIban, storedPaymentMethod.isSetIban) && Objects.equals(this.id, storedPaymentMethod.id) + && Objects.equals(this.isSetId, storedPaymentMethod.isSetId) && Objects.equals(this.label, storedPaymentMethod.label) + && Objects.equals(this.isSetLabel, storedPaymentMethod.isSetLabel) && Objects.equals(this.lastFour, storedPaymentMethod.lastFour) + && Objects.equals(this.isSetLastFour, storedPaymentMethod.isSetLastFour) && Objects.equals(this.name, storedPaymentMethod.name) + && Objects.equals(this.isSetName, storedPaymentMethod.isSetName) && Objects.equals(this.networkTxReference, storedPaymentMethod.networkTxReference) + && Objects.equals(this.isSetNetworkTxReference, storedPaymentMethod.isSetNetworkTxReference) && Objects.equals(this.ownerName, storedPaymentMethod.ownerName) + && Objects.equals(this.isSetOwnerName, storedPaymentMethod.isSetOwnerName) && Objects.equals(this.shopperEmail, storedPaymentMethod.shopperEmail) + && Objects.equals(this.isSetShopperEmail, storedPaymentMethod.isSetShopperEmail) && Objects.equals( this.supportedRecurringProcessingModels, storedPaymentMethod.supportedRecurringProcessingModels) + && Objects.equals( + this.isSetSupportedRecurringProcessingModels, + storedPaymentMethod.isSetSupportedRecurringProcessingModels) && Objects.equals( this.supportedShopperInteractions, storedPaymentMethod.supportedShopperInteractions) - && Objects.equals(this.type, storedPaymentMethod.type); + && Objects.equals( + this.isSetSupportedShopperInteractions, + storedPaymentMethod.isSetSupportedShopperInteractions) + && Objects.equals(this.type, storedPaymentMethod.type) + && Objects.equals(this.isSetType, storedPaymentMethod.isSetType); } @Override public int hashCode() { return Objects.hash( bankAccountNumber, + isSetBankAccountNumber, bankLocationId, + isSetBankLocationId, brand, + isSetBrand, expiryMonth, + isSetExpiryMonth, expiryYear, + isSetExpiryYear, holderName, + isSetHolderName, iban, + isSetIban, id, + isSetId, label, + isSetLabel, lastFour, + isSetLastFour, name, + isSetName, networkTxReference, + isSetNetworkTxReference, ownerName, + isSetOwnerName, shopperEmail, + isSetShopperEmail, supportedRecurringProcessingModels, + isSetSupportedRecurringProcessingModels, supportedShopperInteractions, - type); + isSetSupportedShopperInteractions, + type, + isSetType); } @Override @@ -794,6 +945,82 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBankAccountNumber) { + addIfNull(nulls, JSON_PROPERTY_BANK_ACCOUNT_NUMBER, this.bankAccountNumber); + } + if (isSetBankLocationId) { + addIfNull(nulls, JSON_PROPERTY_BANK_LOCATION_ID, this.bankLocationId); + } + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetLabel) { + addIfNull(nulls, JSON_PROPERTY_LABEL, this.label); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetSupportedRecurringProcessingModels) { + addIfNull( + nulls, + JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS, + this.supportedRecurringProcessingModels); + } + if (isSetSupportedShopperInteractions) { + addIfNull( + nulls, JSON_PROPERTY_SUPPORTED_SHOPPER_INTERACTIONS, this.supportedShopperInteractions); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StoredPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java index 328fe145d..ffa613449 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,16 +35,28 @@ public class StoredPaymentMethodDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** The payment method type. */ public enum TypeEnum { BCMC_MOBILE(String.valueOf("bcmc_mobile")), @@ -119,6 +133,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredPaymentMethodDetails() {} /** @@ -129,6 +152,7 @@ public StoredPaymentMethodDetails() {} */ public StoredPaymentMethodDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -152,6 +176,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -166,6 +191,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public StoredPaymentMethodDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -197,6 +223,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -207,6 +234,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public StoredPaymentMethodDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -231,6 +259,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -243,6 +272,7 @@ public void setSdkData(String sdkData) { */ public StoredPaymentMethodDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -270,6 +300,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -280,6 +311,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public StoredPaymentMethodDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -303,6 +335,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethodDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StoredPaymentMethodDetails object is equal to o. */ @@ -316,18 +369,36 @@ public boolean equals(Object o) { } StoredPaymentMethodDetails storedPaymentMethodDetails = (StoredPaymentMethodDetails) o; return Objects.equals(this.checkoutAttemptId, storedPaymentMethodDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, storedPaymentMethodDetails.isSetCheckoutAttemptId) && Objects.equals( this.recurringDetailReference, storedPaymentMethodDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + storedPaymentMethodDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, storedPaymentMethodDetails.sdkData) + && Objects.equals(this.isSetSdkData, storedPaymentMethodDetails.isSetSdkData) && Objects.equals( this.storedPaymentMethodId, storedPaymentMethodDetails.storedPaymentMethodId) - && Objects.equals(this.type, storedPaymentMethodDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, storedPaymentMethodDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, storedPaymentMethodDetails.type) + && Objects.equals(this.isSetType, storedPaymentMethodDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, recurringDetailReference, sdkData, storedPaymentMethodId, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -357,6 +428,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StoredPaymentMethodDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java index 44816338d..dc0ca1ae1 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,9 +36,15 @@ public class StoredPaymentMethodRequest { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private PaymentMethodToStore paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + /** * Defines a recurring payment type. Required when creating a token to store payment details. * Allowed values: * `Subscription` – A transaction for a fixed or variable amount, @@ -94,15 +102,33 @@ public static RecurringProcessingModelEnum fromValue(String value) { public static final String JSON_PROPERTY_RECURRING_PROCESSING_MODEL = "recurringProcessingModel"; private RecurringProcessingModelEnum recurringProcessingModel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringProcessingModel = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredPaymentMethodRequest() {} /** @@ -114,6 +140,7 @@ public StoredPaymentMethodRequest() {} */ public StoredPaymentMethodRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -139,6 +166,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -149,6 +177,7 @@ public void setMerchantAccount(String merchantAccount) { */ public StoredPaymentMethodRequest paymentMethod(PaymentMethodToStore paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -172,6 +201,7 @@ public PaymentMethodToStore getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(PaymentMethodToStore paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -199,6 +229,7 @@ public void setPaymentMethod(PaymentMethodToStore paymentMethod) { public StoredPaymentMethodRequest recurringProcessingModel( RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set return this; } @@ -254,6 +285,7 @@ public RecurringProcessingModelEnum getRecurringProcessingModel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringProcessingModel) { this.recurringProcessingModel = recurringProcessingModel; + isSetRecurringProcessingModel = true; // mark as set } /** @@ -266,6 +298,7 @@ public void setRecurringProcessingModel(RecurringProcessingModelEnum recurringPr */ public StoredPaymentMethodRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -293,6 +326,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -303,6 +337,7 @@ public void setShopperEmail(String shopperEmail) { */ public StoredPaymentMethodRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -326,6 +361,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -337,6 +373,7 @@ public void setShopperIP(String shopperIP) { */ public StoredPaymentMethodRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -362,6 +399,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethodRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StoredPaymentMethodRequest object is equal to o. */ @@ -375,23 +433,39 @@ public boolean equals(Object o) { } StoredPaymentMethodRequest storedPaymentMethodRequest = (StoredPaymentMethodRequest) o; return Objects.equals(this.merchantAccount, storedPaymentMethodRequest.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, storedPaymentMethodRequest.isSetMerchantAccount) && Objects.equals(this.paymentMethod, storedPaymentMethodRequest.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, storedPaymentMethodRequest.isSetPaymentMethod) && Objects.equals( this.recurringProcessingModel, storedPaymentMethodRequest.recurringProcessingModel) + && Objects.equals( + this.isSetRecurringProcessingModel, + storedPaymentMethodRequest.isSetRecurringProcessingModel) && Objects.equals(this.shopperEmail, storedPaymentMethodRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, storedPaymentMethodRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, storedPaymentMethodRequest.shopperIP) - && Objects.equals(this.shopperReference, storedPaymentMethodRequest.shopperReference); + && Objects.equals(this.isSetShopperIP, storedPaymentMethodRequest.isSetShopperIP) + && Objects.equals(this.shopperReference, storedPaymentMethodRequest.shopperReference) + && Objects.equals( + this.isSetShopperReference, storedPaymentMethodRequest.isSetShopperReference); } @Override public int hashCode() { return Objects.hash( merchantAccount, + isSetMerchantAccount, paymentMethod, + isSetPaymentMethod, recurringProcessingModel, + isSetRecurringProcessingModel, shopperEmail, + isSetShopperEmail, shopperIP, - shopperReference); + isSetShopperIP, + shopperReference, + isSetShopperReference); } @Override @@ -420,6 +494,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetRecurringProcessingModel) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_PROCESSING_MODEL, this.recurringProcessingModel); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StoredPaymentMethodRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java index 838ad01b4..5162f59ac 100644 --- a/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java +++ b/src/main/java/com/adyen/model/checkout/StoredPaymentMethodResource.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -44,58 +46,118 @@ public class StoredPaymentMethodResource { public static final String JSON_PROPERTY_BRAND = "brand"; private String brand; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBrand = false; + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; private String expiryMonth; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; private String expiryYear; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + public static final String JSON_PROPERTY_EXTERNAL_RESPONSE_CODE = "externalResponseCode"; private String externalResponseCode; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalResponseCode = false; + public static final String JSON_PROPERTY_EXTERNAL_TOKEN_REFERENCE = "externalTokenReference"; private String externalTokenReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExternalTokenReference = false; + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; private String holderName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + public static final String JSON_PROPERTY_IBAN = "iban"; private String iban; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIban = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_ISSUER_NAME = "issuerName"; private String issuerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssuerName = false; + public static final String JSON_PROPERTY_LAST_FOUR = "lastFour"; private String lastFour; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetLastFour = false; + public static final String JSON_PROPERTY_MANDATE = "mandate"; private TokenMandate mandate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandate = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE = "networkTxReference"; private String networkTxReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReference = false; + public static final String JSON_PROPERTY_OWNER_NAME = "ownerName"; private String ownerName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOwnerName = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + public static final String JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS = "supportedRecurringProcessingModels"; private List supportedRecurringProcessingModels; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSupportedRecurringProcessingModels = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public StoredPaymentMethodResource() {} /** @@ -106,6 +168,7 @@ public StoredPaymentMethodResource() {} */ public StoredPaymentMethodResource brand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set return this; } @@ -129,6 +192,7 @@ public String getBrand() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrand(String brand) { this.brand = brand; + isSetBrand = true; // mark as set } /** @@ -139,6 +203,7 @@ public void setBrand(String brand) { */ public StoredPaymentMethodResource expiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set return this; } @@ -162,6 +227,7 @@ public String getExpiryMonth() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryMonth(String expiryMonth) { this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set } /** @@ -173,6 +239,7 @@ public void setExpiryMonth(String expiryMonth) { */ public StoredPaymentMethodResource expiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set return this; } @@ -198,6 +265,7 @@ public String getExpiryYear() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExpiryYear(String expiryYear) { this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set } /** @@ -209,6 +277,7 @@ public void setExpiryYear(String expiryYear) { */ public StoredPaymentMethodResource externalResponseCode(String externalResponseCode) { this.externalResponseCode = externalResponseCode; + isSetExternalResponseCode = true; // mark as set return this; } @@ -234,6 +303,7 @@ public String getExternalResponseCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalResponseCode(String externalResponseCode) { this.externalResponseCode = externalResponseCode; + isSetExternalResponseCode = true; // mark as set } /** @@ -246,6 +316,7 @@ public void setExternalResponseCode(String externalResponseCode) { */ public StoredPaymentMethodResource externalTokenReference(String externalTokenReference) { this.externalTokenReference = externalTokenReference; + isSetExternalTokenReference = true; // mark as set return this; } @@ -273,6 +344,7 @@ public String getExternalTokenReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExternalTokenReference(String externalTokenReference) { this.externalTokenReference = externalTokenReference; + isSetExternalTokenReference = true; // mark as set } /** @@ -283,6 +355,7 @@ public void setExternalTokenReference(String externalTokenReference) { */ public StoredPaymentMethodResource holderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set return this; } @@ -306,6 +379,7 @@ public String getHolderName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHolderName(String holderName) { this.holderName = holderName; + isSetHolderName = true; // mark as set } /** @@ -316,6 +390,7 @@ public void setHolderName(String holderName) { */ public StoredPaymentMethodResource iban(String iban) { this.iban = iban; + isSetIban = true; // mark as set return this; } @@ -339,6 +414,7 @@ public String getIban() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIban(String iban) { this.iban = iban; + isSetIban = true; // mark as set } /** @@ -349,6 +425,7 @@ public void setIban(String iban) { */ public StoredPaymentMethodResource id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -372,6 +449,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -382,6 +460,7 @@ public void setId(String id) { */ public StoredPaymentMethodResource issuerName(String issuerName) { this.issuerName = issuerName; + isSetIssuerName = true; // mark as set return this; } @@ -405,6 +484,7 @@ public String getIssuerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssuerName(String issuerName) { this.issuerName = issuerName; + isSetIssuerName = true; // mark as set } /** @@ -415,6 +495,7 @@ public void setIssuerName(String issuerName) { */ public StoredPaymentMethodResource lastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set return this; } @@ -438,6 +519,7 @@ public String getLastFour() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastFour(String lastFour) { this.lastFour = lastFour; + isSetLastFour = true; // mark as set } /** @@ -448,6 +530,7 @@ public void setLastFour(String lastFour) { */ public StoredPaymentMethodResource mandate(TokenMandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set return this; } @@ -471,6 +554,7 @@ public TokenMandate getMandate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandate(TokenMandate mandate) { this.mandate = mandate; + isSetMandate = true; // mark as set } /** @@ -481,6 +565,7 @@ public void setMandate(TokenMandate mandate) { */ public StoredPaymentMethodResource name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -504,6 +589,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -518,6 +604,7 @@ public void setName(String name) { */ public StoredPaymentMethodResource networkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set return this; } @@ -549,6 +636,7 @@ public String getNetworkTxReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNetworkTxReference(String networkTxReference) { this.networkTxReference = networkTxReference; + isSetNetworkTxReference = true; // mark as set } /** @@ -559,6 +647,7 @@ public void setNetworkTxReference(String networkTxReference) { */ public StoredPaymentMethodResource ownerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set return this; } @@ -582,6 +671,7 @@ public String getOwnerName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOwnerName(String ownerName) { this.ownerName = ownerName; + isSetOwnerName = true; // mark as set } /** @@ -592,6 +682,7 @@ public void setOwnerName(String ownerName) { */ public StoredPaymentMethodResource shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -615,6 +706,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -630,6 +722,7 @@ public void setShopperEmail(String shopperEmail) { */ public StoredPaymentMethodResource shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -663,6 +756,7 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set } /** @@ -689,6 +783,7 @@ public void setShopperReference(String shopperReference) { public StoredPaymentMethodResource supportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set return this; } @@ -752,6 +847,7 @@ public List getSupportedRecurringProcessingModels() { public void setSupportedRecurringProcessingModels( List supportedRecurringProcessingModels) { this.supportedRecurringProcessingModels = supportedRecurringProcessingModels; + isSetSupportedRecurringProcessingModels = true; // mark as set } /** @@ -762,6 +858,7 @@ public void setSupportedRecurringProcessingModels( */ public StoredPaymentMethodResource type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -785,6 +882,27 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public StoredPaymentMethodResource includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this StoredPaymentMethodResource object is equal to o. */ @@ -798,50 +916,93 @@ public boolean equals(Object o) { } StoredPaymentMethodResource storedPaymentMethodResource = (StoredPaymentMethodResource) o; return Objects.equals(this.brand, storedPaymentMethodResource.brand) + && Objects.equals(this.isSetBrand, storedPaymentMethodResource.isSetBrand) && Objects.equals(this.expiryMonth, storedPaymentMethodResource.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, storedPaymentMethodResource.isSetExpiryMonth) && Objects.equals(this.expiryYear, storedPaymentMethodResource.expiryYear) + && Objects.equals(this.isSetExpiryYear, storedPaymentMethodResource.isSetExpiryYear) && Objects.equals( this.externalResponseCode, storedPaymentMethodResource.externalResponseCode) + && Objects.equals( + this.isSetExternalResponseCode, storedPaymentMethodResource.isSetExternalResponseCode) && Objects.equals( this.externalTokenReference, storedPaymentMethodResource.externalTokenReference) + && Objects.equals( + this.isSetExternalTokenReference, + storedPaymentMethodResource.isSetExternalTokenReference) && Objects.equals(this.holderName, storedPaymentMethodResource.holderName) + && Objects.equals(this.isSetHolderName, storedPaymentMethodResource.isSetHolderName) && Objects.equals(this.iban, storedPaymentMethodResource.iban) + && Objects.equals(this.isSetIban, storedPaymentMethodResource.isSetIban) && Objects.equals(this.id, storedPaymentMethodResource.id) + && Objects.equals(this.isSetId, storedPaymentMethodResource.isSetId) && Objects.equals(this.issuerName, storedPaymentMethodResource.issuerName) + && Objects.equals(this.isSetIssuerName, storedPaymentMethodResource.isSetIssuerName) && Objects.equals(this.lastFour, storedPaymentMethodResource.lastFour) + && Objects.equals(this.isSetLastFour, storedPaymentMethodResource.isSetLastFour) && Objects.equals(this.mandate, storedPaymentMethodResource.mandate) + && Objects.equals(this.isSetMandate, storedPaymentMethodResource.isSetMandate) && Objects.equals(this.name, storedPaymentMethodResource.name) + && Objects.equals(this.isSetName, storedPaymentMethodResource.isSetName) && Objects.equals(this.networkTxReference, storedPaymentMethodResource.networkTxReference) + && Objects.equals( + this.isSetNetworkTxReference, storedPaymentMethodResource.isSetNetworkTxReference) && Objects.equals(this.ownerName, storedPaymentMethodResource.ownerName) + && Objects.equals(this.isSetOwnerName, storedPaymentMethodResource.isSetOwnerName) && Objects.equals(this.shopperEmail, storedPaymentMethodResource.shopperEmail) + && Objects.equals(this.isSetShopperEmail, storedPaymentMethodResource.isSetShopperEmail) && Objects.equals(this.shopperReference, storedPaymentMethodResource.shopperReference) + && Objects.equals( + this.isSetShopperReference, storedPaymentMethodResource.isSetShopperReference) && Objects.equals( this.supportedRecurringProcessingModels, storedPaymentMethodResource.supportedRecurringProcessingModels) - && Objects.equals(this.type, storedPaymentMethodResource.type); + && Objects.equals( + this.isSetSupportedRecurringProcessingModels, + storedPaymentMethodResource.isSetSupportedRecurringProcessingModels) + && Objects.equals(this.type, storedPaymentMethodResource.type) + && Objects.equals(this.isSetType, storedPaymentMethodResource.isSetType); } @Override public int hashCode() { return Objects.hash( brand, + isSetBrand, expiryMonth, + isSetExpiryMonth, expiryYear, + isSetExpiryYear, externalResponseCode, + isSetExternalResponseCode, externalTokenReference, + isSetExternalTokenReference, holderName, + isSetHolderName, iban, + isSetIban, id, + isSetId, issuerName, + isSetIssuerName, lastFour, + isSetLastFour, mandate, + isSetMandate, name, + isSetName, networkTxReference, + isSetNetworkTxReference, ownerName, + isSetOwnerName, shopperEmail, + isSetShopperEmail, shopperReference, + isSetShopperReference, supportedRecurringProcessingModels, - type); + isSetSupportedRecurringProcessingModels, + type, + isSetType); } @Override @@ -886,6 +1047,84 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBrand) { + addIfNull(nulls, JSON_PROPERTY_BRAND, this.brand); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetExternalResponseCode) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_RESPONSE_CODE, this.externalResponseCode); + } + if (isSetExternalTokenReference) { + addIfNull(nulls, JSON_PROPERTY_EXTERNAL_TOKEN_REFERENCE, this.externalTokenReference); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetIban) { + addIfNull(nulls, JSON_PROPERTY_IBAN, this.iban); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetIssuerName) { + addIfNull(nulls, JSON_PROPERTY_ISSUER_NAME, this.issuerName); + } + if (isSetLastFour) { + addIfNull(nulls, JSON_PROPERTY_LAST_FOUR, this.lastFour); + } + if (isSetMandate) { + addIfNull(nulls, JSON_PROPERTY_MANDATE, this.mandate); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetNetworkTxReference) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE, this.networkTxReference); + } + if (isSetOwnerName) { + addIfNull(nulls, JSON_PROPERTY_OWNER_NAME, this.ownerName); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + if (isSetSupportedRecurringProcessingModels) { + addIfNull( + nulls, + JSON_PROPERTY_SUPPORTED_RECURRING_PROCESSING_MODELS, + this.supportedRecurringProcessingModels); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of StoredPaymentMethodResource given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SubInputDetail.java b/src/main/java/com/adyen/model/checkout/SubInputDetail.java index eb296ac31..d6ea7e77a 100644 --- a/src/main/java/com/adyen/model/checkout/SubInputDetail.java +++ b/src/main/java/com/adyen/model/checkout/SubInputDetail.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,21 +36,45 @@ public class SubInputDetail { public static final String JSON_PROPERTY_CONFIGURATION = "configuration"; private Map configuration; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetConfiguration = false; + public static final String JSON_PROPERTY_ITEMS = "items"; private List items; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetItems = false; + public static final String JSON_PROPERTY_KEY = "key"; private String key; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetKey = false; + public static final String JSON_PROPERTY_OPTIONAL = "optional"; private Boolean optional; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOptional = false; + public static final String JSON_PROPERTY_TYPE = "type"; private String type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VALUE = "value"; private String value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubInputDetail() {} /** @@ -59,6 +85,7 @@ public SubInputDetail() {} */ public SubInputDetail configuration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set return this; } @@ -90,6 +117,7 @@ public Map getConfiguration() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfiguration(Map configuration) { this.configuration = configuration; + isSetConfiguration = true; // mark as set } /** @@ -100,6 +128,7 @@ public void setConfiguration(Map configuration) { */ public SubInputDetail items(List items) { this.items = items; + isSetItems = true; // mark as set return this; } @@ -131,6 +160,7 @@ public List getItems() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setItems(List items) { this.items = items; + isSetItems = true; // mark as set } /** @@ -141,6 +171,7 @@ public void setItems(List items) { */ public SubInputDetail key(String key) { this.key = key; + isSetKey = true; // mark as set return this; } @@ -164,6 +195,7 @@ public String getKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setKey(String key) { this.key = key; + isSetKey = true; // mark as set } /** @@ -174,6 +206,7 @@ public void setKey(String key) { */ public SubInputDetail optional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set return this; } @@ -197,6 +230,7 @@ public Boolean getOptional() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOptional(Boolean optional) { this.optional = optional; + isSetOptional = true; // mark as set } /** @@ -207,6 +241,7 @@ public void setOptional(Boolean optional) { */ public SubInputDetail type(String type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -230,6 +265,7 @@ public String getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(String type) { this.type = type; + isSetType = true; // mark as set } /** @@ -240,6 +276,7 @@ public void setType(String type) { */ public SubInputDetail value(String value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -263,6 +300,27 @@ public String getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(String value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubInputDetail includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SubInputDetail object is equal to o. */ @@ -276,16 +334,34 @@ public boolean equals(Object o) { } SubInputDetail subInputDetail = (SubInputDetail) o; return Objects.equals(this.configuration, subInputDetail.configuration) + && Objects.equals(this.isSetConfiguration, subInputDetail.isSetConfiguration) && Objects.equals(this.items, subInputDetail.items) + && Objects.equals(this.isSetItems, subInputDetail.isSetItems) && Objects.equals(this.key, subInputDetail.key) + && Objects.equals(this.isSetKey, subInputDetail.isSetKey) && Objects.equals(this.optional, subInputDetail.optional) + && Objects.equals(this.isSetOptional, subInputDetail.isSetOptional) && Objects.equals(this.type, subInputDetail.type) - && Objects.equals(this.value, subInputDetail.value); + && Objects.equals(this.isSetType, subInputDetail.isSetType) + && Objects.equals(this.value, subInputDetail.value) + && Objects.equals(this.isSetValue, subInputDetail.isSetValue); } @Override public int hashCode() { - return Objects.hash(configuration, items, key, optional, type, value); + return Objects.hash( + configuration, + isSetConfiguration, + items, + isSetItems, + key, + isSetKey, + optional, + isSetOptional, + type, + isSetType, + value, + isSetValue); } @Override @@ -312,6 +388,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetConfiguration) { + addIfNull(nulls, JSON_PROPERTY_CONFIGURATION, this.configuration); + } + if (isSetItems) { + addIfNull(nulls, JSON_PROPERTY_ITEMS, this.items); + } + if (isSetKey) { + addIfNull(nulls, JSON_PROPERTY_KEY, this.key); + } + if (isSetOptional) { + addIfNull(nulls, JSON_PROPERTY_OPTIONAL, this.optional); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SubInputDetail given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SubMerchant.java b/src/main/java/com/adyen/model/checkout/SubMerchant.java index be16e3e08..15c177e40 100644 --- a/src/main/java/com/adyen/model/checkout/SubMerchant.java +++ b/src/main/java/com/adyen/model/checkout/SubMerchant.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class SubMerchant { public static final String JSON_PROPERTY_CITY = "city"; private String city; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + public static final String JSON_PROPERTY_COUNTRY = "country"; private String country; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_TAX_ID = "taxId"; private String taxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubMerchant() {} /** @@ -53,6 +76,7 @@ public SubMerchant() {} */ public SubMerchant city(String city) { this.city = city; + isSetCity = true; // mark as set return this; } @@ -80,6 +104,7 @@ public String getCity() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCity(String city) { this.city = city; + isSetCity = true; // mark as set } /** @@ -94,6 +119,7 @@ public void setCity(String city) { */ public SubMerchant country(String country) { this.country = country; + isSetCountry = true; // mark as set return this; } @@ -125,6 +151,7 @@ public String getCountry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountry(String country) { this.country = country; + isSetCountry = true; // mark as set } /** @@ -137,6 +164,7 @@ public void setCountry(String country) { */ public SubMerchant mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -164,6 +192,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -178,6 +207,7 @@ public void setMcc(String mcc) { */ public SubMerchant name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -209,6 +239,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -221,6 +252,7 @@ public void setName(String name) { */ public SubMerchant taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -248,6 +280,27 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubMerchant includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SubMerchant object is equal to o. */ @@ -261,15 +314,21 @@ public boolean equals(Object o) { } SubMerchant subMerchant = (SubMerchant) o; return Objects.equals(this.city, subMerchant.city) + && Objects.equals(this.isSetCity, subMerchant.isSetCity) && Objects.equals(this.country, subMerchant.country) + && Objects.equals(this.isSetCountry, subMerchant.isSetCountry) && Objects.equals(this.mcc, subMerchant.mcc) + && Objects.equals(this.isSetMcc, subMerchant.isSetMcc) && Objects.equals(this.name, subMerchant.name) - && Objects.equals(this.taxId, subMerchant.taxId); + && Objects.equals(this.isSetName, subMerchant.isSetName) + && Objects.equals(this.taxId, subMerchant.taxId) + && Objects.equals(this.isSetTaxId, subMerchant.isSetTaxId); } @Override public int hashCode() { - return Objects.hash(city, country, mcc, name, taxId); + return Objects.hash( + city, isSetCity, country, isSetCountry, mcc, isSetMcc, name, isSetName, taxId, isSetTaxId); } @Override @@ -295,6 +354,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SubMerchant given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java b/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java index 9cdb9eb25..49ad646d8 100644 --- a/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java +++ b/src/main/java/com/adyen/model/checkout/SubMerchantInfo.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,33 +36,69 @@ public class SubMerchantInfo { public static final String JSON_PROPERTY_ADDRESS = "address"; private BillingAddress address; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddress = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + public static final String JSON_PROPERTY_EMAIL = "email"; private String email; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + public static final String JSON_PROPERTY_ID = "id"; private String id; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; private String phoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + public static final String JSON_PROPERTY_REGISTERED_SINCE = "registeredSince"; private String registeredSince; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRegisteredSince = false; + public static final String JSON_PROPERTY_TAX_ID = "taxId"; private String taxId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + public static final String JSON_PROPERTY_URL = "url"; private String url; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetUrl = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public SubMerchantInfo() {} /** @@ -71,6 +109,7 @@ public SubMerchantInfo() {} */ public SubMerchantInfo address(BillingAddress address) { this.address = address; + isSetAddress = true; // mark as set return this; } @@ -94,6 +133,7 @@ public BillingAddress getAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddress(BillingAddress address) { this.address = address; + isSetAddress = true; // mark as set } /** @@ -104,6 +144,7 @@ public void setAddress(BillingAddress address) { */ public SubMerchantInfo amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -127,6 +168,7 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -139,6 +181,7 @@ public void setAmount(Amount amount) { */ public SubMerchantInfo email(String email) { this.email = email; + isSetEmail = true; // mark as set return this; } @@ -166,6 +209,7 @@ public String getEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmail(String email) { this.email = email; + isSetEmail = true; // mark as set } /** @@ -180,6 +224,7 @@ public void setEmail(String email) { */ public SubMerchantInfo id(String id) { this.id = id; + isSetId = true; // mark as set return this; } @@ -211,6 +256,7 @@ public String getId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setId(String id) { this.id = id; + isSetId = true; // mark as set } /** @@ -224,6 +270,7 @@ public void setId(String id) { */ public SubMerchantInfo mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -253,6 +300,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -270,6 +318,7 @@ public void setMcc(String mcc) { */ public SubMerchantInfo name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -307,6 +356,7 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set } /** @@ -319,6 +369,7 @@ public void setName(String name) { */ public SubMerchantInfo phoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set return this; } @@ -346,6 +397,7 @@ public String getPhoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPhoneNumber(String phoneNumber) { this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set } /** @@ -356,6 +408,7 @@ public void setPhoneNumber(String phoneNumber) { */ public SubMerchantInfo registeredSince(String registeredSince) { this.registeredSince = registeredSince; + isSetRegisteredSince = true; // mark as set return this; } @@ -379,6 +432,7 @@ public String getRegisteredSince() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRegisteredSince(String registeredSince) { this.registeredSince = registeredSince; + isSetRegisteredSince = true; // mark as set } /** @@ -392,6 +446,7 @@ public void setRegisteredSince(String registeredSince) { */ public SubMerchantInfo taxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set return this; } @@ -421,6 +476,7 @@ public String getTaxId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTaxId(String taxId) { this.taxId = taxId; + isSetTaxId = true; // mark as set } /** @@ -433,6 +489,7 @@ public void setTaxId(String taxId) { */ public SubMerchantInfo url(String url) { this.url = url; + isSetUrl = true; // mark as set return this; } @@ -460,6 +517,27 @@ public String getUrl() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(String url) { this.url = url; + isSetUrl = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubMerchantInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this SubMerchantInfo object is equal to o. */ @@ -473,21 +551,50 @@ public boolean equals(Object o) { } SubMerchantInfo subMerchantInfo = (SubMerchantInfo) o; return Objects.equals(this.address, subMerchantInfo.address) + && Objects.equals(this.isSetAddress, subMerchantInfo.isSetAddress) && Objects.equals(this.amount, subMerchantInfo.amount) + && Objects.equals(this.isSetAmount, subMerchantInfo.isSetAmount) && Objects.equals(this.email, subMerchantInfo.email) + && Objects.equals(this.isSetEmail, subMerchantInfo.isSetEmail) && Objects.equals(this.id, subMerchantInfo.id) + && Objects.equals(this.isSetId, subMerchantInfo.isSetId) && Objects.equals(this.mcc, subMerchantInfo.mcc) + && Objects.equals(this.isSetMcc, subMerchantInfo.isSetMcc) && Objects.equals(this.name, subMerchantInfo.name) + && Objects.equals(this.isSetName, subMerchantInfo.isSetName) && Objects.equals(this.phoneNumber, subMerchantInfo.phoneNumber) + && Objects.equals(this.isSetPhoneNumber, subMerchantInfo.isSetPhoneNumber) && Objects.equals(this.registeredSince, subMerchantInfo.registeredSince) + && Objects.equals(this.isSetRegisteredSince, subMerchantInfo.isSetRegisteredSince) && Objects.equals(this.taxId, subMerchantInfo.taxId) - && Objects.equals(this.url, subMerchantInfo.url); + && Objects.equals(this.isSetTaxId, subMerchantInfo.isSetTaxId) + && Objects.equals(this.url, subMerchantInfo.url) + && Objects.equals(this.isSetUrl, subMerchantInfo.isSetUrl); } @Override public int hashCode() { return Objects.hash( - address, amount, email, id, mcc, name, phoneNumber, registeredSince, taxId, url); + address, + isSetAddress, + amount, + isSetAmount, + email, + isSetEmail, + id, + isSetId, + mcc, + isSetMcc, + name, + isSetName, + phoneNumber, + isSetPhoneNumber, + registeredSince, + isSetRegisteredSince, + taxId, + isSetTaxId, + url, + isSetUrl); } @Override @@ -518,6 +625,57 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAddress) { + addIfNull(nulls, JSON_PROPERTY_ADDRESS, this.address); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetRegisteredSince) { + addIfNull(nulls, JSON_PROPERTY_REGISTERED_SINCE, this.registeredSince); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + if (isSetUrl) { + addIfNull(nulls, JSON_PROPERTY_URL, this.url); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of SubMerchantInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Surcharge.java b/src/main/java/com/adyen/model/checkout/Surcharge.java index 0ae6704cf..6db4fe657 100644 --- a/src/main/java/com/adyen/model/checkout/Surcharge.java +++ b/src/main/java/com/adyen/model/checkout/Surcharge.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class Surcharge { public static final String JSON_PROPERTY_VALUE = "value"; private Long value; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Surcharge() {} /** @@ -44,6 +55,7 @@ public Surcharge() {} */ public Surcharge value(Long value) { this.value = value; + isSetValue = true; // mark as set return this; } @@ -89,6 +101,27 @@ public Long getValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setValue(Long value) { this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Surcharge includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Surcharge object is equal to o. */ @@ -101,12 +134,13 @@ public boolean equals(Object o) { return false; } Surcharge surcharge = (Surcharge) o; - return Objects.equals(this.value, surcharge.value); + return Objects.equals(this.value, surcharge.value) + && Objects.equals(this.isSetValue, surcharge.isSetValue); } @Override public int hashCode() { - return Objects.hash(value); + return Objects.hash(value, isSetValue); } @Override @@ -128,6 +162,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Surcharge given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TaxTotal.java b/src/main/java/com/adyen/model/checkout/TaxTotal.java index a97781446..6b2ed43d3 100644 --- a/src/main/java/com/adyen/model/checkout/TaxTotal.java +++ b/src/main/java/com/adyen/model/checkout/TaxTotal.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,6 +25,15 @@ public class TaxTotal { public static final String JSON_PROPERTY_AMOUNT = "amount"; private Amount amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TaxTotal() {} /** @@ -33,6 +44,7 @@ public TaxTotal() {} */ public TaxTotal amount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -56,6 +68,27 @@ public Amount getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(Amount amount) { this.amount = amount; + isSetAmount = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TaxTotal includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TaxTotal object is equal to o. */ @@ -68,12 +101,13 @@ public boolean equals(Object o) { return false; } TaxTotal taxTotal = (TaxTotal) o; - return Objects.equals(this.amount, taxTotal.amount); + return Objects.equals(this.amount, taxTotal.amount) + && Objects.equals(this.isSetAmount, taxTotal.isSetAmount); } @Override public int hashCode() { - return Objects.hash(amount); + return Objects.hash(amount, isSetAmount); } @Override @@ -95,6 +129,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TaxTotal given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java index 7eee2029a..5e3f4f63a 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -67,6 +69,9 @@ public class ThreeDS2RequestData { public static final String JSON_PROPERTY_ACCT_INFO = "acctInfo"; private AcctInfo acctInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcctInfo = false; + /** * Indicates the type of account. For example, for a multi-account card product. Length: 2 * characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit @@ -116,12 +121,21 @@ public static AcctTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCT_TYPE = "acctType"; private AcctTypeEnum acctType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcctType = false; + public static final String JSON_PROPERTY_ACQUIRER_B_I_N = "acquirerBIN"; private String acquirerBIN; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerBIN = false; + public static final String JSON_PROPERTY_ACQUIRER_MERCHANT_I_D = "acquirerMerchantID"; private String acquirerMerchantID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerMerchantID = false; + /** * Indicates whether the cardholder shipping address and cardholder billing address are the same. * Allowed values: * **Y** — Shipping address matches billing address. * **N** — Shipping address @@ -170,10 +184,16 @@ public static AddrMatchEnum fromValue(String value) { public static final String JSON_PROPERTY_ADDR_MATCH = "addrMatch"; private AddrMatchEnum addrMatch; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddrMatch = false; + public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v50: Use `threeDSAuthenticationOnly` instead. private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + /** * Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * * `noPreference` * `requestNoChallenge` * `requestChallenge` * @@ -228,78 +248,150 @@ public static ChallengeIndicatorEnum fromValue(String value) { // instead. private ChallengeIndicatorEnum challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = false; + public static final String JSON_PROPERTY_DEVICE_CHANNEL = "deviceChannel"; private String deviceChannel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceChannel = false; + public static final String JSON_PROPERTY_DEVICE_RENDER_OPTIONS = "deviceRenderOptions"; private DeviceRenderOptions deviceRenderOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceRenderOptions = false; + public static final String JSON_PROPERTY_HOME_PHONE = "homePhone"; private Phone homePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomePhone = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_NAME = "merchantName"; private String merchantName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantName = false; + public static final String JSON_PROPERTY_MESSAGE_VERSION = "messageVersion"; private String messageVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageVersion = false; + public static final String JSON_PROPERTY_MOBILE_PHONE = "mobilePhone"; private Phone mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + public static final String JSON_PROPERTY_NOTIFICATION_U_R_L = "notificationURL"; private String notificationURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationURL = false; + public static final String JSON_PROPERTY_PAY_TOKEN_IND = "payTokenInd"; private Boolean payTokenInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayTokenInd = false; + public static final String JSON_PROPERTY_PAYMENT_AUTHENTICATION_USE_CASE = "paymentAuthenticationUseCase"; private String paymentAuthenticationUseCase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAuthenticationUseCase = false; + public static final String JSON_PROPERTY_PURCHASE_INSTAL_DATA = "purchaseInstalData"; private String purchaseInstalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchaseInstalData = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private String recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + public static final String JSON_PROPERTY_SDK_APP_I_D = "sdkAppID"; private String sdkAppID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkAppID = false; + public static final String JSON_PROPERTY_SDK_ENC_DATA = "sdkEncData"; private String sdkEncData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEncData = false; + public static final String JSON_PROPERTY_SDK_EPHEM_PUB_KEY = "sdkEphemPubKey"; private SDKEphemPubKey sdkEphemPubKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEphemPubKey = false; + public static final String JSON_PROPERTY_SDK_MAX_TIMEOUT = "sdkMaxTimeout"; private Integer sdkMaxTimeout; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkMaxTimeout = false; + public static final String JSON_PROPERTY_SDK_REFERENCE_NUMBER = "sdkReferenceNumber"; private String sdkReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkReferenceNumber = false; + public static final String JSON_PROPERTY_SDK_TRANS_I_D = "sdkTransID"; private String sdkTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkTransID = false; + public static final String JSON_PROPERTY_SDK_VERSION = "sdkVersion"; private String sdkVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkVersion = false; + public static final String JSON_PROPERTY_THREE_D_S_COMP_IND = "threeDSCompInd"; private String threeDSCompInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSCompInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_IND = "threeDSRequestorAuthenticationInd"; private String threeDSRequestorAuthenticationInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAuthenticationInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_INFO = "threeDSRequestorAuthenticationInfo"; private ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAuthenticationInfo = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -359,19 +451,34 @@ public static ThreeDSRequestorChallengeIndEnum fromValue(String value) { "threeDSRequestorChallengeInd"; private ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorChallengeInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_I_D = "threeDSRequestorID"; private String threeDSRequestorID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorID = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_NAME = "threeDSRequestorName"; private String threeDSRequestorName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorName = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_PRIOR_AUTHENTICATION_INFO = "threeDSRequestorPriorAuthenticationInfo"; private ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorPriorAuthenticationInfo = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_U_R_L = "threeDSRequestorURL"; private String threeDSRequestorURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorURL = false; + /** * Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** @@ -426,6 +533,9 @@ public static TransTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANS_TYPE = "transType"; private TransTypeEnum transType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransType = false; + /** Identify the type of the transaction being authenticated. */ public enum TransactionTypeEnum { GOODSORSERVICEPURCHASE(String.valueOf("goodsOrServicePurchase")), @@ -476,12 +586,27 @@ public static TransactionTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANSACTION_TYPE = "transactionType"; private TransactionTypeEnum transactionType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionType = false; + public static final String JSON_PROPERTY_WHITE_LIST_STATUS = "whiteListStatus"; private String whiteListStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWhiteListStatus = false; + public static final String JSON_PROPERTY_WORK_PHONE = "workPhone"; private Phone workPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWorkPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2RequestData() {} /** @@ -492,6 +617,7 @@ public ThreeDS2RequestData() {} */ public ThreeDS2RequestData acctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set return this; } @@ -515,6 +641,7 @@ public AcctInfo getAcctInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set } /** @@ -528,6 +655,7 @@ public void setAcctInfo(AcctInfo acctInfo) { */ public ThreeDS2RequestData acctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set return this; } @@ -557,6 +685,7 @@ public AcctTypeEnum getAcctType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set } /** @@ -573,6 +702,7 @@ public void setAcctType(AcctTypeEnum acctType) { */ public ThreeDS2RequestData acquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set return this; } @@ -608,6 +738,7 @@ public String getAcquirerBIN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set } /** @@ -625,6 +756,7 @@ public void setAcquirerBIN(String acquirerBIN) { */ public ThreeDS2RequestData acquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set return this; } @@ -662,6 +794,7 @@ public String getAcquirerMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set } /** @@ -676,6 +809,7 @@ public void setAcquirerMerchantID(String acquirerMerchantID) { */ public ThreeDS2RequestData addrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set return this; } @@ -707,6 +841,7 @@ public AddrMatchEnum getAddrMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set } /** @@ -723,6 +858,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { @Deprecated // deprecated since Adyen Checkout API v50: Use `threeDSAuthenticationOnly` instead. public ThreeDS2RequestData authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -759,6 +895,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -776,6 +913,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { // instead. public ThreeDS2RequestData challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -814,6 +952,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -825,6 +964,7 @@ public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { */ public ThreeDS2RequestData deviceChannel(String deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set return this; } @@ -850,6 +990,7 @@ public String getDeviceChannel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceChannel(String deviceChannel) { this.deviceChannel = deviceChannel; + isSetDeviceChannel = true; // mark as set } /** @@ -860,6 +1001,7 @@ public void setDeviceChannel(String deviceChannel) { */ public ThreeDS2RequestData deviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set return this; } @@ -883,6 +1025,7 @@ public DeviceRenderOptions getDeviceRenderOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set } /** @@ -893,6 +1036,7 @@ public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { */ public ThreeDS2RequestData homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -916,6 +1060,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -934,6 +1079,7 @@ public void setHomePhone(Phone homePhone) { */ public ThreeDS2RequestData mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -973,6 +1119,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -997,6 +1144,7 @@ public void setMcc(String mcc) { */ public ThreeDS2RequestData merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -1048,6 +1196,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -1059,6 +1208,7 @@ public void setMerchantName(String merchantName) { */ public ThreeDS2RequestData messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -1084,6 +1234,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -1094,6 +1245,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2RequestData mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -1117,6 +1269,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -1131,6 +1284,7 @@ public void setMobilePhone(Phone mobilePhone) { */ public ThreeDS2RequestData notificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set return this; } @@ -1162,6 +1316,7 @@ public String getNotificationURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set } /** @@ -1174,6 +1329,7 @@ public void setNotificationURL(String notificationURL) { */ public ThreeDS2RequestData payTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set return this; } @@ -1201,6 +1357,7 @@ public Boolean getPayTokenInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set } /** @@ -1212,6 +1369,7 @@ public void setPayTokenInd(Boolean payTokenInd) { */ public ThreeDS2RequestData paymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set return this; } @@ -1237,6 +1395,7 @@ public String getPaymentAuthenticationUseCase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set } /** @@ -1249,6 +1408,7 @@ public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) */ public ThreeDS2RequestData purchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set return this; } @@ -1276,6 +1436,7 @@ public String getPurchaseInstalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set } /** @@ -1287,6 +1448,7 @@ public void setPurchaseInstalData(String purchaseInstalData) { */ public ThreeDS2RequestData recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1312,6 +1474,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1323,6 +1486,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public ThreeDS2RequestData recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1348,6 +1512,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -1360,6 +1525,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public ThreeDS2RequestData sdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set return this; } @@ -1387,6 +1553,7 @@ public String getSdkAppID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set } /** @@ -1399,6 +1566,7 @@ public void setSdkAppID(String sdkAppID) { */ public ThreeDS2RequestData sdkEncData(String sdkEncData) { this.sdkEncData = sdkEncData; + isSetSdkEncData = true; // mark as set return this; } @@ -1426,6 +1594,7 @@ public String getSdkEncData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEncData(String sdkEncData) { this.sdkEncData = sdkEncData; + isSetSdkEncData = true; // mark as set } /** @@ -1436,6 +1605,7 @@ public void setSdkEncData(String sdkEncData) { */ public ThreeDS2RequestData sdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -1459,6 +1629,7 @@ public SDKEphemPubKey getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -1472,6 +1643,7 @@ public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { */ public ThreeDS2RequestData sdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set return this; } @@ -1501,6 +1673,7 @@ public Integer getSdkMaxTimeout() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set } /** @@ -1513,6 +1686,7 @@ public void setSdkMaxTimeout(Integer sdkMaxTimeout) { */ public ThreeDS2RequestData sdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set return this; } @@ -1540,6 +1714,7 @@ public String getSdkReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set } /** @@ -1552,6 +1727,7 @@ public void setSdkReferenceNumber(String sdkReferenceNumber) { */ public ThreeDS2RequestData sdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set return this; } @@ -1579,6 +1755,7 @@ public String getSdkTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set } /** @@ -1590,6 +1767,7 @@ public void setSdkTransID(String sdkTransID) { */ public ThreeDS2RequestData sdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; + isSetSdkVersion = true; // mark as set return this; } @@ -1615,6 +1793,7 @@ public String getSdkVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; + isSetSdkVersion = true; // mark as set } /** @@ -1625,6 +1804,7 @@ public void setSdkVersion(String sdkVersion) { */ public ThreeDS2RequestData threeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set return this; } @@ -1648,6 +1828,7 @@ public String getThreeDSCompInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set } /** @@ -1659,6 +1840,7 @@ public void setThreeDSCompInd(String threeDSCompInd) { public ThreeDS2RequestData threeDSRequestorAuthenticationInd( String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set return this; } @@ -1682,6 +1864,7 @@ public String getThreeDSRequestorAuthenticationInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set } /** @@ -1693,6 +1876,7 @@ public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenti public ThreeDS2RequestData threeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set return this; } @@ -1717,6 +1901,7 @@ public ThreeDSRequestorAuthenticationInfo getThreeDSRequestorAuthenticationInfo( public void setThreeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set } /** @@ -1735,6 +1920,7 @@ public void setThreeDSRequestorAuthenticationInfo( public ThreeDS2RequestData threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -1773,6 +1959,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -1789,6 +1976,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2RequestData threeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set return this; } @@ -1824,6 +2012,7 @@ public String getThreeDSRequestorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set } /** @@ -1840,6 +2029,7 @@ public void setThreeDSRequestorID(String threeDSRequestorID) { */ public ThreeDS2RequestData threeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set return this; } @@ -1875,6 +2065,7 @@ public String getThreeDSRequestorName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set } /** @@ -1886,6 +2077,7 @@ public void setThreeDSRequestorName(String threeDSRequestorName) { public ThreeDS2RequestData threeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set return this; } @@ -1910,6 +2102,7 @@ public ThreeDSRequestorPriorAuthenticationInfo getThreeDSRequestorPriorAuthentic public void setThreeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set } /** @@ -1922,6 +2115,7 @@ public void setThreeDSRequestorPriorAuthenticationInfo( */ public ThreeDS2RequestData threeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set return this; } @@ -1949,6 +2143,7 @@ public String getThreeDSRequestorURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set } /** @@ -1963,6 +2158,7 @@ public void setThreeDSRequestorURL(String threeDSRequestorURL) { */ public ThreeDS2RequestData transType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set return this; } @@ -1994,6 +2190,7 @@ public TransTypeEnum getTransType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set } /** @@ -2004,6 +2201,7 @@ public void setTransType(TransTypeEnum transType) { */ public ThreeDS2RequestData transactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set return this; } @@ -2027,6 +2225,7 @@ public TransactionTypeEnum getTransactionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set } /** @@ -2039,6 +2238,7 @@ public void setTransactionType(TransactionTypeEnum transactionType) { */ public ThreeDS2RequestData whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -2066,6 +2266,7 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set } /** @@ -2076,6 +2277,7 @@ public void setWhiteListStatus(String whiteListStatus) { */ public ThreeDS2RequestData workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -2099,6 +2301,27 @@ public Phone getWorkPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWorkPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2RequestData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDS2RequestData object is equal to o. */ @@ -2112,96 +2335,187 @@ public boolean equals(Object o) { } ThreeDS2RequestData threeDS2RequestData = (ThreeDS2RequestData) o; return Objects.equals(this.acctInfo, threeDS2RequestData.acctInfo) + && Objects.equals(this.isSetAcctInfo, threeDS2RequestData.isSetAcctInfo) && Objects.equals(this.acctType, threeDS2RequestData.acctType) + && Objects.equals(this.isSetAcctType, threeDS2RequestData.isSetAcctType) && Objects.equals(this.acquirerBIN, threeDS2RequestData.acquirerBIN) + && Objects.equals(this.isSetAcquirerBIN, threeDS2RequestData.isSetAcquirerBIN) && Objects.equals(this.acquirerMerchantID, threeDS2RequestData.acquirerMerchantID) + && Objects.equals(this.isSetAcquirerMerchantID, threeDS2RequestData.isSetAcquirerMerchantID) && Objects.equals(this.addrMatch, threeDS2RequestData.addrMatch) + && Objects.equals(this.isSetAddrMatch, threeDS2RequestData.isSetAddrMatch) && Objects.equals(this.authenticationOnly, threeDS2RequestData.authenticationOnly) + && Objects.equals(this.isSetAuthenticationOnly, threeDS2RequestData.isSetAuthenticationOnly) && Objects.equals(this.challengeIndicator, threeDS2RequestData.challengeIndicator) + && Objects.equals(this.isSetChallengeIndicator, threeDS2RequestData.isSetChallengeIndicator) && Objects.equals(this.deviceChannel, threeDS2RequestData.deviceChannel) + && Objects.equals(this.isSetDeviceChannel, threeDS2RequestData.isSetDeviceChannel) && Objects.equals(this.deviceRenderOptions, threeDS2RequestData.deviceRenderOptions) + && Objects.equals( + this.isSetDeviceRenderOptions, threeDS2RequestData.isSetDeviceRenderOptions) && Objects.equals(this.homePhone, threeDS2RequestData.homePhone) + && Objects.equals(this.isSetHomePhone, threeDS2RequestData.isSetHomePhone) && Objects.equals(this.mcc, threeDS2RequestData.mcc) + && Objects.equals(this.isSetMcc, threeDS2RequestData.isSetMcc) && Objects.equals(this.merchantName, threeDS2RequestData.merchantName) + && Objects.equals(this.isSetMerchantName, threeDS2RequestData.isSetMerchantName) && Objects.equals(this.messageVersion, threeDS2RequestData.messageVersion) + && Objects.equals(this.isSetMessageVersion, threeDS2RequestData.isSetMessageVersion) && Objects.equals(this.mobilePhone, threeDS2RequestData.mobilePhone) + && Objects.equals(this.isSetMobilePhone, threeDS2RequestData.isSetMobilePhone) && Objects.equals(this.notificationURL, threeDS2RequestData.notificationURL) + && Objects.equals(this.isSetNotificationURL, threeDS2RequestData.isSetNotificationURL) && Objects.equals(this.payTokenInd, threeDS2RequestData.payTokenInd) + && Objects.equals(this.isSetPayTokenInd, threeDS2RequestData.isSetPayTokenInd) && Objects.equals( this.paymentAuthenticationUseCase, threeDS2RequestData.paymentAuthenticationUseCase) + && Objects.equals( + this.isSetPaymentAuthenticationUseCase, + threeDS2RequestData.isSetPaymentAuthenticationUseCase) && Objects.equals(this.purchaseInstalData, threeDS2RequestData.purchaseInstalData) + && Objects.equals(this.isSetPurchaseInstalData, threeDS2RequestData.isSetPurchaseInstalData) && Objects.equals(this.recurringExpiry, threeDS2RequestData.recurringExpiry) + && Objects.equals(this.isSetRecurringExpiry, threeDS2RequestData.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, threeDS2RequestData.recurringFrequency) + && Objects.equals(this.isSetRecurringFrequency, threeDS2RequestData.isSetRecurringFrequency) && Objects.equals(this.sdkAppID, threeDS2RequestData.sdkAppID) + && Objects.equals(this.isSetSdkAppID, threeDS2RequestData.isSetSdkAppID) && Objects.equals(this.sdkEncData, threeDS2RequestData.sdkEncData) + && Objects.equals(this.isSetSdkEncData, threeDS2RequestData.isSetSdkEncData) && Objects.equals(this.sdkEphemPubKey, threeDS2RequestData.sdkEphemPubKey) + && Objects.equals(this.isSetSdkEphemPubKey, threeDS2RequestData.isSetSdkEphemPubKey) && Objects.equals(this.sdkMaxTimeout, threeDS2RequestData.sdkMaxTimeout) + && Objects.equals(this.isSetSdkMaxTimeout, threeDS2RequestData.isSetSdkMaxTimeout) && Objects.equals(this.sdkReferenceNumber, threeDS2RequestData.sdkReferenceNumber) + && Objects.equals(this.isSetSdkReferenceNumber, threeDS2RequestData.isSetSdkReferenceNumber) && Objects.equals(this.sdkTransID, threeDS2RequestData.sdkTransID) + && Objects.equals(this.isSetSdkTransID, threeDS2RequestData.isSetSdkTransID) && Objects.equals(this.sdkVersion, threeDS2RequestData.sdkVersion) + && Objects.equals(this.isSetSdkVersion, threeDS2RequestData.isSetSdkVersion) && Objects.equals(this.threeDSCompInd, threeDS2RequestData.threeDSCompInd) + && Objects.equals(this.isSetThreeDSCompInd, threeDS2RequestData.isSetThreeDSCompInd) && Objects.equals( this.threeDSRequestorAuthenticationInd, threeDS2RequestData.threeDSRequestorAuthenticationInd) + && Objects.equals( + this.isSetThreeDSRequestorAuthenticationInd, + threeDS2RequestData.isSetThreeDSRequestorAuthenticationInd) && Objects.equals( this.threeDSRequestorAuthenticationInfo, threeDS2RequestData.threeDSRequestorAuthenticationInfo) + && Objects.equals( + this.isSetThreeDSRequestorAuthenticationInfo, + threeDS2RequestData.isSetThreeDSRequestorAuthenticationInfo) && Objects.equals( this.threeDSRequestorChallengeInd, threeDS2RequestData.threeDSRequestorChallengeInd) + && Objects.equals( + this.isSetThreeDSRequestorChallengeInd, + threeDS2RequestData.isSetThreeDSRequestorChallengeInd) && Objects.equals(this.threeDSRequestorID, threeDS2RequestData.threeDSRequestorID) + && Objects.equals(this.isSetThreeDSRequestorID, threeDS2RequestData.isSetThreeDSRequestorID) && Objects.equals(this.threeDSRequestorName, threeDS2RequestData.threeDSRequestorName) + && Objects.equals( + this.isSetThreeDSRequestorName, threeDS2RequestData.isSetThreeDSRequestorName) && Objects.equals( this.threeDSRequestorPriorAuthenticationInfo, threeDS2RequestData.threeDSRequestorPriorAuthenticationInfo) + && Objects.equals( + this.isSetThreeDSRequestorPriorAuthenticationInfo, + threeDS2RequestData.isSetThreeDSRequestorPriorAuthenticationInfo) && Objects.equals(this.threeDSRequestorURL, threeDS2RequestData.threeDSRequestorURL) + && Objects.equals( + this.isSetThreeDSRequestorURL, threeDS2RequestData.isSetThreeDSRequestorURL) && Objects.equals(this.transType, threeDS2RequestData.transType) + && Objects.equals(this.isSetTransType, threeDS2RequestData.isSetTransType) && Objects.equals(this.transactionType, threeDS2RequestData.transactionType) + && Objects.equals(this.isSetTransactionType, threeDS2RequestData.isSetTransactionType) && Objects.equals(this.whiteListStatus, threeDS2RequestData.whiteListStatus) - && Objects.equals(this.workPhone, threeDS2RequestData.workPhone); + && Objects.equals(this.isSetWhiteListStatus, threeDS2RequestData.isSetWhiteListStatus) + && Objects.equals(this.workPhone, threeDS2RequestData.workPhone) + && Objects.equals(this.isSetWorkPhone, threeDS2RequestData.isSetWorkPhone); } @Override public int hashCode() { return Objects.hash( acctInfo, + isSetAcctInfo, acctType, + isSetAcctType, acquirerBIN, + isSetAcquirerBIN, acquirerMerchantID, + isSetAcquirerMerchantID, addrMatch, + isSetAddrMatch, authenticationOnly, + isSetAuthenticationOnly, challengeIndicator, + isSetChallengeIndicator, deviceChannel, + isSetDeviceChannel, deviceRenderOptions, + isSetDeviceRenderOptions, homePhone, + isSetHomePhone, mcc, + isSetMcc, merchantName, + isSetMerchantName, messageVersion, + isSetMessageVersion, mobilePhone, + isSetMobilePhone, notificationURL, + isSetNotificationURL, payTokenInd, + isSetPayTokenInd, paymentAuthenticationUseCase, + isSetPaymentAuthenticationUseCase, purchaseInstalData, + isSetPurchaseInstalData, recurringExpiry, + isSetRecurringExpiry, recurringFrequency, + isSetRecurringFrequency, sdkAppID, + isSetSdkAppID, sdkEncData, + isSetSdkEncData, sdkEphemPubKey, + isSetSdkEphemPubKey, sdkMaxTimeout, + isSetSdkMaxTimeout, sdkReferenceNumber, + isSetSdkReferenceNumber, sdkTransID, + isSetSdkTransID, sdkVersion, + isSetSdkVersion, threeDSCompInd, + isSetThreeDSCompInd, threeDSRequestorAuthenticationInd, + isSetThreeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, + isSetThreeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, + isSetThreeDSRequestorChallengeInd, threeDSRequestorID, + isSetThreeDSRequestorID, threeDSRequestorName, + isSetThreeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, + isSetThreeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, + isSetThreeDSRequestorURL, transType, + isSetTransType, transactionType, + isSetTransactionType, whiteListStatus, - workPhone); + isSetWhiteListStatus, + workPhone, + isSetWorkPhone); } @Override @@ -2277,6 +2591,157 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcctInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCT_INFO, this.acctInfo); + } + if (isSetAcctType) { + addIfNull(nulls, JSON_PROPERTY_ACCT_TYPE, this.acctType); + } + if (isSetAcquirerBIN) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_B_I_N, this.acquirerBIN); + } + if (isSetAcquirerMerchantID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_MERCHANT_I_D, this.acquirerMerchantID); + } + if (isSetAddrMatch) { + addIfNull(nulls, JSON_PROPERTY_ADDR_MATCH, this.addrMatch); + } + if (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + if (isSetChallengeIndicator) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_INDICATOR, this.challengeIndicator); + } + if (isSetDeviceChannel) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_CHANNEL, this.deviceChannel); + } + if (isSetDeviceRenderOptions) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_RENDER_OPTIONS, this.deviceRenderOptions); + } + if (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetNotificationURL) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_U_R_L, this.notificationURL); + } + if (isSetPayTokenInd) { + addIfNull(nulls, JSON_PROPERTY_PAY_TOKEN_IND, this.payTokenInd); + } + if (isSetPaymentAuthenticationUseCase) { + addIfNull( + nulls, JSON_PROPERTY_PAYMENT_AUTHENTICATION_USE_CASE, this.paymentAuthenticationUseCase); + } + if (isSetPurchaseInstalData) { + addIfNull(nulls, JSON_PROPERTY_PURCHASE_INSTAL_DATA, this.purchaseInstalData); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetSdkAppID) { + addIfNull(nulls, JSON_PROPERTY_SDK_APP_I_D, this.sdkAppID); + } + if (isSetSdkEncData) { + addIfNull(nulls, JSON_PROPERTY_SDK_ENC_DATA, this.sdkEncData); + } + if (isSetSdkEphemPubKey) { + addIfNull(nulls, JSON_PROPERTY_SDK_EPHEM_PUB_KEY, this.sdkEphemPubKey); + } + if (isSetSdkMaxTimeout) { + addIfNull(nulls, JSON_PROPERTY_SDK_MAX_TIMEOUT, this.sdkMaxTimeout); + } + if (isSetSdkReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SDK_REFERENCE_NUMBER, this.sdkReferenceNumber); + } + if (isSetSdkTransID) { + addIfNull(nulls, JSON_PROPERTY_SDK_TRANS_I_D, this.sdkTransID); + } + if (isSetSdkVersion) { + addIfNull(nulls, JSON_PROPERTY_SDK_VERSION, this.sdkVersion); + } + if (isSetThreeDSCompInd) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_COMP_IND, this.threeDSCompInd); + } + if (isSetThreeDSRequestorAuthenticationInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_IND, + this.threeDSRequestorAuthenticationInd); + } + if (isSetThreeDSRequestorAuthenticationInfo) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_INFO, + this.threeDSRequestorAuthenticationInfo); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + if (isSetThreeDSRequestorID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_I_D, this.threeDSRequestorID); + } + if (isSetThreeDSRequestorName) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_NAME, this.threeDSRequestorName); + } + if (isSetThreeDSRequestorPriorAuthenticationInfo) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_PRIOR_AUTHENTICATION_INFO, + this.threeDSRequestorPriorAuthenticationInfo); + } + if (isSetThreeDSRequestorURL) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_U_R_L, this.threeDSRequestorURL); + } + if (isSetTransType) { + addIfNull(nulls, JSON_PROPERTY_TRANS_TYPE, this.transType); + } + if (isSetTransactionType) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_TYPE, this.transactionType); + } + if (isSetWhiteListStatus) { + addIfNull(nulls, JSON_PROPERTY_WHITE_LIST_STATUS, this.whiteListStatus); + } + if (isSetWorkPhone) { + addIfNull(nulls, JSON_PROPERTY_WORK_PHONE, this.workPhone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDS2RequestData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java index a8895bd16..b21d1316d 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2RequestFields.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -64,6 +66,9 @@ public class ThreeDS2RequestFields { public static final String JSON_PROPERTY_ACCT_INFO = "acctInfo"; private AcctInfo acctInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcctInfo = false; + /** * Indicates the type of account. For example, for a multi-account card product. Length: 2 * characters. Allowed values: * **01** — Not applicable * **02** — Credit * **03** — Debit @@ -113,12 +118,21 @@ public static AcctTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_ACCT_TYPE = "acctType"; private AcctTypeEnum acctType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcctType = false; + public static final String JSON_PROPERTY_ACQUIRER_B_I_N = "acquirerBIN"; private String acquirerBIN; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerBIN = false; + public static final String JSON_PROPERTY_ACQUIRER_MERCHANT_I_D = "acquirerMerchantID"; private String acquirerMerchantID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcquirerMerchantID = false; + /** * Indicates whether the cardholder shipping Address and cardholder billing address are the same. * Allowed values: * **Y** — Shipping Address matches Billing Address. * **N** — Shipping Address @@ -167,10 +181,16 @@ public static AddrMatchEnum fromValue(String value) { public static final String JSON_PROPERTY_ADDR_MATCH = "addrMatch"; private AddrMatchEnum addrMatch; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAddrMatch = false; + public static final String JSON_PROPERTY_AUTHENTICATION_ONLY = "authenticationOnly"; @Deprecated // deprecated since Adyen Checkout API v50: Use `threeDSAuthenticationOnly` instead. private Boolean authenticationOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationOnly = false; + /** * Possibility to specify a preference for receiving a challenge from the issuer. Allowed values: * * `noPreference` * `requestNoChallenge` * `requestChallenge` * @@ -225,69 +245,132 @@ public static ChallengeIndicatorEnum fromValue(String value) { // instead. private ChallengeIndicatorEnum challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = false; + public static final String JSON_PROPERTY_DEVICE_RENDER_OPTIONS = "deviceRenderOptions"; private DeviceRenderOptions deviceRenderOptions; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDeviceRenderOptions = false; + public static final String JSON_PROPERTY_HOME_PHONE = "homePhone"; private Phone homePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHomePhone = false; + public static final String JSON_PROPERTY_MCC = "mcc"; private String mcc; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + public static final String JSON_PROPERTY_MERCHANT_NAME = "merchantName"; private String merchantName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantName = false; + public static final String JSON_PROPERTY_MESSAGE_VERSION = "messageVersion"; private String messageVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageVersion = false; + public static final String JSON_PROPERTY_MOBILE_PHONE = "mobilePhone"; private Phone mobilePhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMobilePhone = false; + public static final String JSON_PROPERTY_NOTIFICATION_U_R_L = "notificationURL"; private String notificationURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNotificationURL = false; + public static final String JSON_PROPERTY_PAY_TOKEN_IND = "payTokenInd"; private Boolean payTokenInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPayTokenInd = false; + public static final String JSON_PROPERTY_PAYMENT_AUTHENTICATION_USE_CASE = "paymentAuthenticationUseCase"; private String paymentAuthenticationUseCase; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentAuthenticationUseCase = false; + public static final String JSON_PROPERTY_PURCHASE_INSTAL_DATA = "purchaseInstalData"; private String purchaseInstalData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPurchaseInstalData = false; + public static final String JSON_PROPERTY_RECURRING_EXPIRY = "recurringExpiry"; private String recurringExpiry; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringExpiry = false; + public static final String JSON_PROPERTY_RECURRING_FREQUENCY = "recurringFrequency"; private String recurringFrequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringFrequency = false; + public static final String JSON_PROPERTY_SDK_APP_I_D = "sdkAppID"; private String sdkAppID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkAppID = false; + public static final String JSON_PROPERTY_SDK_EPHEM_PUB_KEY = "sdkEphemPubKey"; private SDKEphemPubKey sdkEphemPubKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEphemPubKey = false; + public static final String JSON_PROPERTY_SDK_MAX_TIMEOUT = "sdkMaxTimeout"; private Integer sdkMaxTimeout; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkMaxTimeout = false; + public static final String JSON_PROPERTY_SDK_REFERENCE_NUMBER = "sdkReferenceNumber"; private String sdkReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkReferenceNumber = false; + public static final String JSON_PROPERTY_SDK_TRANS_I_D = "sdkTransID"; private String sdkTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkTransID = false; + public static final String JSON_PROPERTY_THREE_D_S_COMP_IND = "threeDSCompInd"; private String threeDSCompInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSCompInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_IND = "threeDSRequestorAuthenticationInd"; private String threeDSRequestorAuthenticationInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAuthenticationInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_INFO = "threeDSRequestorAuthenticationInfo"; private ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorAuthenticationInfo = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -347,19 +430,34 @@ public static ThreeDSRequestorChallengeIndEnum fromValue(String value) { "threeDSRequestorChallengeInd"; private ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorChallengeInd = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_I_D = "threeDSRequestorID"; private String threeDSRequestorID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorID = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_NAME = "threeDSRequestorName"; private String threeDSRequestorName; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorName = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_PRIOR_AUTHENTICATION_INFO = "threeDSRequestorPriorAuthenticationInfo"; private ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorPriorAuthenticationInfo = false; + public static final String JSON_PROPERTY_THREE_D_S_REQUESTOR_U_R_L = "threeDSRequestorURL"; private String threeDSRequestorURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorURL = false; + /** * Identifies the type of transaction being authenticated. Length: 2 characters. Allowed values: * * **01** — Goods/Service Purchase * **03** — Check Acceptance * **10** — Account Funding * **11** @@ -414,6 +512,9 @@ public static TransTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANS_TYPE = "transType"; private TransTypeEnum transType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransType = false; + /** Identify the type of the transaction being authenticated. */ public enum TransactionTypeEnum { GOODSORSERVICEPURCHASE(String.valueOf("goodsOrServicePurchase")), @@ -464,12 +565,27 @@ public static TransactionTypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TRANSACTION_TYPE = "transactionType"; private TransactionTypeEnum transactionType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransactionType = false; + public static final String JSON_PROPERTY_WHITE_LIST_STATUS = "whiteListStatus"; private String whiteListStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWhiteListStatus = false; + public static final String JSON_PROPERTY_WORK_PHONE = "workPhone"; private Phone workPhone; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWorkPhone = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2RequestFields() {} /** @@ -480,6 +596,7 @@ public ThreeDS2RequestFields() {} */ public ThreeDS2RequestFields acctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set return this; } @@ -503,6 +620,7 @@ public AcctInfo getAcctInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctInfo(AcctInfo acctInfo) { this.acctInfo = acctInfo; + isSetAcctInfo = true; // mark as set } /** @@ -516,6 +634,7 @@ public void setAcctInfo(AcctInfo acctInfo) { */ public ThreeDS2RequestFields acctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set return this; } @@ -545,6 +664,7 @@ public AcctTypeEnum getAcctType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcctType(AcctTypeEnum acctType) { this.acctType = acctType; + isSetAcctType = true; // mark as set } /** @@ -561,6 +681,7 @@ public void setAcctType(AcctTypeEnum acctType) { */ public ThreeDS2RequestFields acquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set return this; } @@ -596,6 +717,7 @@ public String getAcquirerBIN() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerBIN(String acquirerBIN) { this.acquirerBIN = acquirerBIN; + isSetAcquirerBIN = true; // mark as set } /** @@ -613,6 +735,7 @@ public void setAcquirerBIN(String acquirerBIN) { */ public ThreeDS2RequestFields acquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set return this; } @@ -650,6 +773,7 @@ public String getAcquirerMerchantID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcquirerMerchantID(String acquirerMerchantID) { this.acquirerMerchantID = acquirerMerchantID; + isSetAcquirerMerchantID = true; // mark as set } /** @@ -664,6 +788,7 @@ public void setAcquirerMerchantID(String acquirerMerchantID) { */ public ThreeDS2RequestFields addrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set return this; } @@ -695,6 +820,7 @@ public AddrMatchEnum getAddrMatch() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAddrMatch(AddrMatchEnum addrMatch) { this.addrMatch = addrMatch; + isSetAddrMatch = true; // mark as set } /** @@ -711,6 +837,7 @@ public void setAddrMatch(AddrMatchEnum addrMatch) { @Deprecated // deprecated since Adyen Checkout API v50: Use `threeDSAuthenticationOnly` instead. public ThreeDS2RequestFields authenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set return this; } @@ -747,6 +874,7 @@ public Boolean getAuthenticationOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationOnly(Boolean authenticationOnly) { this.authenticationOnly = authenticationOnly; + isSetAuthenticationOnly = true; // mark as set } /** @@ -764,6 +892,7 @@ public void setAuthenticationOnly(Boolean authenticationOnly) { // instead. public ThreeDS2RequestFields challengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -802,6 +931,7 @@ public ChallengeIndicatorEnum getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -812,6 +942,7 @@ public void setChallengeIndicator(ChallengeIndicatorEnum challengeIndicator) { */ public ThreeDS2RequestFields deviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set return this; } @@ -835,6 +966,7 @@ public DeviceRenderOptions getDeviceRenderOptions() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { this.deviceRenderOptions = deviceRenderOptions; + isSetDeviceRenderOptions = true; // mark as set } /** @@ -845,6 +977,7 @@ public void setDeviceRenderOptions(DeviceRenderOptions deviceRenderOptions) { */ public ThreeDS2RequestFields homePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set return this; } @@ -868,6 +1001,7 @@ public Phone getHomePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHomePhone(Phone homePhone) { this.homePhone = homePhone; + isSetHomePhone = true; // mark as set } /** @@ -886,6 +1020,7 @@ public void setHomePhone(Phone homePhone) { */ public ThreeDS2RequestFields mcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set return this; } @@ -925,6 +1060,7 @@ public String getMcc() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMcc(String mcc) { this.mcc = mcc; + isSetMcc = true; // mark as set } /** @@ -949,6 +1085,7 @@ public void setMcc(String mcc) { */ public ThreeDS2RequestFields merchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set return this; } @@ -1000,6 +1137,7 @@ public String getMerchantName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantName(String merchantName) { this.merchantName = merchantName; + isSetMerchantName = true; // mark as set } /** @@ -1011,6 +1149,7 @@ public void setMerchantName(String merchantName) { */ public ThreeDS2RequestFields messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -1036,6 +1175,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -1046,6 +1186,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2RequestFields mobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set return this; } @@ -1069,6 +1210,7 @@ public Phone getMobilePhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMobilePhone(Phone mobilePhone) { this.mobilePhone = mobilePhone; + isSetMobilePhone = true; // mark as set } /** @@ -1083,6 +1225,7 @@ public void setMobilePhone(Phone mobilePhone) { */ public ThreeDS2RequestFields notificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set return this; } @@ -1114,6 +1257,7 @@ public String getNotificationURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNotificationURL(String notificationURL) { this.notificationURL = notificationURL; + isSetNotificationURL = true; // mark as set } /** @@ -1126,6 +1270,7 @@ public void setNotificationURL(String notificationURL) { */ public ThreeDS2RequestFields payTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set return this; } @@ -1153,6 +1298,7 @@ public Boolean getPayTokenInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPayTokenInd(Boolean payTokenInd) { this.payTokenInd = payTokenInd; + isSetPayTokenInd = true; // mark as set } /** @@ -1164,6 +1310,7 @@ public void setPayTokenInd(Boolean payTokenInd) { */ public ThreeDS2RequestFields paymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set return this; } @@ -1189,6 +1336,7 @@ public String getPaymentAuthenticationUseCase() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) { this.paymentAuthenticationUseCase = paymentAuthenticationUseCase; + isSetPaymentAuthenticationUseCase = true; // mark as set } /** @@ -1201,6 +1349,7 @@ public void setPaymentAuthenticationUseCase(String paymentAuthenticationUseCase) */ public ThreeDS2RequestFields purchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set return this; } @@ -1228,6 +1377,7 @@ public String getPurchaseInstalData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPurchaseInstalData(String purchaseInstalData) { this.purchaseInstalData = purchaseInstalData; + isSetPurchaseInstalData = true; // mark as set } /** @@ -1239,6 +1389,7 @@ public void setPurchaseInstalData(String purchaseInstalData) { */ public ThreeDS2RequestFields recurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set return this; } @@ -1264,6 +1415,7 @@ public String getRecurringExpiry() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringExpiry(String recurringExpiry) { this.recurringExpiry = recurringExpiry; + isSetRecurringExpiry = true; // mark as set } /** @@ -1275,6 +1427,7 @@ public void setRecurringExpiry(String recurringExpiry) { */ public ThreeDS2RequestFields recurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set return this; } @@ -1300,6 +1453,7 @@ public String getRecurringFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringFrequency(String recurringFrequency) { this.recurringFrequency = recurringFrequency; + isSetRecurringFrequency = true; // mark as set } /** @@ -1310,6 +1464,7 @@ public void setRecurringFrequency(String recurringFrequency) { */ public ThreeDS2RequestFields sdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set return this; } @@ -1333,6 +1488,7 @@ public String getSdkAppID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkAppID(String sdkAppID) { this.sdkAppID = sdkAppID; + isSetSdkAppID = true; // mark as set } /** @@ -1343,6 +1499,7 @@ public void setSdkAppID(String sdkAppID) { */ public ThreeDS2RequestFields sdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -1366,6 +1523,7 @@ public SDKEphemPubKey getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -1379,6 +1537,7 @@ public void setSdkEphemPubKey(SDKEphemPubKey sdkEphemPubKey) { */ public ThreeDS2RequestFields sdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set return this; } @@ -1408,6 +1567,7 @@ public Integer getSdkMaxTimeout() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkMaxTimeout(Integer sdkMaxTimeout) { this.sdkMaxTimeout = sdkMaxTimeout; + isSetSdkMaxTimeout = true; // mark as set } /** @@ -1419,6 +1579,7 @@ public void setSdkMaxTimeout(Integer sdkMaxTimeout) { */ public ThreeDS2RequestFields sdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set return this; } @@ -1444,6 +1605,7 @@ public String getSdkReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkReferenceNumber(String sdkReferenceNumber) { this.sdkReferenceNumber = sdkReferenceNumber; + isSetSdkReferenceNumber = true; // mark as set } /** @@ -1454,6 +1616,7 @@ public void setSdkReferenceNumber(String sdkReferenceNumber) { */ public ThreeDS2RequestFields sdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set return this; } @@ -1477,6 +1640,7 @@ public String getSdkTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkTransID(String sdkTransID) { this.sdkTransID = sdkTransID; + isSetSdkTransID = true; // mark as set } /** @@ -1487,6 +1651,7 @@ public void setSdkTransID(String sdkTransID) { */ public ThreeDS2RequestFields threeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set return this; } @@ -1510,6 +1675,7 @@ public String getThreeDSCompInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSCompInd(String threeDSCompInd) { this.threeDSCompInd = threeDSCompInd; + isSetThreeDSCompInd = true; // mark as set } /** @@ -1521,6 +1687,7 @@ public void setThreeDSCompInd(String threeDSCompInd) { public ThreeDS2RequestFields threeDSRequestorAuthenticationInd( String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set return this; } @@ -1544,6 +1711,7 @@ public String getThreeDSRequestorAuthenticationInd() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenticationInd) { this.threeDSRequestorAuthenticationInd = threeDSRequestorAuthenticationInd; + isSetThreeDSRequestorAuthenticationInd = true; // mark as set } /** @@ -1555,6 +1723,7 @@ public void setThreeDSRequestorAuthenticationInd(String threeDSRequestorAuthenti public ThreeDS2RequestFields threeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set return this; } @@ -1579,6 +1748,7 @@ public ThreeDSRequestorAuthenticationInfo getThreeDSRequestorAuthenticationInfo( public void setThreeDSRequestorAuthenticationInfo( ThreeDSRequestorAuthenticationInfo threeDSRequestorAuthenticationInfo) { this.threeDSRequestorAuthenticationInfo = threeDSRequestorAuthenticationInfo; + isSetThreeDSRequestorAuthenticationInfo = true; // mark as set } /** @@ -1597,6 +1767,7 @@ public void setThreeDSRequestorAuthenticationInfo( public ThreeDS2RequestFields threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -1635,6 +1806,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -1651,6 +1823,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2RequestFields threeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set return this; } @@ -1686,6 +1859,7 @@ public String getThreeDSRequestorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorID(String threeDSRequestorID) { this.threeDSRequestorID = threeDSRequestorID; + isSetThreeDSRequestorID = true; // mark as set } /** @@ -1702,6 +1876,7 @@ public void setThreeDSRequestorID(String threeDSRequestorID) { */ public ThreeDS2RequestFields threeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set return this; } @@ -1737,6 +1912,7 @@ public String getThreeDSRequestorName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorName(String threeDSRequestorName) { this.threeDSRequestorName = threeDSRequestorName; + isSetThreeDSRequestorName = true; // mark as set } /** @@ -1748,6 +1924,7 @@ public void setThreeDSRequestorName(String threeDSRequestorName) { public ThreeDS2RequestFields threeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set return this; } @@ -1772,6 +1949,7 @@ public ThreeDSRequestorPriorAuthenticationInfo getThreeDSRequestorPriorAuthentic public void setThreeDSRequestorPriorAuthenticationInfo( ThreeDSRequestorPriorAuthenticationInfo threeDSRequestorPriorAuthenticationInfo) { this.threeDSRequestorPriorAuthenticationInfo = threeDSRequestorPriorAuthenticationInfo; + isSetThreeDSRequestorPriorAuthenticationInfo = true; // mark as set } /** @@ -1784,6 +1962,7 @@ public void setThreeDSRequestorPriorAuthenticationInfo( */ public ThreeDS2RequestFields threeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set return this; } @@ -1811,6 +1990,7 @@ public String getThreeDSRequestorURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSRequestorURL(String threeDSRequestorURL) { this.threeDSRequestorURL = threeDSRequestorURL; + isSetThreeDSRequestorURL = true; // mark as set } /** @@ -1825,6 +2005,7 @@ public void setThreeDSRequestorURL(String threeDSRequestorURL) { */ public ThreeDS2RequestFields transType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set return this; } @@ -1856,6 +2037,7 @@ public TransTypeEnum getTransType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransType(TransTypeEnum transType) { this.transType = transType; + isSetTransType = true; // mark as set } /** @@ -1866,6 +2048,7 @@ public void setTransType(TransTypeEnum transType) { */ public ThreeDS2RequestFields transactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set return this; } @@ -1889,6 +2072,7 @@ public TransactionTypeEnum getTransactionType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransactionType(TransactionTypeEnum transactionType) { this.transactionType = transactionType; + isSetTransactionType = true; // mark as set } /** @@ -1901,6 +2085,7 @@ public void setTransactionType(TransactionTypeEnum transactionType) { */ public ThreeDS2RequestFields whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -1928,6 +2113,7 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set } /** @@ -1938,6 +2124,7 @@ public void setWhiteListStatus(String whiteListStatus) { */ public ThreeDS2RequestFields workPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set return this; } @@ -1961,6 +2148,27 @@ public Phone getWorkPhone() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWorkPhone(Phone workPhone) { this.workPhone = workPhone; + isSetWorkPhone = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2RequestFields includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDS2RequestFields object is equal to o. */ @@ -1974,90 +2182,182 @@ public boolean equals(Object o) { } ThreeDS2RequestFields threeDS2RequestFields = (ThreeDS2RequestFields) o; return Objects.equals(this.acctInfo, threeDS2RequestFields.acctInfo) + && Objects.equals(this.isSetAcctInfo, threeDS2RequestFields.isSetAcctInfo) && Objects.equals(this.acctType, threeDS2RequestFields.acctType) + && Objects.equals(this.isSetAcctType, threeDS2RequestFields.isSetAcctType) && Objects.equals(this.acquirerBIN, threeDS2RequestFields.acquirerBIN) + && Objects.equals(this.isSetAcquirerBIN, threeDS2RequestFields.isSetAcquirerBIN) && Objects.equals(this.acquirerMerchantID, threeDS2RequestFields.acquirerMerchantID) + && Objects.equals( + this.isSetAcquirerMerchantID, threeDS2RequestFields.isSetAcquirerMerchantID) && Objects.equals(this.addrMatch, threeDS2RequestFields.addrMatch) + && Objects.equals(this.isSetAddrMatch, threeDS2RequestFields.isSetAddrMatch) && Objects.equals(this.authenticationOnly, threeDS2RequestFields.authenticationOnly) + && Objects.equals( + this.isSetAuthenticationOnly, threeDS2RequestFields.isSetAuthenticationOnly) && Objects.equals(this.challengeIndicator, threeDS2RequestFields.challengeIndicator) + && Objects.equals( + this.isSetChallengeIndicator, threeDS2RequestFields.isSetChallengeIndicator) && Objects.equals(this.deviceRenderOptions, threeDS2RequestFields.deviceRenderOptions) + && Objects.equals( + this.isSetDeviceRenderOptions, threeDS2RequestFields.isSetDeviceRenderOptions) && Objects.equals(this.homePhone, threeDS2RequestFields.homePhone) + && Objects.equals(this.isSetHomePhone, threeDS2RequestFields.isSetHomePhone) && Objects.equals(this.mcc, threeDS2RequestFields.mcc) + && Objects.equals(this.isSetMcc, threeDS2RequestFields.isSetMcc) && Objects.equals(this.merchantName, threeDS2RequestFields.merchantName) + && Objects.equals(this.isSetMerchantName, threeDS2RequestFields.isSetMerchantName) && Objects.equals(this.messageVersion, threeDS2RequestFields.messageVersion) + && Objects.equals(this.isSetMessageVersion, threeDS2RequestFields.isSetMessageVersion) && Objects.equals(this.mobilePhone, threeDS2RequestFields.mobilePhone) + && Objects.equals(this.isSetMobilePhone, threeDS2RequestFields.isSetMobilePhone) && Objects.equals(this.notificationURL, threeDS2RequestFields.notificationURL) + && Objects.equals(this.isSetNotificationURL, threeDS2RequestFields.isSetNotificationURL) && Objects.equals(this.payTokenInd, threeDS2RequestFields.payTokenInd) + && Objects.equals(this.isSetPayTokenInd, threeDS2RequestFields.isSetPayTokenInd) && Objects.equals( this.paymentAuthenticationUseCase, threeDS2RequestFields.paymentAuthenticationUseCase) + && Objects.equals( + this.isSetPaymentAuthenticationUseCase, + threeDS2RequestFields.isSetPaymentAuthenticationUseCase) && Objects.equals(this.purchaseInstalData, threeDS2RequestFields.purchaseInstalData) + && Objects.equals( + this.isSetPurchaseInstalData, threeDS2RequestFields.isSetPurchaseInstalData) && Objects.equals(this.recurringExpiry, threeDS2RequestFields.recurringExpiry) + && Objects.equals(this.isSetRecurringExpiry, threeDS2RequestFields.isSetRecurringExpiry) && Objects.equals(this.recurringFrequency, threeDS2RequestFields.recurringFrequency) + && Objects.equals( + this.isSetRecurringFrequency, threeDS2RequestFields.isSetRecurringFrequency) && Objects.equals(this.sdkAppID, threeDS2RequestFields.sdkAppID) + && Objects.equals(this.isSetSdkAppID, threeDS2RequestFields.isSetSdkAppID) && Objects.equals(this.sdkEphemPubKey, threeDS2RequestFields.sdkEphemPubKey) + && Objects.equals(this.isSetSdkEphemPubKey, threeDS2RequestFields.isSetSdkEphemPubKey) && Objects.equals(this.sdkMaxTimeout, threeDS2RequestFields.sdkMaxTimeout) + && Objects.equals(this.isSetSdkMaxTimeout, threeDS2RequestFields.isSetSdkMaxTimeout) && Objects.equals(this.sdkReferenceNumber, threeDS2RequestFields.sdkReferenceNumber) + && Objects.equals( + this.isSetSdkReferenceNumber, threeDS2RequestFields.isSetSdkReferenceNumber) && Objects.equals(this.sdkTransID, threeDS2RequestFields.sdkTransID) + && Objects.equals(this.isSetSdkTransID, threeDS2RequestFields.isSetSdkTransID) && Objects.equals(this.threeDSCompInd, threeDS2RequestFields.threeDSCompInd) + && Objects.equals(this.isSetThreeDSCompInd, threeDS2RequestFields.isSetThreeDSCompInd) && Objects.equals( this.threeDSRequestorAuthenticationInd, threeDS2RequestFields.threeDSRequestorAuthenticationInd) + && Objects.equals( + this.isSetThreeDSRequestorAuthenticationInd, + threeDS2RequestFields.isSetThreeDSRequestorAuthenticationInd) && Objects.equals( this.threeDSRequestorAuthenticationInfo, threeDS2RequestFields.threeDSRequestorAuthenticationInfo) + && Objects.equals( + this.isSetThreeDSRequestorAuthenticationInfo, + threeDS2RequestFields.isSetThreeDSRequestorAuthenticationInfo) && Objects.equals( this.threeDSRequestorChallengeInd, threeDS2RequestFields.threeDSRequestorChallengeInd) + && Objects.equals( + this.isSetThreeDSRequestorChallengeInd, + threeDS2RequestFields.isSetThreeDSRequestorChallengeInd) && Objects.equals(this.threeDSRequestorID, threeDS2RequestFields.threeDSRequestorID) + && Objects.equals( + this.isSetThreeDSRequestorID, threeDS2RequestFields.isSetThreeDSRequestorID) && Objects.equals(this.threeDSRequestorName, threeDS2RequestFields.threeDSRequestorName) + && Objects.equals( + this.isSetThreeDSRequestorName, threeDS2RequestFields.isSetThreeDSRequestorName) && Objects.equals( this.threeDSRequestorPriorAuthenticationInfo, threeDS2RequestFields.threeDSRequestorPriorAuthenticationInfo) + && Objects.equals( + this.isSetThreeDSRequestorPriorAuthenticationInfo, + threeDS2RequestFields.isSetThreeDSRequestorPriorAuthenticationInfo) && Objects.equals(this.threeDSRequestorURL, threeDS2RequestFields.threeDSRequestorURL) + && Objects.equals( + this.isSetThreeDSRequestorURL, threeDS2RequestFields.isSetThreeDSRequestorURL) && Objects.equals(this.transType, threeDS2RequestFields.transType) + && Objects.equals(this.isSetTransType, threeDS2RequestFields.isSetTransType) && Objects.equals(this.transactionType, threeDS2RequestFields.transactionType) + && Objects.equals(this.isSetTransactionType, threeDS2RequestFields.isSetTransactionType) && Objects.equals(this.whiteListStatus, threeDS2RequestFields.whiteListStatus) - && Objects.equals(this.workPhone, threeDS2RequestFields.workPhone); + && Objects.equals(this.isSetWhiteListStatus, threeDS2RequestFields.isSetWhiteListStatus) + && Objects.equals(this.workPhone, threeDS2RequestFields.workPhone) + && Objects.equals(this.isSetWorkPhone, threeDS2RequestFields.isSetWorkPhone); } @Override public int hashCode() { return Objects.hash( acctInfo, + isSetAcctInfo, acctType, + isSetAcctType, acquirerBIN, + isSetAcquirerBIN, acquirerMerchantID, + isSetAcquirerMerchantID, addrMatch, + isSetAddrMatch, authenticationOnly, + isSetAuthenticationOnly, challengeIndicator, + isSetChallengeIndicator, deviceRenderOptions, + isSetDeviceRenderOptions, homePhone, + isSetHomePhone, mcc, + isSetMcc, merchantName, + isSetMerchantName, messageVersion, + isSetMessageVersion, mobilePhone, + isSetMobilePhone, notificationURL, + isSetNotificationURL, payTokenInd, + isSetPayTokenInd, paymentAuthenticationUseCase, + isSetPaymentAuthenticationUseCase, purchaseInstalData, + isSetPurchaseInstalData, recurringExpiry, + isSetRecurringExpiry, recurringFrequency, + isSetRecurringFrequency, sdkAppID, + isSetSdkAppID, sdkEphemPubKey, + isSetSdkEphemPubKey, sdkMaxTimeout, + isSetSdkMaxTimeout, sdkReferenceNumber, + isSetSdkReferenceNumber, sdkTransID, + isSetSdkTransID, threeDSCompInd, + isSetThreeDSCompInd, threeDSRequestorAuthenticationInd, + isSetThreeDSRequestorAuthenticationInd, threeDSRequestorAuthenticationInfo, + isSetThreeDSRequestorAuthenticationInfo, threeDSRequestorChallengeInd, + isSetThreeDSRequestorChallengeInd, threeDSRequestorID, + isSetThreeDSRequestorID, threeDSRequestorName, + isSetThreeDSRequestorName, threeDSRequestorPriorAuthenticationInfo, + isSetThreeDSRequestorPriorAuthenticationInfo, threeDSRequestorURL, + isSetThreeDSRequestorURL, transType, + isSetTransType, transactionType, + isSetTransactionType, whiteListStatus, - workPhone); + isSetWhiteListStatus, + workPhone, + isSetWorkPhone); } @Override @@ -2130,6 +2430,148 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcctInfo) { + addIfNull(nulls, JSON_PROPERTY_ACCT_INFO, this.acctInfo); + } + if (isSetAcctType) { + addIfNull(nulls, JSON_PROPERTY_ACCT_TYPE, this.acctType); + } + if (isSetAcquirerBIN) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_B_I_N, this.acquirerBIN); + } + if (isSetAcquirerMerchantID) { + addIfNull(nulls, JSON_PROPERTY_ACQUIRER_MERCHANT_I_D, this.acquirerMerchantID); + } + if (isSetAddrMatch) { + addIfNull(nulls, JSON_PROPERTY_ADDR_MATCH, this.addrMatch); + } + if (isSetAuthenticationOnly) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_ONLY, this.authenticationOnly); + } + if (isSetChallengeIndicator) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_INDICATOR, this.challengeIndicator); + } + if (isSetDeviceRenderOptions) { + addIfNull(nulls, JSON_PROPERTY_DEVICE_RENDER_OPTIONS, this.deviceRenderOptions); + } + if (isSetHomePhone) { + addIfNull(nulls, JSON_PROPERTY_HOME_PHONE, this.homePhone); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetMerchantName) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_NAME, this.merchantName); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetMobilePhone) { + addIfNull(nulls, JSON_PROPERTY_MOBILE_PHONE, this.mobilePhone); + } + if (isSetNotificationURL) { + addIfNull(nulls, JSON_PROPERTY_NOTIFICATION_U_R_L, this.notificationURL); + } + if (isSetPayTokenInd) { + addIfNull(nulls, JSON_PROPERTY_PAY_TOKEN_IND, this.payTokenInd); + } + if (isSetPaymentAuthenticationUseCase) { + addIfNull( + nulls, JSON_PROPERTY_PAYMENT_AUTHENTICATION_USE_CASE, this.paymentAuthenticationUseCase); + } + if (isSetPurchaseInstalData) { + addIfNull(nulls, JSON_PROPERTY_PURCHASE_INSTAL_DATA, this.purchaseInstalData); + } + if (isSetRecurringExpiry) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_EXPIRY, this.recurringExpiry); + } + if (isSetRecurringFrequency) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_FREQUENCY, this.recurringFrequency); + } + if (isSetSdkAppID) { + addIfNull(nulls, JSON_PROPERTY_SDK_APP_I_D, this.sdkAppID); + } + if (isSetSdkEphemPubKey) { + addIfNull(nulls, JSON_PROPERTY_SDK_EPHEM_PUB_KEY, this.sdkEphemPubKey); + } + if (isSetSdkMaxTimeout) { + addIfNull(nulls, JSON_PROPERTY_SDK_MAX_TIMEOUT, this.sdkMaxTimeout); + } + if (isSetSdkReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_SDK_REFERENCE_NUMBER, this.sdkReferenceNumber); + } + if (isSetSdkTransID) { + addIfNull(nulls, JSON_PROPERTY_SDK_TRANS_I_D, this.sdkTransID); + } + if (isSetThreeDSCompInd) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_COMP_IND, this.threeDSCompInd); + } + if (isSetThreeDSRequestorAuthenticationInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_IND, + this.threeDSRequestorAuthenticationInd); + } + if (isSetThreeDSRequestorAuthenticationInfo) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_AUTHENTICATION_INFO, + this.threeDSRequestorAuthenticationInfo); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + if (isSetThreeDSRequestorID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_I_D, this.threeDSRequestorID); + } + if (isSetThreeDSRequestorName) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_NAME, this.threeDSRequestorName); + } + if (isSetThreeDSRequestorPriorAuthenticationInfo) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_PRIOR_AUTHENTICATION_INFO, + this.threeDSRequestorPriorAuthenticationInfo); + } + if (isSetThreeDSRequestorURL) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQUESTOR_U_R_L, this.threeDSRequestorURL); + } + if (isSetTransType) { + addIfNull(nulls, JSON_PROPERTY_TRANS_TYPE, this.transType); + } + if (isSetTransactionType) { + addIfNull(nulls, JSON_PROPERTY_TRANSACTION_TYPE, this.transactionType); + } + if (isSetWhiteListStatus) { + addIfNull(nulls, JSON_PROPERTY_WHITE_LIST_STATUS, this.whiteListStatus); + } + if (isSetWorkPhone) { + addIfNull(nulls, JSON_PROPERTY_WORK_PHONE, this.workPhone); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDS2RequestFields given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java b/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java index 0820a8dc0..93c4cffcf 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2ResponseData.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -43,60 +45,123 @@ public class ThreeDS2ResponseData { public static final String JSON_PROPERTY_ACS_CHALLENGE_MANDATED = "acsChallengeMandated"; private String acsChallengeMandated; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsChallengeMandated = false; + public static final String JSON_PROPERTY_ACS_OPERATOR_I_D = "acsOperatorID"; private String acsOperatorID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsOperatorID = false; + public static final String JSON_PROPERTY_ACS_REFERENCE_NUMBER = "acsReferenceNumber"; private String acsReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsReferenceNumber = false; + public static final String JSON_PROPERTY_ACS_SIGNED_CONTENT = "acsSignedContent"; private String acsSignedContent; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsSignedContent = false; + public static final String JSON_PROPERTY_ACS_TRANS_I_D = "acsTransID"; private String acsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsTransID = false; + public static final String JSON_PROPERTY_ACS_U_R_L = "acsURL"; private String acsURL; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAcsURL = false; + public static final String JSON_PROPERTY_AUTHENTICATION_TYPE = "authenticationType"; private String authenticationType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationType = false; + public static final String JSON_PROPERTY_CARD_HOLDER_INFO = "cardHolderInfo"; private String cardHolderInfo; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCardHolderInfo = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + public static final String JSON_PROPERTY_CHALLENGE_INDICATOR = "challengeIndicator"; private String challengeIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeIndicator = false; + public static final String JSON_PROPERTY_DS_REFERENCE_NUMBER = "dsReferenceNumber"; private String dsReferenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsReferenceNumber = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_EXEMPTION_INDICATOR = "exemptionIndicator"; private String exemptionIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemptionIndicator = false; + public static final String JSON_PROPERTY_MESSAGE_VERSION = "messageVersion"; private String messageVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageVersion = false; + public static final String JSON_PROPERTY_RISK_SCORE = "riskScore"; private String riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = false; + public static final String JSON_PROPERTY_SDK_EPHEM_PUB_KEY = "sdkEphemPubKey"; private String sdkEphemPubKey; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkEphemPubKey = false; + public static final String JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D = "threeDSServerTransID"; private String threeDSServerTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSServerTransID = false; + public static final String JSON_PROPERTY_TRANS_STATUS = "transStatus"; private String transStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatus = false; + public static final String JSON_PROPERTY_TRANS_STATUS_REASON = "transStatusReason"; private String transStatusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatusReason = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2ResponseData() {} /** @@ -107,6 +172,7 @@ public ThreeDS2ResponseData() {} */ public ThreeDS2ResponseData acsChallengeMandated(String acsChallengeMandated) { this.acsChallengeMandated = acsChallengeMandated; + isSetAcsChallengeMandated = true; // mark as set return this; } @@ -130,6 +196,7 @@ public String getAcsChallengeMandated() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsChallengeMandated(String acsChallengeMandated) { this.acsChallengeMandated = acsChallengeMandated; + isSetAcsChallengeMandated = true; // mark as set } /** @@ -140,6 +207,7 @@ public void setAcsChallengeMandated(String acsChallengeMandated) { */ public ThreeDS2ResponseData acsOperatorID(String acsOperatorID) { this.acsOperatorID = acsOperatorID; + isSetAcsOperatorID = true; // mark as set return this; } @@ -163,6 +231,7 @@ public String getAcsOperatorID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsOperatorID(String acsOperatorID) { this.acsOperatorID = acsOperatorID; + isSetAcsOperatorID = true; // mark as set } /** @@ -173,6 +242,7 @@ public void setAcsOperatorID(String acsOperatorID) { */ public ThreeDS2ResponseData acsReferenceNumber(String acsReferenceNumber) { this.acsReferenceNumber = acsReferenceNumber; + isSetAcsReferenceNumber = true; // mark as set return this; } @@ -196,6 +266,7 @@ public String getAcsReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsReferenceNumber(String acsReferenceNumber) { this.acsReferenceNumber = acsReferenceNumber; + isSetAcsReferenceNumber = true; // mark as set } /** @@ -206,6 +277,7 @@ public void setAcsReferenceNumber(String acsReferenceNumber) { */ public ThreeDS2ResponseData acsSignedContent(String acsSignedContent) { this.acsSignedContent = acsSignedContent; + isSetAcsSignedContent = true; // mark as set return this; } @@ -229,6 +301,7 @@ public String getAcsSignedContent() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsSignedContent(String acsSignedContent) { this.acsSignedContent = acsSignedContent; + isSetAcsSignedContent = true; // mark as set } /** @@ -239,6 +312,7 @@ public void setAcsSignedContent(String acsSignedContent) { */ public ThreeDS2ResponseData acsTransID(String acsTransID) { this.acsTransID = acsTransID; + isSetAcsTransID = true; // mark as set return this; } @@ -262,6 +336,7 @@ public String getAcsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsTransID(String acsTransID) { this.acsTransID = acsTransID; + isSetAcsTransID = true; // mark as set } /** @@ -272,6 +347,7 @@ public void setAcsTransID(String acsTransID) { */ public ThreeDS2ResponseData acsURL(String acsURL) { this.acsURL = acsURL; + isSetAcsURL = true; // mark as set return this; } @@ -295,6 +371,7 @@ public String getAcsURL() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAcsURL(String acsURL) { this.acsURL = acsURL; + isSetAcsURL = true; // mark as set } /** @@ -305,6 +382,7 @@ public void setAcsURL(String acsURL) { */ public ThreeDS2ResponseData authenticationType(String authenticationType) { this.authenticationType = authenticationType; + isSetAuthenticationType = true; // mark as set return this; } @@ -328,6 +406,7 @@ public String getAuthenticationType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationType(String authenticationType) { this.authenticationType = authenticationType; + isSetAuthenticationType = true; // mark as set } /** @@ -338,6 +417,7 @@ public void setAuthenticationType(String authenticationType) { */ public ThreeDS2ResponseData cardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set return this; } @@ -361,6 +441,7 @@ public String getCardHolderInfo() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCardHolderInfo(String cardHolderInfo) { this.cardHolderInfo = cardHolderInfo; + isSetCardHolderInfo = true; // mark as set } /** @@ -371,6 +452,7 @@ public void setCardHolderInfo(String cardHolderInfo) { */ public ThreeDS2ResponseData cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -394,6 +476,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -404,6 +487,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDS2ResponseData challengeIndicator(String challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set return this; } @@ -427,6 +511,7 @@ public String getChallengeIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeIndicator(String challengeIndicator) { this.challengeIndicator = challengeIndicator; + isSetChallengeIndicator = true; // mark as set } /** @@ -437,6 +522,7 @@ public void setChallengeIndicator(String challengeIndicator) { */ public ThreeDS2ResponseData dsReferenceNumber(String dsReferenceNumber) { this.dsReferenceNumber = dsReferenceNumber; + isSetDsReferenceNumber = true; // mark as set return this; } @@ -460,6 +546,7 @@ public String getDsReferenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsReferenceNumber(String dsReferenceNumber) { this.dsReferenceNumber = dsReferenceNumber; + isSetDsReferenceNumber = true; // mark as set } /** @@ -470,6 +557,7 @@ public void setDsReferenceNumber(String dsReferenceNumber) { */ public ThreeDS2ResponseData dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -493,6 +581,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -503,6 +592,7 @@ public void setDsTransID(String dsTransID) { */ public ThreeDS2ResponseData exemptionIndicator(String exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set return this; } @@ -526,6 +616,7 @@ public String getExemptionIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemptionIndicator(String exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set } /** @@ -536,6 +627,7 @@ public void setExemptionIndicator(String exemptionIndicator) { */ public ThreeDS2ResponseData messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -559,6 +651,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -569,6 +662,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2ResponseData riskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -592,6 +686,7 @@ public String getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -602,6 +697,7 @@ public void setRiskScore(String riskScore) { */ public ThreeDS2ResponseData sdkEphemPubKey(String sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set return this; } @@ -625,6 +721,7 @@ public String getSdkEphemPubKey() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkEphemPubKey(String sdkEphemPubKey) { this.sdkEphemPubKey = sdkEphemPubKey; + isSetSdkEphemPubKey = true; // mark as set } /** @@ -635,6 +732,7 @@ public void setSdkEphemPubKey(String sdkEphemPubKey) { */ public ThreeDS2ResponseData threeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set return this; } @@ -658,6 +756,7 @@ public String getThreeDSServerTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set } /** @@ -668,6 +767,7 @@ public void setThreeDSServerTransID(String threeDSServerTransID) { */ public ThreeDS2ResponseData transStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set return this; } @@ -691,6 +791,7 @@ public String getTransStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set } /** @@ -701,6 +802,7 @@ public void setTransStatus(String transStatus) { */ public ThreeDS2ResponseData transStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -724,6 +826,27 @@ public String getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2ResponseData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDS2ResponseData object is equal to o. */ @@ -737,48 +860,92 @@ public boolean equals(Object o) { } ThreeDS2ResponseData threeDS2ResponseData = (ThreeDS2ResponseData) o; return Objects.equals(this.acsChallengeMandated, threeDS2ResponseData.acsChallengeMandated) + && Objects.equals( + this.isSetAcsChallengeMandated, threeDS2ResponseData.isSetAcsChallengeMandated) && Objects.equals(this.acsOperatorID, threeDS2ResponseData.acsOperatorID) + && Objects.equals(this.isSetAcsOperatorID, threeDS2ResponseData.isSetAcsOperatorID) && Objects.equals(this.acsReferenceNumber, threeDS2ResponseData.acsReferenceNumber) + && Objects.equals( + this.isSetAcsReferenceNumber, threeDS2ResponseData.isSetAcsReferenceNumber) && Objects.equals(this.acsSignedContent, threeDS2ResponseData.acsSignedContent) + && Objects.equals(this.isSetAcsSignedContent, threeDS2ResponseData.isSetAcsSignedContent) && Objects.equals(this.acsTransID, threeDS2ResponseData.acsTransID) + && Objects.equals(this.isSetAcsTransID, threeDS2ResponseData.isSetAcsTransID) && Objects.equals(this.acsURL, threeDS2ResponseData.acsURL) + && Objects.equals(this.isSetAcsURL, threeDS2ResponseData.isSetAcsURL) && Objects.equals(this.authenticationType, threeDS2ResponseData.authenticationType) + && Objects.equals( + this.isSetAuthenticationType, threeDS2ResponseData.isSetAuthenticationType) && Objects.equals(this.cardHolderInfo, threeDS2ResponseData.cardHolderInfo) + && Objects.equals(this.isSetCardHolderInfo, threeDS2ResponseData.isSetCardHolderInfo) && Objects.equals(this.cavvAlgorithm, threeDS2ResponseData.cavvAlgorithm) + && Objects.equals(this.isSetCavvAlgorithm, threeDS2ResponseData.isSetCavvAlgorithm) && Objects.equals(this.challengeIndicator, threeDS2ResponseData.challengeIndicator) + && Objects.equals( + this.isSetChallengeIndicator, threeDS2ResponseData.isSetChallengeIndicator) && Objects.equals(this.dsReferenceNumber, threeDS2ResponseData.dsReferenceNumber) + && Objects.equals(this.isSetDsReferenceNumber, threeDS2ResponseData.isSetDsReferenceNumber) && Objects.equals(this.dsTransID, threeDS2ResponseData.dsTransID) + && Objects.equals(this.isSetDsTransID, threeDS2ResponseData.isSetDsTransID) && Objects.equals(this.exemptionIndicator, threeDS2ResponseData.exemptionIndicator) + && Objects.equals( + this.isSetExemptionIndicator, threeDS2ResponseData.isSetExemptionIndicator) && Objects.equals(this.messageVersion, threeDS2ResponseData.messageVersion) + && Objects.equals(this.isSetMessageVersion, threeDS2ResponseData.isSetMessageVersion) && Objects.equals(this.riskScore, threeDS2ResponseData.riskScore) + && Objects.equals(this.isSetRiskScore, threeDS2ResponseData.isSetRiskScore) && Objects.equals(this.sdkEphemPubKey, threeDS2ResponseData.sdkEphemPubKey) + && Objects.equals(this.isSetSdkEphemPubKey, threeDS2ResponseData.isSetSdkEphemPubKey) && Objects.equals(this.threeDSServerTransID, threeDS2ResponseData.threeDSServerTransID) + && Objects.equals( + this.isSetThreeDSServerTransID, threeDS2ResponseData.isSetThreeDSServerTransID) && Objects.equals(this.transStatus, threeDS2ResponseData.transStatus) - && Objects.equals(this.transStatusReason, threeDS2ResponseData.transStatusReason); + && Objects.equals(this.isSetTransStatus, threeDS2ResponseData.isSetTransStatus) + && Objects.equals(this.transStatusReason, threeDS2ResponseData.transStatusReason) + && Objects.equals(this.isSetTransStatusReason, threeDS2ResponseData.isSetTransStatusReason); } @Override public int hashCode() { return Objects.hash( acsChallengeMandated, + isSetAcsChallengeMandated, acsOperatorID, + isSetAcsOperatorID, acsReferenceNumber, + isSetAcsReferenceNumber, acsSignedContent, + isSetAcsSignedContent, acsTransID, + isSetAcsTransID, acsURL, + isSetAcsURL, authenticationType, + isSetAuthenticationType, cardHolderInfo, + isSetCardHolderInfo, cavvAlgorithm, + isSetCavvAlgorithm, challengeIndicator, + isSetChallengeIndicator, dsReferenceNumber, + isSetDsReferenceNumber, dsTransID, + isSetDsTransID, exemptionIndicator, + isSetExemptionIndicator, messageVersion, + isSetMessageVersion, riskScore, + isSetRiskScore, sdkEphemPubKey, + isSetSdkEphemPubKey, threeDSServerTransID, + isSetThreeDSServerTransID, transStatus, - transStatusReason); + isSetTransStatus, + transStatusReason, + isSetTransStatusReason); } @Override @@ -822,6 +989,84 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAcsChallengeMandated) { + addIfNull(nulls, JSON_PROPERTY_ACS_CHALLENGE_MANDATED, this.acsChallengeMandated); + } + if (isSetAcsOperatorID) { + addIfNull(nulls, JSON_PROPERTY_ACS_OPERATOR_I_D, this.acsOperatorID); + } + if (isSetAcsReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_ACS_REFERENCE_NUMBER, this.acsReferenceNumber); + } + if (isSetAcsSignedContent) { + addIfNull(nulls, JSON_PROPERTY_ACS_SIGNED_CONTENT, this.acsSignedContent); + } + if (isSetAcsTransID) { + addIfNull(nulls, JSON_PROPERTY_ACS_TRANS_I_D, this.acsTransID); + } + if (isSetAcsURL) { + addIfNull(nulls, JSON_PROPERTY_ACS_U_R_L, this.acsURL); + } + if (isSetAuthenticationType) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_TYPE, this.authenticationType); + } + if (isSetCardHolderInfo) { + addIfNull(nulls, JSON_PROPERTY_CARD_HOLDER_INFO, this.cardHolderInfo); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetChallengeIndicator) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_INDICATOR, this.challengeIndicator); + } + if (isSetDsReferenceNumber) { + addIfNull(nulls, JSON_PROPERTY_DS_REFERENCE_NUMBER, this.dsReferenceNumber); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetExemptionIndicator) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION_INDICATOR, this.exemptionIndicator); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetSdkEphemPubKey) { + addIfNull(nulls, JSON_PROPERTY_SDK_EPHEM_PUB_KEY, this.sdkEphemPubKey); + } + if (isSetThreeDSServerTransID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D, this.threeDSServerTransID); + } + if (isSetTransStatus) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS, this.transStatus); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDS2ResponseData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java b/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java index ad1b3164b..5dfb5e19e 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDS2Result.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -42,9 +44,15 @@ public class ThreeDS2Result { public static final String JSON_PROPERTY_AUTHENTICATION_VALUE = "authenticationValue"; private String authenticationValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationValue = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + /** * Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the * authentication has been cancelled. For possible values, refer to [3D Secure API @@ -103,12 +111,21 @@ public static ChallengeCancelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_CANCEL = "challengeCancel"; private ChallengeCancelEnum challengeCancel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeCancel = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + /** * Indicates the exemption type that was applied by the issuer to the authentication, if exemption * applied. Allowed values: * `lowValue` * `secureCorporate` * @@ -161,12 +178,21 @@ public static ExemptionIndicatorEnum fromValue(String value) { public static final String JSON_PROPERTY_EXEMPTION_INDICATOR = "exemptionIndicator"; private ExemptionIndicatorEnum exemptionIndicator; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExemptionIndicator = false; + public static final String JSON_PROPERTY_MESSAGE_VERSION = "messageVersion"; private String messageVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessageVersion = false; + public static final String JSON_PROPERTY_RISK_SCORE = "riskScore"; private String riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = false; + /** * Indicates whether a challenge is requested for this transaction. Possible values: * **01** — No * preference * **02** — No challenge requested * **03** — Challenge requested (3DS Requestor @@ -226,21 +252,45 @@ public static ThreeDSRequestorChallengeIndEnum fromValue(String value) { "threeDSRequestorChallengeInd"; private ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSRequestorChallengeInd = false; + public static final String JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D = "threeDSServerTransID"; private String threeDSServerTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSServerTransID = false; + public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; private String timestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTimestamp = false; + public static final String JSON_PROPERTY_TRANS_STATUS = "transStatus"; private String transStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatus = false; + public static final String JSON_PROPERTY_TRANS_STATUS_REASON = "transStatusReason"; private String transStatusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatusReason = false; + public static final String JSON_PROPERTY_WHITE_LIST_STATUS = "whiteListStatus"; private String whiteListStatus; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetWhiteListStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDS2Result() {} /** @@ -252,6 +302,7 @@ public ThreeDS2Result() {} */ public ThreeDS2Result authenticationValue(String authenticationValue) { this.authenticationValue = authenticationValue; + isSetAuthenticationValue = true; // mark as set return this; } @@ -277,6 +328,7 @@ public String getAuthenticationValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationValue(String authenticationValue) { this.authenticationValue = authenticationValue; + isSetAuthenticationValue = true; // mark as set } /** @@ -289,6 +341,7 @@ public void setAuthenticationValue(String authenticationValue) { */ public ThreeDS2Result cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -316,6 +369,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -331,6 +385,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDS2Result challengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set return this; } @@ -364,6 +419,7 @@ public ChallengeCancelEnum getChallengeCancel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set } /** @@ -374,6 +430,7 @@ public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { */ public ThreeDS2Result dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -397,6 +454,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -407,6 +465,7 @@ public void setDsTransID(String dsTransID) { */ public ThreeDS2Result eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -430,6 +489,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -445,6 +505,7 @@ public void setEci(String eci) { */ public ThreeDS2Result exemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set return this; } @@ -478,6 +539,7 @@ public ExemptionIndicatorEnum getExemptionIndicator() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { this.exemptionIndicator = exemptionIndicator; + isSetExemptionIndicator = true; // mark as set } /** @@ -489,6 +551,7 @@ public void setExemptionIndicator(ExemptionIndicatorEnum exemptionIndicator) { */ public ThreeDS2Result messageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set return this; } @@ -514,6 +577,7 @@ public String getMessageVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMessageVersion(String messageVersion) { this.messageVersion = messageVersion; + isSetMessageVersion = true; // mark as set } /** @@ -524,6 +588,7 @@ public void setMessageVersion(String messageVersion) { */ public ThreeDS2Result riskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -547,6 +612,7 @@ public String getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -565,6 +631,7 @@ public void setRiskScore(String riskScore) { public ThreeDS2Result threeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set return this; } @@ -603,6 +670,7 @@ public ThreeDSRequestorChallengeIndEnum getThreeDSRequestorChallengeInd() { public void setThreeDSRequestorChallengeInd( ThreeDSRequestorChallengeIndEnum threeDSRequestorChallengeInd) { this.threeDSRequestorChallengeInd = threeDSRequestorChallengeInd; + isSetThreeDSRequestorChallengeInd = true; // mark as set } /** @@ -614,6 +682,7 @@ public void setThreeDSRequestorChallengeInd( */ public ThreeDS2Result threeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set return this; } @@ -639,6 +708,7 @@ public String getThreeDSServerTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSServerTransID(String threeDSServerTransID) { this.threeDSServerTransID = threeDSServerTransID; + isSetThreeDSServerTransID = true; // mark as set } /** @@ -649,6 +719,7 @@ public void setThreeDSServerTransID(String threeDSServerTransID) { */ public ThreeDS2Result timestamp(String timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set return this; } @@ -672,6 +743,7 @@ public String getTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimestamp(String timestamp) { this.timestamp = timestamp; + isSetTimestamp = true; // mark as set } /** @@ -683,6 +755,7 @@ public void setTimestamp(String timestamp) { */ public ThreeDS2Result transStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set return this; } @@ -708,6 +781,7 @@ public String getTransStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatus(String transStatus) { this.transStatus = transStatus; + isSetTransStatus = true; // mark as set } /** @@ -722,6 +796,7 @@ public void setTransStatus(String transStatus) { */ public ThreeDS2Result transStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -753,6 +828,7 @@ public String getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set } /** @@ -764,6 +840,7 @@ public void setTransStatusReason(String transStatusReason) { */ public ThreeDS2Result whiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set return this; } @@ -789,6 +866,27 @@ public String getWhiteListStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWhiteListStatus(String whiteListStatus) { this.whiteListStatus = whiteListStatus; + isSetWhiteListStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDS2Result includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDS2Result object is equal to o. */ @@ -802,39 +900,69 @@ public boolean equals(Object o) { } ThreeDS2Result threeDS2Result = (ThreeDS2Result) o; return Objects.equals(this.authenticationValue, threeDS2Result.authenticationValue) + && Objects.equals(this.isSetAuthenticationValue, threeDS2Result.isSetAuthenticationValue) && Objects.equals(this.cavvAlgorithm, threeDS2Result.cavvAlgorithm) + && Objects.equals(this.isSetCavvAlgorithm, threeDS2Result.isSetCavvAlgorithm) && Objects.equals(this.challengeCancel, threeDS2Result.challengeCancel) + && Objects.equals(this.isSetChallengeCancel, threeDS2Result.isSetChallengeCancel) && Objects.equals(this.dsTransID, threeDS2Result.dsTransID) + && Objects.equals(this.isSetDsTransID, threeDS2Result.isSetDsTransID) && Objects.equals(this.eci, threeDS2Result.eci) + && Objects.equals(this.isSetEci, threeDS2Result.isSetEci) && Objects.equals(this.exemptionIndicator, threeDS2Result.exemptionIndicator) + && Objects.equals(this.isSetExemptionIndicator, threeDS2Result.isSetExemptionIndicator) && Objects.equals(this.messageVersion, threeDS2Result.messageVersion) + && Objects.equals(this.isSetMessageVersion, threeDS2Result.isSetMessageVersion) && Objects.equals(this.riskScore, threeDS2Result.riskScore) + && Objects.equals(this.isSetRiskScore, threeDS2Result.isSetRiskScore) && Objects.equals( this.threeDSRequestorChallengeInd, threeDS2Result.threeDSRequestorChallengeInd) + && Objects.equals( + this.isSetThreeDSRequestorChallengeInd, + threeDS2Result.isSetThreeDSRequestorChallengeInd) && Objects.equals(this.threeDSServerTransID, threeDS2Result.threeDSServerTransID) + && Objects.equals(this.isSetThreeDSServerTransID, threeDS2Result.isSetThreeDSServerTransID) && Objects.equals(this.timestamp, threeDS2Result.timestamp) + && Objects.equals(this.isSetTimestamp, threeDS2Result.isSetTimestamp) && Objects.equals(this.transStatus, threeDS2Result.transStatus) + && Objects.equals(this.isSetTransStatus, threeDS2Result.isSetTransStatus) && Objects.equals(this.transStatusReason, threeDS2Result.transStatusReason) - && Objects.equals(this.whiteListStatus, threeDS2Result.whiteListStatus); + && Objects.equals(this.isSetTransStatusReason, threeDS2Result.isSetTransStatusReason) + && Objects.equals(this.whiteListStatus, threeDS2Result.whiteListStatus) + && Objects.equals(this.isSetWhiteListStatus, threeDS2Result.isSetWhiteListStatus); } @Override public int hashCode() { return Objects.hash( authenticationValue, + isSetAuthenticationValue, cavvAlgorithm, + isSetCavvAlgorithm, challengeCancel, + isSetChallengeCancel, dsTransID, + isSetDsTransID, eci, + isSetEci, exemptionIndicator, + isSetExemptionIndicator, messageVersion, + isSetMessageVersion, riskScore, + isSetRiskScore, threeDSRequestorChallengeInd, + isSetThreeDSRequestorChallengeInd, threeDSServerTransID, + isSetThreeDSServerTransID, timestamp, + isSetTimestamp, transStatus, + isSetTransStatus, transStatusReason, - whiteListStatus); + isSetTransStatusReason, + whiteListStatus, + isSetWhiteListStatus); } @Override @@ -875,6 +1003,72 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthenticationValue) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_VALUE, this.authenticationValue); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetChallengeCancel) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_CANCEL, this.challengeCancel); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetExemptionIndicator) { + addIfNull(nulls, JSON_PROPERTY_EXEMPTION_INDICATOR, this.exemptionIndicator); + } + if (isSetMessageVersion) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE_VERSION, this.messageVersion); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetThreeDSRequestorChallengeInd) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQUESTOR_CHALLENGE_IND, + this.threeDSRequestorChallengeInd); + } + if (isSetThreeDSServerTransID) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_SERVER_TRANS_I_D, this.threeDSServerTransID); + } + if (isSetTimestamp) { + addIfNull(nulls, JSON_PROPERTY_TIMESTAMP, this.timestamp); + } + if (isSetTransStatus) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS, this.transStatus); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + if (isSetWhiteListStatus) { + addIfNull(nulls, JSON_PROPERTY_WHITE_LIST_STATUS, this.whiteListStatus); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDS2Result given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java index a6be4a5a3..9bf091181 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -83,6 +85,9 @@ public static ChallengeWindowSizeEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_WINDOW_SIZE = "challengeWindowSize"; private ChallengeWindowSizeEnum challengeWindowSize; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeWindowSize = false; + /** * Required to trigger the [data-only * flow](https://docs.adyen.com/online-payments/3d-secure/data-only/). When set to **true**, @@ -131,6 +136,9 @@ public static DataOnlyEnum fromValue(String value) { public static final String JSON_PROPERTY_DATA_ONLY = "dataOnly"; private DataOnlyEnum dataOnly; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDataOnly = false; + /** * Indicates if [native 3D Secure * authentication](https://docs.adyen.com/online-payments/3d-secure/native-3ds2) should be @@ -182,6 +190,9 @@ public static NativeThreeDSEnum fromValue(String value) { public static final String JSON_PROPERTY_NATIVE_THREE_D_S = "nativeThreeDS"; private NativeThreeDSEnum nativeThreeDS; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNativeThreeDS = false; + /** The version of 3D Secure to use. Possible values: * **2.1.0** * **2.2.0** */ public enum ThreeDSVersionEnum { _2_1_0(String.valueOf("2.1.0")), @@ -226,6 +237,15 @@ public static ThreeDSVersionEnum fromValue(String value) { public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private ThreeDSVersionEnum threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSRequestData() {} /** @@ -240,6 +260,7 @@ public ThreeDSRequestData() {} */ public ThreeDSRequestData challengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set return this; } @@ -271,6 +292,7 @@ public ChallengeWindowSizeEnum getChallengeWindowSize() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) { this.challengeWindowSize = challengeWindowSize; + isSetChallengeWindowSize = true; // mark as set } /** @@ -285,6 +307,7 @@ public void setChallengeWindowSize(ChallengeWindowSizeEnum challengeWindowSize) */ public ThreeDSRequestData dataOnly(DataOnlyEnum dataOnly) { this.dataOnly = dataOnly; + isSetDataOnly = true; // mark as set return this; } @@ -316,6 +339,7 @@ public DataOnlyEnum getDataOnly() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDataOnly(DataOnlyEnum dataOnly) { this.dataOnly = dataOnly; + isSetDataOnly = true; // mark as set } /** @@ -336,6 +360,7 @@ public void setDataOnly(DataOnlyEnum dataOnly) { */ public ThreeDSRequestData nativeThreeDS(NativeThreeDSEnum nativeThreeDS) { this.nativeThreeDS = nativeThreeDS; + isSetNativeThreeDS = true; // mark as set return this; } @@ -379,6 +404,7 @@ public NativeThreeDSEnum getNativeThreeDS() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNativeThreeDS(NativeThreeDSEnum nativeThreeDS) { this.nativeThreeDS = nativeThreeDS; + isSetNativeThreeDS = true; // mark as set } /** @@ -389,6 +415,7 @@ public void setNativeThreeDS(NativeThreeDSEnum nativeThreeDS) { */ public ThreeDSRequestData threeDSVersion(ThreeDSVersionEnum threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -413,6 +440,27 @@ public ThreeDSVersionEnum getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(ThreeDSVersionEnum threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSRequestData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSRequestData object is equal to o. */ @@ -426,14 +474,27 @@ public boolean equals(Object o) { } ThreeDSRequestData threeDSRequestData = (ThreeDSRequestData) o; return Objects.equals(this.challengeWindowSize, threeDSRequestData.challengeWindowSize) + && Objects.equals( + this.isSetChallengeWindowSize, threeDSRequestData.isSetChallengeWindowSize) && Objects.equals(this.dataOnly, threeDSRequestData.dataOnly) + && Objects.equals(this.isSetDataOnly, threeDSRequestData.isSetDataOnly) && Objects.equals(this.nativeThreeDS, threeDSRequestData.nativeThreeDS) - && Objects.equals(this.threeDSVersion, threeDSRequestData.threeDSVersion); + && Objects.equals(this.isSetNativeThreeDS, threeDSRequestData.isSetNativeThreeDS) + && Objects.equals(this.threeDSVersion, threeDSRequestData.threeDSVersion) + && Objects.equals(this.isSetThreeDSVersion, threeDSRequestData.isSetThreeDSVersion); } @Override public int hashCode() { - return Objects.hash(challengeWindowSize, dataOnly, nativeThreeDS, threeDSVersion); + return Objects.hash( + challengeWindowSize, + isSetChallengeWindowSize, + dataOnly, + isSetDataOnly, + nativeThreeDS, + isSetNativeThreeDS, + threeDSVersion, + isSetThreeDSVersion); } @Override @@ -460,6 +521,39 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetChallengeWindowSize) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_WINDOW_SIZE, this.challengeWindowSize); + } + if (isSetDataOnly) { + addIfNull(nulls, JSON_PROPERTY_DATA_ONLY, this.dataOnly); + } + if (isSetNativeThreeDS) { + addIfNull(nulls, JSON_PROPERTY_NATIVE_THREE_D_S, this.nativeThreeDS); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSRequestData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java index 308310740..e78d9c4a4 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorAuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,6 +33,9 @@ public class ThreeDSRequestorAuthenticationInfo { public static final String JSON_PROPERTY_THREE_D_S_REQ_AUTH_DATA = "threeDSReqAuthData"; private String threeDSReqAuthData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqAuthData = false; + /** * Mechanism used by the Cardholder to authenticate to the 3DS Requestor. Allowed values: * **01** * — No 3DS Requestor authentication occurred (for example, cardholder “logged in” as guest). * @@ -92,9 +97,21 @@ public static ThreeDSReqAuthMethodEnum fromValue(String value) { public static final String JSON_PROPERTY_THREE_D_S_REQ_AUTH_METHOD = "threeDSReqAuthMethod"; private ThreeDSReqAuthMethodEnum threeDSReqAuthMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqAuthMethod = false; + public static final String JSON_PROPERTY_THREE_D_S_REQ_AUTH_TIMESTAMP = "threeDSReqAuthTimestamp"; private String threeDSReqAuthTimestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqAuthTimestamp = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSRequestorAuthenticationInfo() {} /** @@ -107,6 +124,7 @@ public ThreeDSRequestorAuthenticationInfo() {} */ public ThreeDSRequestorAuthenticationInfo threeDSReqAuthData(String threeDSReqAuthData) { this.threeDSReqAuthData = threeDSReqAuthData; + isSetThreeDSReqAuthData = true; // mark as set return this; } @@ -132,6 +150,7 @@ public String getThreeDSReqAuthData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqAuthData(String threeDSReqAuthData) { this.threeDSReqAuthData = threeDSReqAuthData; + isSetThreeDSReqAuthData = true; // mark as set } /** @@ -159,6 +178,7 @@ public void setThreeDSReqAuthData(String threeDSReqAuthData) { public ThreeDSRequestorAuthenticationInfo threeDSReqAuthMethod( ThreeDSReqAuthMethodEnum threeDSReqAuthMethod) { this.threeDSReqAuthMethod = threeDSReqAuthMethod; + isSetThreeDSReqAuthMethod = true; // mark as set return this; } @@ -212,6 +232,7 @@ public ThreeDSReqAuthMethodEnum getThreeDSReqAuthMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqAuthMethod(ThreeDSReqAuthMethodEnum threeDSReqAuthMethod) { this.threeDSReqAuthMethod = threeDSReqAuthMethod; + isSetThreeDSReqAuthMethod = true; // mark as set } /** @@ -225,6 +246,7 @@ public void setThreeDSReqAuthMethod(ThreeDSReqAuthMethodEnum threeDSReqAuthMetho public ThreeDSRequestorAuthenticationInfo threeDSReqAuthTimestamp( String threeDSReqAuthTimestamp) { this.threeDSReqAuthTimestamp = threeDSReqAuthTimestamp; + isSetThreeDSReqAuthTimestamp = true; // mark as set return this; } @@ -250,6 +272,27 @@ public String getThreeDSReqAuthTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqAuthTimestamp(String threeDSReqAuthTimestamp) { this.threeDSReqAuthTimestamp = threeDSReqAuthTimestamp; + isSetThreeDSReqAuthTimestamp = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSRequestorAuthenticationInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSRequestorAuthenticationInfo object is equal to o. */ @@ -265,16 +308,31 @@ public boolean equals(Object o) { (ThreeDSRequestorAuthenticationInfo) o; return Objects.equals( this.threeDSReqAuthData, threeDSRequestorAuthenticationInfo.threeDSReqAuthData) + && Objects.equals( + this.isSetThreeDSReqAuthData, + threeDSRequestorAuthenticationInfo.isSetThreeDSReqAuthData) && Objects.equals( this.threeDSReqAuthMethod, threeDSRequestorAuthenticationInfo.threeDSReqAuthMethod) + && Objects.equals( + this.isSetThreeDSReqAuthMethod, + threeDSRequestorAuthenticationInfo.isSetThreeDSReqAuthMethod) && Objects.equals( this.threeDSReqAuthTimestamp, - threeDSRequestorAuthenticationInfo.threeDSReqAuthTimestamp); + threeDSRequestorAuthenticationInfo.threeDSReqAuthTimestamp) + && Objects.equals( + this.isSetThreeDSReqAuthTimestamp, + threeDSRequestorAuthenticationInfo.isSetThreeDSReqAuthTimestamp); } @Override public int hashCode() { - return Objects.hash(threeDSReqAuthData, threeDSReqAuthMethod, threeDSReqAuthTimestamp); + return Objects.hash( + threeDSReqAuthData, + isSetThreeDSReqAuthData, + threeDSReqAuthMethod, + isSetThreeDSReqAuthMethod, + threeDSReqAuthTimestamp, + isSetThreeDSReqAuthTimestamp); } @Override @@ -302,6 +360,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetThreeDSReqAuthData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_AUTH_DATA, this.threeDSReqAuthData); + } + if (isSetThreeDSReqAuthMethod) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_AUTH_METHOD, this.threeDSReqAuthMethod); + } + if (isSetThreeDSReqAuthTimestamp) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_AUTH_TIMESTAMP, this.threeDSReqAuthTimestamp); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSRequestorAuthenticationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java index 024ad833a..47a9a54d9 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSRequestorPriorAuthenticationInfo.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class ThreeDSRequestorPriorAuthenticationInfo { "threeDSReqPriorAuthData"; private String threeDSReqPriorAuthData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorAuthData = false; + /** * Mechanism used by the Cardholder to previously authenticate to the 3DS Requestor. Allowed * values: * **01** — Frictionless authentication occurred by ACS. * **02** — Cardholder challenge @@ -87,13 +92,28 @@ public static ThreeDSReqPriorAuthMethodEnum fromValue(String value) { "threeDSReqPriorAuthMethod"; private ThreeDSReqPriorAuthMethodEnum threeDSReqPriorAuthMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorAuthMethod = false; + public static final String JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_TIMESTAMP = "threeDSReqPriorAuthTimestamp"; private String threeDSReqPriorAuthTimestamp; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorAuthTimestamp = false; + public static final String JSON_PROPERTY_THREE_D_S_REQ_PRIOR_REF = "threeDSReqPriorRef"; private String threeDSReqPriorRef; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSReqPriorRef = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSRequestorPriorAuthenticationInfo() {} /** @@ -107,6 +127,7 @@ public ThreeDSRequestorPriorAuthenticationInfo() {} public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorAuthData( String threeDSReqPriorAuthData) { this.threeDSReqPriorAuthData = threeDSReqPriorAuthData; + isSetThreeDSReqPriorAuthData = true; // mark as set return this; } @@ -132,6 +153,7 @@ public String getThreeDSReqPriorAuthData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqPriorAuthData(String threeDSReqPriorAuthData) { this.threeDSReqPriorAuthData = threeDSReqPriorAuthData; + isSetThreeDSReqPriorAuthData = true; // mark as set } /** @@ -149,6 +171,7 @@ public void setThreeDSReqPriorAuthData(String threeDSReqPriorAuthData) { public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorAuthMethod( ThreeDSReqPriorAuthMethodEnum threeDSReqPriorAuthMethod) { this.threeDSReqPriorAuthMethod = threeDSReqPriorAuthMethod; + isSetThreeDSReqPriorAuthMethod = true; // mark as set return this; } @@ -183,6 +206,7 @@ public ThreeDSReqPriorAuthMethodEnum getThreeDSReqPriorAuthMethod() { public void setThreeDSReqPriorAuthMethod( ThreeDSReqPriorAuthMethodEnum threeDSReqPriorAuthMethod) { this.threeDSReqPriorAuthMethod = threeDSReqPriorAuthMethod; + isSetThreeDSReqPriorAuthMethod = true; // mark as set } /** @@ -196,6 +220,7 @@ public void setThreeDSReqPriorAuthMethod( public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorAuthTimestamp( String threeDSReqPriorAuthTimestamp) { this.threeDSReqPriorAuthTimestamp = threeDSReqPriorAuthTimestamp; + isSetThreeDSReqPriorAuthTimestamp = true; // mark as set return this; } @@ -221,6 +246,7 @@ public String getThreeDSReqPriorAuthTimestamp() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqPriorAuthTimestamp(String threeDSReqPriorAuthTimestamp) { this.threeDSReqPriorAuthTimestamp = threeDSReqPriorAuthTimestamp; + isSetThreeDSReqPriorAuthTimestamp = true; // mark as set } /** @@ -238,6 +264,7 @@ public void setThreeDSReqPriorAuthTimestamp(String threeDSReqPriorAuthTimestamp) */ public ThreeDSRequestorPriorAuthenticationInfo threeDSReqPriorRef(String threeDSReqPriorRef) { this.threeDSReqPriorRef = threeDSReqPriorRef; + isSetThreeDSReqPriorRef = true; // mark as set return this; } @@ -273,6 +300,27 @@ public String getThreeDSReqPriorRef() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSReqPriorRef(String threeDSReqPriorRef) { this.threeDSReqPriorRef = threeDSReqPriorRef; + isSetThreeDSReqPriorRef = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSRequestorPriorAuthenticationInfo includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSRequestorPriorAuthenticationInfo object is equal to o. */ @@ -289,23 +337,39 @@ public boolean equals(Object o) { return Objects.equals( this.threeDSReqPriorAuthData, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorAuthData) + && Objects.equals( + this.isSetThreeDSReqPriorAuthData, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorAuthData) && Objects.equals( this.threeDSReqPriorAuthMethod, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorAuthMethod) + && Objects.equals( + this.isSetThreeDSReqPriorAuthMethod, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorAuthMethod) && Objects.equals( this.threeDSReqPriorAuthTimestamp, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorAuthTimestamp) && Objects.equals( - this.threeDSReqPriorRef, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorRef); + this.isSetThreeDSReqPriorAuthTimestamp, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorAuthTimestamp) + && Objects.equals( + this.threeDSReqPriorRef, threeDSRequestorPriorAuthenticationInfo.threeDSReqPriorRef) + && Objects.equals( + this.isSetThreeDSReqPriorRef, + threeDSRequestorPriorAuthenticationInfo.isSetThreeDSReqPriorRef); } @Override public int hashCode() { return Objects.hash( threeDSReqPriorAuthData, + isSetThreeDSReqPriorAuthData, threeDSReqPriorAuthMethod, + isSetThreeDSReqPriorAuthMethod, threeDSReqPriorAuthTimestamp, - threeDSReqPriorRef); + isSetThreeDSReqPriorAuthTimestamp, + threeDSReqPriorRef, + isSetThreeDSReqPriorRef); } @Override @@ -336,6 +400,43 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetThreeDSReqPriorAuthData) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_DATA, this.threeDSReqPriorAuthData); + } + if (isSetThreeDSReqPriorAuthMethod) { + addIfNull( + nulls, JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_METHOD, this.threeDSReqPriorAuthMethod); + } + if (isSetThreeDSReqPriorAuthTimestamp) { + addIfNull( + nulls, + JSON_PROPERTY_THREE_D_S_REQ_PRIOR_AUTH_TIMESTAMP, + this.threeDSReqPriorAuthTimestamp); + } + if (isSetThreeDSReqPriorRef) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_REQ_PRIOR_REF, this.threeDSReqPriorRef); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSRequestorPriorAuthenticationInfo given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java b/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java index a3a49acb1..2d06d8743 100644 --- a/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java +++ b/src/main/java/com/adyen/model/checkout/ThreeDSecureData.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -88,12 +90,21 @@ public static AuthenticationResponseEnum fromValue(String value) { public static final String JSON_PROPERTY_AUTHENTICATION_RESPONSE = "authenticationResponse"; private AuthenticationResponseEnum authenticationResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAuthenticationResponse = false; + public static final String JSON_PROPERTY_CAVV = "cavv"; private byte[] cavv; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavv = false; + public static final String JSON_PROPERTY_CAVV_ALGORITHM = "cavvAlgorithm"; private String cavvAlgorithm; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCavvAlgorithm = false; + /** * Indicator informing the Access Control Server (ACS) and the Directory Server (DS) that the * authentication has been cancelled. For possible values, refer to [3D Secure API @@ -152,6 +163,9 @@ public static ChallengeCancelEnum fromValue(String value) { public static final String JSON_PROPERTY_CHALLENGE_CANCEL = "challengeCancel"; private ChallengeCancelEnum challengeCancel; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetChallengeCancel = false; + /** In 3D Secure 2, this is the `transStatus` from the `ARes`. */ public enum DirectoryResponseEnum { A(String.valueOf("A")), @@ -208,28 +222,58 @@ public static DirectoryResponseEnum fromValue(String value) { public static final String JSON_PROPERTY_DIRECTORY_RESPONSE = "directoryResponse"; private DirectoryResponseEnum directoryResponse; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDirectoryResponse = false; + public static final String JSON_PROPERTY_DS_TRANS_I_D = "dsTransID"; private String dsTransID; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDsTransID = false; + public static final String JSON_PROPERTY_ECI = "eci"; private String eci; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEci = false; + public static final String JSON_PROPERTY_RISK_SCORE = "riskScore"; private String riskScore; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRiskScore = false; + public static final String JSON_PROPERTY_THREE_D_S_VERSION = "threeDSVersion"; private String threeDSVersion; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetThreeDSVersion = false; + public static final String JSON_PROPERTY_TOKEN_AUTHENTICATION_VERIFICATION_VALUE = "tokenAuthenticationVerificationValue"; private byte[] tokenAuthenticationVerificationValue; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTokenAuthenticationVerificationValue = false; + public static final String JSON_PROPERTY_TRANS_STATUS_REASON = "transStatusReason"; private String transStatusReason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTransStatusReason = false; + public static final String JSON_PROPERTY_XID = "xid"; private byte[] xid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetXid = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ThreeDSecureData() {} /** @@ -243,6 +287,7 @@ public ThreeDSecureData() {} public ThreeDSecureData authenticationResponse( AuthenticationResponseEnum authenticationResponse) { this.authenticationResponse = authenticationResponse; + isSetAuthenticationResponse = true; // mark as set return this; } @@ -270,6 +315,7 @@ public AuthenticationResponseEnum getAuthenticationResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuthenticationResponse(AuthenticationResponseEnum authenticationResponse) { this.authenticationResponse = authenticationResponse; + isSetAuthenticationResponse = true; // mark as set } /** @@ -280,6 +326,7 @@ public void setAuthenticationResponse(AuthenticationResponseEnum authenticationR */ public ThreeDSecureData cavv(byte[] cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set return this; } @@ -303,6 +350,7 @@ public byte[] getCavv() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavv(byte[] cavv) { this.cavv = cavv; + isSetCavv = true; // mark as set } /** @@ -313,6 +361,7 @@ public void setCavv(byte[] cavv) { */ public ThreeDSecureData cavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set return this; } @@ -336,6 +385,7 @@ public String getCavvAlgorithm() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCavvAlgorithm(String cavvAlgorithm) { this.cavvAlgorithm = cavvAlgorithm; + isSetCavvAlgorithm = true; // mark as set } /** @@ -351,6 +401,7 @@ public void setCavvAlgorithm(String cavvAlgorithm) { */ public ThreeDSecureData challengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set return this; } @@ -384,6 +435,7 @@ public ChallengeCancelEnum getChallengeCancel() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { this.challengeCancel = challengeCancel; + isSetChallengeCancel = true; // mark as set } /** @@ -395,6 +447,7 @@ public void setChallengeCancel(ChallengeCancelEnum challengeCancel) { */ public ThreeDSecureData directoryResponse(DirectoryResponseEnum directoryResponse) { this.directoryResponse = directoryResponse; + isSetDirectoryResponse = true; // mark as set return this; } @@ -420,6 +473,7 @@ public DirectoryResponseEnum getDirectoryResponse() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDirectoryResponse(DirectoryResponseEnum directoryResponse) { this.directoryResponse = directoryResponse; + isSetDirectoryResponse = true; // mark as set } /** @@ -432,6 +486,7 @@ public void setDirectoryResponse(DirectoryResponseEnum directoryResponse) { */ public ThreeDSecureData dsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set return this; } @@ -459,6 +514,7 @@ public String getDsTransID() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDsTransID(String dsTransID) { this.dsTransID = dsTransID; + isSetDsTransID = true; // mark as set } /** @@ -469,6 +525,7 @@ public void setDsTransID(String dsTransID) { */ public ThreeDSecureData eci(String eci) { this.eci = eci; + isSetEci = true; // mark as set return this; } @@ -492,6 +549,7 @@ public String getEci() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEci(String eci) { this.eci = eci; + isSetEci = true; // mark as set } /** @@ -503,6 +561,7 @@ public void setEci(String eci) { */ public ThreeDSecureData riskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set return this; } @@ -528,6 +587,7 @@ public String getRiskScore() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRiskScore(String riskScore) { this.riskScore = riskScore; + isSetRiskScore = true; // mark as set } /** @@ -538,6 +598,7 @@ public void setRiskScore(String riskScore) { */ public ThreeDSecureData threeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set return this; } @@ -561,6 +622,7 @@ public String getThreeDSVersion() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setThreeDSVersion(String threeDSVersion) { this.threeDSVersion = threeDSVersion; + isSetThreeDSVersion = true; // mark as set } /** @@ -573,6 +635,7 @@ public void setThreeDSVersion(String threeDSVersion) { public ThreeDSecureData tokenAuthenticationVerificationValue( byte[] tokenAuthenticationVerificationValue) { this.tokenAuthenticationVerificationValue = tokenAuthenticationVerificationValue; + isSetTokenAuthenticationVerificationValue = true; // mark as set return this; } @@ -598,6 +661,7 @@ public byte[] getTokenAuthenticationVerificationValue() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTokenAuthenticationVerificationValue(byte[] tokenAuthenticationVerificationValue) { this.tokenAuthenticationVerificationValue = tokenAuthenticationVerificationValue; + isSetTokenAuthenticationVerificationValue = true; // mark as set } /** @@ -612,6 +676,7 @@ public void setTokenAuthenticationVerificationValue(byte[] tokenAuthenticationVe */ public ThreeDSecureData transStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set return this; } @@ -643,6 +708,7 @@ public String getTransStatusReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTransStatusReason(String transStatusReason) { this.transStatusReason = transStatusReason; + isSetTransStatusReason = true; // mark as set } /** @@ -655,6 +721,7 @@ public void setTransStatusReason(String transStatusReason) { */ public ThreeDSecureData xid(byte[] xid) { this.xid = xid; + isSetXid = true; // mark as set return this; } @@ -682,6 +749,27 @@ public byte[] getXid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setXid(byte[] xid) { this.xid = xid; + isSetXid = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ThreeDSecureData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ThreeDSecureData object is equal to o. */ @@ -695,36 +783,63 @@ public boolean equals(Object o) { } ThreeDSecureData threeDSecureData = (ThreeDSecureData) o; return Objects.equals(this.authenticationResponse, threeDSecureData.authenticationResponse) + && Objects.equals( + this.isSetAuthenticationResponse, threeDSecureData.isSetAuthenticationResponse) && Arrays.equals(this.cavv, threeDSecureData.cavv) + && Objects.equals(this.isSetCavv, threeDSecureData.isSetCavv) && Objects.equals(this.cavvAlgorithm, threeDSecureData.cavvAlgorithm) + && Objects.equals(this.isSetCavvAlgorithm, threeDSecureData.isSetCavvAlgorithm) && Objects.equals(this.challengeCancel, threeDSecureData.challengeCancel) + && Objects.equals(this.isSetChallengeCancel, threeDSecureData.isSetChallengeCancel) && Objects.equals(this.directoryResponse, threeDSecureData.directoryResponse) + && Objects.equals(this.isSetDirectoryResponse, threeDSecureData.isSetDirectoryResponse) && Objects.equals(this.dsTransID, threeDSecureData.dsTransID) + && Objects.equals(this.isSetDsTransID, threeDSecureData.isSetDsTransID) && Objects.equals(this.eci, threeDSecureData.eci) + && Objects.equals(this.isSetEci, threeDSecureData.isSetEci) && Objects.equals(this.riskScore, threeDSecureData.riskScore) + && Objects.equals(this.isSetRiskScore, threeDSecureData.isSetRiskScore) && Objects.equals(this.threeDSVersion, threeDSecureData.threeDSVersion) + && Objects.equals(this.isSetThreeDSVersion, threeDSecureData.isSetThreeDSVersion) && Arrays.equals( this.tokenAuthenticationVerificationValue, threeDSecureData.tokenAuthenticationVerificationValue) + && Objects.equals( + this.isSetTokenAuthenticationVerificationValue, + threeDSecureData.isSetTokenAuthenticationVerificationValue) && Objects.equals(this.transStatusReason, threeDSecureData.transStatusReason) - && Arrays.equals(this.xid, threeDSecureData.xid); + && Objects.equals(this.isSetTransStatusReason, threeDSecureData.isSetTransStatusReason) + && Arrays.equals(this.xid, threeDSecureData.xid) + && Objects.equals(this.isSetXid, threeDSecureData.isSetXid); } @Override public int hashCode() { return Objects.hash( authenticationResponse, + isSetAuthenticationResponse, Arrays.hashCode(cavv), + isSetCavv, cavvAlgorithm, + isSetCavvAlgorithm, challengeCancel, + isSetChallengeCancel, directoryResponse, + isSetDirectoryResponse, dsTransID, + isSetDsTransID, eci, + isSetEci, riskScore, + isSetRiskScore, threeDSVersion, + isSetThreeDSVersion, Arrays.hashCode(tokenAuthenticationVerificationValue), + isSetTokenAuthenticationVerificationValue, transStatusReason, - Arrays.hashCode(xid)); + isSetTransStatusReason, + Arrays.hashCode(xid), + isSetXid); } @Override @@ -761,6 +876,66 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAuthenticationResponse) { + addIfNull(nulls, JSON_PROPERTY_AUTHENTICATION_RESPONSE, this.authenticationResponse); + } + if (isSetCavv) { + addIfNull(nulls, JSON_PROPERTY_CAVV, this.cavv); + } + if (isSetCavvAlgorithm) { + addIfNull(nulls, JSON_PROPERTY_CAVV_ALGORITHM, this.cavvAlgorithm); + } + if (isSetChallengeCancel) { + addIfNull(nulls, JSON_PROPERTY_CHALLENGE_CANCEL, this.challengeCancel); + } + if (isSetDirectoryResponse) { + addIfNull(nulls, JSON_PROPERTY_DIRECTORY_RESPONSE, this.directoryResponse); + } + if (isSetDsTransID) { + addIfNull(nulls, JSON_PROPERTY_DS_TRANS_I_D, this.dsTransID); + } + if (isSetEci) { + addIfNull(nulls, JSON_PROPERTY_ECI, this.eci); + } + if (isSetRiskScore) { + addIfNull(nulls, JSON_PROPERTY_RISK_SCORE, this.riskScore); + } + if (isSetThreeDSVersion) { + addIfNull(nulls, JSON_PROPERTY_THREE_D_S_VERSION, this.threeDSVersion); + } + if (isSetTokenAuthenticationVerificationValue) { + addIfNull( + nulls, + JSON_PROPERTY_TOKEN_AUTHENTICATION_VERIFICATION_VALUE, + this.tokenAuthenticationVerificationValue); + } + if (isSetTransStatusReason) { + addIfNull(nulls, JSON_PROPERTY_TRANS_STATUS_REASON, this.transStatusReason); + } + if (isSetXid) { + addIfNull(nulls, JSON_PROPERTY_XID, this.xid); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ThreeDSecureData given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/Ticket.java b/src/main/java/com/adyen/model/checkout/Ticket.java index bf48628c4..411059eb4 100644 --- a/src/main/java/com/adyen/model/checkout/Ticket.java +++ b/src/main/java/com/adyen/model/checkout/Ticket.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -28,12 +30,27 @@ public class Ticket { public static final String JSON_PROPERTY_ISSUE_ADDRESS = "issueAddress"; private String issueAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueAddress = false; + public static final String JSON_PROPERTY_ISSUE_DATE = "issueDate"; private LocalDate issueDate; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetIssueDate = false; + public static final String JSON_PROPERTY_NUMBER = "number"; private String number; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public Ticket() {} /** @@ -46,6 +63,7 @@ public Ticket() {} */ public Ticket issueAddress(String issueAddress) { this.issueAddress = issueAddress; + isSetIssueAddress = true; // mark as set return this; } @@ -73,6 +91,7 @@ public String getIssueAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueAddress(String issueAddress) { this.issueAddress = issueAddress; + isSetIssueAddress = true; // mark as set } /** @@ -86,6 +105,7 @@ public void setIssueAddress(String issueAddress) { */ public Ticket issueDate(LocalDate issueDate) { this.issueDate = issueDate; + isSetIssueDate = true; // mark as set return this; } @@ -115,6 +135,7 @@ public LocalDate getIssueDate() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIssueDate(LocalDate issueDate) { this.issueDate = issueDate; + isSetIssueDate = true; // mark as set } /** @@ -127,6 +148,7 @@ public void setIssueDate(LocalDate issueDate) { */ public Ticket number(String number) { this.number = number; + isSetNumber = true; // mark as set return this; } @@ -154,6 +176,27 @@ public String getNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setNumber(String number) { this.number = number; + isSetNumber = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public Ticket includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this Ticket object is equal to o. */ @@ -167,13 +210,17 @@ public boolean equals(Object o) { } Ticket ticket = (Ticket) o; return Objects.equals(this.issueAddress, ticket.issueAddress) + && Objects.equals(this.isSetIssueAddress, ticket.isSetIssueAddress) && Objects.equals(this.issueDate, ticket.issueDate) - && Objects.equals(this.number, ticket.number); + && Objects.equals(this.isSetIssueDate, ticket.isSetIssueDate) + && Objects.equals(this.number, ticket.number) + && Objects.equals(this.isSetNumber, ticket.isSetNumber); } @Override public int hashCode() { - return Objects.hash(issueAddress, issueDate, number); + return Objects.hash( + issueAddress, isSetIssueAddress, issueDate, isSetIssueDate, number, isSetNumber); } @Override @@ -197,6 +244,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetIssueAddress) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_ADDRESS, this.issueAddress); + } + if (isSetIssueDate) { + addIfNull(nulls, JSON_PROPERTY_ISSUE_DATE, this.issueDate); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of Ticket given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TokenMandate.java b/src/main/java/com/adyen/model/checkout/TokenMandate.java index 320941510..ce2bd5fda 100644 --- a/src/main/java/com/adyen/model/checkout/TokenMandate.java +++ b/src/main/java/com/adyen/model/checkout/TokenMandate.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -44,9 +46,15 @@ public class TokenMandate { public static final String JSON_PROPERTY_ACCOUNT_ID_TYPE = "accountIdType"; private String accountIdType; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAccountIdType = false; + public static final String JSON_PROPERTY_AMOUNT = "amount"; private String amount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmount = false; + /** * The limitation rule of the billing amount. Possible values: * **max**: The transaction amount * can not exceed the `amount`. * **exact**: The transaction amount should be the same @@ -95,6 +103,9 @@ public static AmountRuleEnum fromValue(String value) { public static final String JSON_PROPERTY_AMOUNT_RULE = "amountRule"; private AmountRuleEnum amountRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAmountRule = false; + /** * The rule to specify the period, within which the recurring debit can happen, relative to the * mandate recurring date. Possible values: * **on**: On a specific date. * **before**: Before and @@ -145,18 +156,33 @@ public static BillingAttemptsRuleEnum fromValue(String value) { public static final String JSON_PROPERTY_BILLING_ATTEMPTS_RULE = "billingAttemptsRule"; private BillingAttemptsRuleEnum billingAttemptsRule; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingAttemptsRule = false; + public static final String JSON_PROPERTY_BILLING_DAY = "billingDay"; private String billingDay; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingDay = false; + public static final String JSON_PROPERTY_COUNT = "count"; private String count; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCount = false; + public static final String JSON_PROPERTY_CURRENCY = "currency"; private String currency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCurrency = false; + public static final String JSON_PROPERTY_ENDS_AT = "endsAt"; private String endsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEndsAt = false; + /** * The frequency with which a shopper should be charged. Possible values: **adhoc**, **daily**, * **weekly**, **biWeekly**, **monthly**, **quarterly**, **halfYearly**, **yearly**. @@ -216,27 +242,57 @@ public static FrequencyEnum fromValue(String value) { public static final String JSON_PROPERTY_FREQUENCY = "frequency"; private FrequencyEnum frequency; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFrequency = false; + public static final String JSON_PROPERTY_MANDATE_ID = "mandateId"; private String mandateId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMandateId = false; + public static final String JSON_PROPERTY_MASKED_ACCOUNT_ID = "maskedAccountId"; private String maskedAccountId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMaskedAccountId = false; + public static final String JSON_PROPERTY_PROVIDER_ID = "providerId"; private String providerId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetProviderId = false; + public static final String JSON_PROPERTY_REMARKS = "remarks"; private String remarks; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRemarks = false; + public static final String JSON_PROPERTY_STARTS_AT = "startsAt"; private String startsAt; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStartsAt = false; + public static final String JSON_PROPERTY_STATUS = "status"; private String status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + public static final String JSON_PROPERTY_TX_VARIANT = "txVariant"; private String txVariant; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTxVariant = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TokenMandate() {} /** @@ -247,6 +303,7 @@ public TokenMandate() {} */ public TokenMandate accountIdType(String accountIdType) { this.accountIdType = accountIdType; + isSetAccountIdType = true; // mark as set return this; } @@ -270,6 +327,7 @@ public String getAccountIdType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccountIdType(String accountIdType) { this.accountIdType = accountIdType; + isSetAccountIdType = true; // mark as set } /** @@ -280,6 +338,7 @@ public void setAccountIdType(String accountIdType) { */ public TokenMandate amount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set return this; } @@ -303,6 +362,7 @@ public String getAmount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmount(String amount) { this.amount = amount; + isSetAmount = true; // mark as set } /** @@ -317,6 +377,7 @@ public void setAmount(String amount) { */ public TokenMandate amountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set return this; } @@ -348,6 +409,7 @@ public AmountRuleEnum getAmountRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAmountRule(AmountRuleEnum amountRule) { this.amountRule = amountRule; + isSetAmountRule = true; // mark as set } /** @@ -363,6 +425,7 @@ public void setAmountRule(AmountRuleEnum amountRule) { */ public TokenMandate billingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set return this; } @@ -396,6 +459,7 @@ public BillingAttemptsRuleEnum getBillingAttemptsRule() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) { this.billingAttemptsRule = billingAttemptsRule; + isSetBillingAttemptsRule = true; // mark as set } /** @@ -410,6 +474,7 @@ public void setBillingAttemptsRule(BillingAttemptsRuleEnum billingAttemptsRule) */ public TokenMandate billingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set return this; } @@ -441,6 +506,7 @@ public String getBillingDay() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingDay(String billingDay) { this.billingDay = billingDay; + isSetBillingDay = true; // mark as set } /** @@ -451,6 +517,7 @@ public void setBillingDay(String billingDay) { */ public TokenMandate count(String count) { this.count = count; + isSetCount = true; // mark as set return this; } @@ -474,6 +541,7 @@ public String getCount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCount(String count) { this.count = count; + isSetCount = true; // mark as set } /** @@ -486,6 +554,7 @@ public void setCount(String count) { */ public TokenMandate currency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set return this; } @@ -513,6 +582,7 @@ public String getCurrency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCurrency(String currency) { this.currency = currency; + isSetCurrency = true; // mark as set } /** @@ -523,6 +593,7 @@ public void setCurrency(String currency) { */ public TokenMandate endsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set return this; } @@ -546,6 +617,7 @@ public String getEndsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEndsAt(String endsAt) { this.endsAt = endsAt; + isSetEndsAt = true; // mark as set } /** @@ -559,6 +631,7 @@ public void setEndsAt(String endsAt) { */ public TokenMandate frequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set return this; } @@ -588,6 +661,7 @@ public FrequencyEnum getFrequency() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrequency(FrequencyEnum frequency) { this.frequency = frequency; + isSetFrequency = true; // mark as set } /** @@ -598,6 +672,7 @@ public void setFrequency(FrequencyEnum frequency) { */ public TokenMandate mandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set return this; } @@ -621,6 +696,7 @@ public String getMandateId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMandateId(String mandateId) { this.mandateId = mandateId; + isSetMandateId = true; // mark as set } /** @@ -631,6 +707,7 @@ public void setMandateId(String mandateId) { */ public TokenMandate maskedAccountId(String maskedAccountId) { this.maskedAccountId = maskedAccountId; + isSetMaskedAccountId = true; // mark as set return this; } @@ -654,6 +731,7 @@ public String getMaskedAccountId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaskedAccountId(String maskedAccountId) { this.maskedAccountId = maskedAccountId; + isSetMaskedAccountId = true; // mark as set } /** @@ -664,6 +742,7 @@ public void setMaskedAccountId(String maskedAccountId) { */ public TokenMandate providerId(String providerId) { this.providerId = providerId; + isSetProviderId = true; // mark as set return this; } @@ -687,6 +766,7 @@ public String getProviderId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProviderId(String providerId) { this.providerId = providerId; + isSetProviderId = true; // mark as set } /** @@ -697,6 +777,7 @@ public void setProviderId(String providerId) { */ public TokenMandate remarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set return this; } @@ -720,6 +801,7 @@ public String getRemarks() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemarks(String remarks) { this.remarks = remarks; + isSetRemarks = true; // mark as set } /** @@ -731,6 +813,7 @@ public void setRemarks(String remarks) { */ public TokenMandate startsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set return this; } @@ -756,6 +839,7 @@ public String getStartsAt() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStartsAt(String startsAt) { this.startsAt = startsAt; + isSetStartsAt = true; // mark as set } /** @@ -766,6 +850,7 @@ public void setStartsAt(String startsAt) { */ public TokenMandate status(String status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -789,6 +874,7 @@ public String getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(String status) { this.status = status; + isSetStatus = true; // mark as set } /** @@ -799,6 +885,7 @@ public void setStatus(String status) { */ public TokenMandate txVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set return this; } @@ -822,6 +909,27 @@ public String getTxVariant() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTxVariant(String txVariant) { this.txVariant = txVariant; + isSetTxVariant = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TokenMandate includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TokenMandate object is equal to o. */ @@ -835,42 +943,74 @@ public boolean equals(Object o) { } TokenMandate tokenMandate = (TokenMandate) o; return Objects.equals(this.accountIdType, tokenMandate.accountIdType) + && Objects.equals(this.isSetAccountIdType, tokenMandate.isSetAccountIdType) && Objects.equals(this.amount, tokenMandate.amount) + && Objects.equals(this.isSetAmount, tokenMandate.isSetAmount) && Objects.equals(this.amountRule, tokenMandate.amountRule) + && Objects.equals(this.isSetAmountRule, tokenMandate.isSetAmountRule) && Objects.equals(this.billingAttemptsRule, tokenMandate.billingAttemptsRule) + && Objects.equals(this.isSetBillingAttemptsRule, tokenMandate.isSetBillingAttemptsRule) && Objects.equals(this.billingDay, tokenMandate.billingDay) + && Objects.equals(this.isSetBillingDay, tokenMandate.isSetBillingDay) && Objects.equals(this.count, tokenMandate.count) + && Objects.equals(this.isSetCount, tokenMandate.isSetCount) && Objects.equals(this.currency, tokenMandate.currency) + && Objects.equals(this.isSetCurrency, tokenMandate.isSetCurrency) && Objects.equals(this.endsAt, tokenMandate.endsAt) + && Objects.equals(this.isSetEndsAt, tokenMandate.isSetEndsAt) && Objects.equals(this.frequency, tokenMandate.frequency) + && Objects.equals(this.isSetFrequency, tokenMandate.isSetFrequency) && Objects.equals(this.mandateId, tokenMandate.mandateId) + && Objects.equals(this.isSetMandateId, tokenMandate.isSetMandateId) && Objects.equals(this.maskedAccountId, tokenMandate.maskedAccountId) + && Objects.equals(this.isSetMaskedAccountId, tokenMandate.isSetMaskedAccountId) && Objects.equals(this.providerId, tokenMandate.providerId) + && Objects.equals(this.isSetProviderId, tokenMandate.isSetProviderId) && Objects.equals(this.remarks, tokenMandate.remarks) + && Objects.equals(this.isSetRemarks, tokenMandate.isSetRemarks) && Objects.equals(this.startsAt, tokenMandate.startsAt) + && Objects.equals(this.isSetStartsAt, tokenMandate.isSetStartsAt) && Objects.equals(this.status, tokenMandate.status) - && Objects.equals(this.txVariant, tokenMandate.txVariant); + && Objects.equals(this.isSetStatus, tokenMandate.isSetStatus) + && Objects.equals(this.txVariant, tokenMandate.txVariant) + && Objects.equals(this.isSetTxVariant, tokenMandate.isSetTxVariant); } @Override public int hashCode() { return Objects.hash( accountIdType, + isSetAccountIdType, amount, + isSetAmount, amountRule, + isSetAmountRule, billingAttemptsRule, + isSetBillingAttemptsRule, billingDay, + isSetBillingDay, count, + isSetCount, currency, + isSetCurrency, endsAt, + isSetEndsAt, frequency, + isSetFrequency, mandateId, + isSetMandateId, maskedAccountId, + isSetMaskedAccountId, providerId, + isSetProviderId, remarks, + isSetRemarks, startsAt, + isSetStartsAt, status, - txVariant); + isSetStatus, + txVariant, + isSetTxVariant); } @Override @@ -909,6 +1049,75 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAccountIdType) { + addIfNull(nulls, JSON_PROPERTY_ACCOUNT_ID_TYPE, this.accountIdType); + } + if (isSetAmount) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT, this.amount); + } + if (isSetAmountRule) { + addIfNull(nulls, JSON_PROPERTY_AMOUNT_RULE, this.amountRule); + } + if (isSetBillingAttemptsRule) { + addIfNull(nulls, JSON_PROPERTY_BILLING_ATTEMPTS_RULE, this.billingAttemptsRule); + } + if (isSetBillingDay) { + addIfNull(nulls, JSON_PROPERTY_BILLING_DAY, this.billingDay); + } + if (isSetCount) { + addIfNull(nulls, JSON_PROPERTY_COUNT, this.count); + } + if (isSetCurrency) { + addIfNull(nulls, JSON_PROPERTY_CURRENCY, this.currency); + } + if (isSetEndsAt) { + addIfNull(nulls, JSON_PROPERTY_ENDS_AT, this.endsAt); + } + if (isSetFrequency) { + addIfNull(nulls, JSON_PROPERTY_FREQUENCY, this.frequency); + } + if (isSetMandateId) { + addIfNull(nulls, JSON_PROPERTY_MANDATE_ID, this.mandateId); + } + if (isSetMaskedAccountId) { + addIfNull(nulls, JSON_PROPERTY_MASKED_ACCOUNT_ID, this.maskedAccountId); + } + if (isSetProviderId) { + addIfNull(nulls, JSON_PROPERTY_PROVIDER_ID, this.providerId); + } + if (isSetRemarks) { + addIfNull(nulls, JSON_PROPERTY_REMARKS, this.remarks); + } + if (isSetStartsAt) { + addIfNull(nulls, JSON_PROPERTY_STARTS_AT, this.startsAt); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTxVariant) { + addIfNull(nulls, JSON_PROPERTY_TX_VARIANT, this.txVariant); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TokenMandate given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TravelAgency.java b/src/main/java/com/adyen/model/checkout/TravelAgency.java index c8f2cd418..0b2aeefda 100644 --- a/src/main/java/com/adyen/model/checkout/TravelAgency.java +++ b/src/main/java/com/adyen/model/checkout/TravelAgency.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -23,9 +25,21 @@ public class TravelAgency { public static final String JSON_PROPERTY_CODE = "code"; private String code; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCode = false; + public static final String JSON_PROPERTY_NAME = "name"; private String name; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TravelAgency() {} /** @@ -40,6 +54,7 @@ public TravelAgency() {} */ public TravelAgency code(String code) { this.code = code; + isSetCode = true; // mark as set return this; } @@ -71,6 +86,7 @@ public String getCode() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCode(String code) { this.code = code; + isSetCode = true; // mark as set } /** @@ -84,6 +100,7 @@ public void setCode(String code) { */ public TravelAgency name(String name) { this.name = name; + isSetName = true; // mark as set return this; } @@ -113,6 +130,27 @@ public String getName() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(String name) { this.name = name; + isSetName = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TravelAgency includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TravelAgency object is equal to o. */ @@ -126,12 +164,14 @@ public boolean equals(Object o) { } TravelAgency travelAgency = (TravelAgency) o; return Objects.equals(this.code, travelAgency.code) - && Objects.equals(this.name, travelAgency.name); + && Objects.equals(this.isSetCode, travelAgency.isSetCode) + && Objects.equals(this.name, travelAgency.name) + && Objects.equals(this.isSetName, travelAgency.isSetName); } @Override public int hashCode() { - return Objects.hash(code, name); + return Objects.hash(code, isSetCode, name, isSetName); } @Override @@ -154,6 +194,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCode) { + addIfNull(nulls, JSON_PROPERTY_CODE, this.code); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TravelAgency given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/TwintDetails.java b/src/main/java/com/adyen/model/checkout/TwintDetails.java index f1a88c362..ac1e8dde1 100644 --- a/src/main/java/com/adyen/model/checkout/TwintDetails.java +++ b/src/main/java/com/adyen/model/checkout/TwintDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class TwintDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; private String subtype; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubtype = false; + /** The payment method type. */ public enum TypeEnum { TWINT(String.valueOf("twint")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public TwintDetails() {} /** @@ -99,6 +125,7 @@ public TwintDetails() {} */ public TwintDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public TwintDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public TwintDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -201,6 +232,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -213,6 +245,7 @@ public void setSdkData(String sdkData) { */ public TwintDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -250,6 +284,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public TwintDetails subtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set return this; } @@ -273,6 +308,7 @@ public String getSubtype() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSubtype(String subtype) { this.subtype = subtype; + isSetSubtype = true; // mark as set } /** @@ -283,6 +319,7 @@ public void setSubtype(String subtype) { */ public TwintDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -306,6 +343,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public TwintDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this TwintDetails object is equal to o. */ @@ -319,17 +377,35 @@ public boolean equals(Object o) { } TwintDetails twintDetails = (TwintDetails) o; return Objects.equals(this.checkoutAttemptId, twintDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, twintDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, twintDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, twintDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, twintDetails.sdkData) + && Objects.equals(this.isSetSdkData, twintDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, twintDetails.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, twintDetails.isSetStoredPaymentMethodId) && Objects.equals(this.subtype, twintDetails.subtype) - && Objects.equals(this.type, twintDetails.type); + && Objects.equals(this.isSetSubtype, twintDetails.isSetSubtype) + && Objects.equals(this.type, twintDetails.type) + && Objects.equals(this.isSetType, twintDetails.isSetType); } @Override public int hashCode() { return Objects.hash( - checkoutAttemptId, recurringDetailReference, sdkData, storedPaymentMethodId, subtype, type); + checkoutAttemptId, + isSetCheckoutAttemptId, + recurringDetailReference, + isSetRecurringDetailReference, + sdkData, + isSetSdkData, + storedPaymentMethodId, + isSetStoredPaymentMethodId, + subtype, + isSetSubtype, + type, + isSetType); } @Override @@ -360,6 +436,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetSubtype) { + addIfNull(nulls, JSON_PROPERTY_SUBTYPE, this.subtype); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of TwintDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java b/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java index fbb9998c4..eb28971fc 100644 --- a/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java +++ b/src/main/java/com/adyen/model/checkout/UPIPaymentMethod.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; @@ -36,6 +38,15 @@ public class UPIPaymentMethod extends ShopperIdPaymentMethod { public static final String JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS = "virtualPaymentAddress"; private String virtualPaymentAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVirtualPaymentAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UPIPaymentMethod() {} /** @@ -46,6 +57,7 @@ public UPIPaymentMethod() {} */ public UPIPaymentMethod virtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set return this; } @@ -69,6 +81,27 @@ public String getVirtualPaymentAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UPIPaymentMethod includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UPIPaymentMethod object is equal to o. */ @@ -82,12 +115,14 @@ public boolean equals(Object o) { } UPIPaymentMethod upIPaymentMethod = (UPIPaymentMethod) o; return Objects.equals(this.virtualPaymentAddress, upIPaymentMethod.virtualPaymentAddress) + && Objects.equals( + this.isSetVirtualPaymentAddress, upIPaymentMethod.isSetVirtualPaymentAddress) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(virtualPaymentAddress, super.hashCode()); + return Objects.hash(virtualPaymentAddress, isSetVirtualPaymentAddress, super.hashCode()); } @Override @@ -119,6 +154,30 @@ private String toIndentedString(Object o) { JSON.registerDiscriminator(UPIPaymentMethod.class, "type", mappings); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetVirtualPaymentAddress) { + addIfNull(nulls, JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS, this.virtualPaymentAddress); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UPIPaymentMethod given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java b/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java index 8c2a9b740..a54c01baa 100644 --- a/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java +++ b/src/main/java/com/adyen/model/checkout/UpdatePaymentLinkRequest.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -66,6 +68,15 @@ public static StatusEnum fromValue(String value) { public static final String JSON_PROPERTY_STATUS = "status"; private StatusEnum status; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpdatePaymentLinkRequest() {} /** @@ -76,6 +87,7 @@ public UpdatePaymentLinkRequest() {} */ public UpdatePaymentLinkRequest status(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set return this; } @@ -99,6 +111,27 @@ public StatusEnum getStatus() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatus(StatusEnum status) { this.status = status; + isSetStatus = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpdatePaymentLinkRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpdatePaymentLinkRequest object is equal to o. */ @@ -111,12 +144,13 @@ public boolean equals(Object o) { return false; } UpdatePaymentLinkRequest updatePaymentLinkRequest = (UpdatePaymentLinkRequest) o; - return Objects.equals(this.status, updatePaymentLinkRequest.status); + return Objects.equals(this.status, updatePaymentLinkRequest.status) + && Objects.equals(this.isSetStatus, updatePaymentLinkRequest.isSetStatus); } @Override public int hashCode() { - return Objects.hash(status); + return Objects.hash(status, isSetStatus); } @Override @@ -138,6 +172,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpdatePaymentLinkRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java index 4b97e0100..90fc04f96 100644 --- a/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiCollectDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,23 +38,41 @@ public class UpiCollectDetails { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **upi_collect** */ public enum TypeEnum { UPI_COLLECT(String.valueOf("upi_collect")); @@ -95,9 +115,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS = "virtualPaymentAddress"; private String virtualPaymentAddress; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVirtualPaymentAddress = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpiCollectDetails() {} /** @@ -111,6 +143,7 @@ public UpiCollectDetails() {} */ public UpiCollectDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -140,6 +173,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -150,6 +184,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public UpiCollectDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -173,6 +208,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -187,6 +223,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public UpiCollectDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -218,6 +255,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -228,6 +266,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public UpiCollectDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -252,6 +291,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -264,6 +304,7 @@ public void setSdkData(String sdkData) { */ public UpiCollectDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -291,6 +332,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -303,6 +345,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public UpiCollectDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -330,6 +373,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -340,6 +384,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public UpiCollectDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -363,6 +408,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -373,6 +419,7 @@ public void setType(TypeEnum type) { */ public UpiCollectDetails virtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set return this; } @@ -396,6 +443,27 @@ public String getVirtualPaymentAddress() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualPaymentAddress(String virtualPaymentAddress) { this.virtualPaymentAddress = virtualPaymentAddress; + isSetVirtualPaymentAddress = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpiCollectDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpiCollectDetails object is equal to o. */ @@ -409,27 +477,49 @@ public boolean equals(Object o) { } UpiCollectDetails upiCollectDetails = (UpiCollectDetails) o; return Objects.equals(this.billingSequenceNumber, upiCollectDetails.billingSequenceNumber) + && Objects.equals( + this.isSetBillingSequenceNumber, upiCollectDetails.isSetBillingSequenceNumber) && Objects.equals(this.checkoutAttemptId, upiCollectDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, upiCollectDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, upiCollectDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, upiCollectDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, upiCollectDetails.sdkData) + && Objects.equals(this.isSetSdkData, upiCollectDetails.isSetSdkData) && Objects.equals( this.shopperNotificationReference, upiCollectDetails.shopperNotificationReference) + && Objects.equals( + this.isSetShopperNotificationReference, + upiCollectDetails.isSetShopperNotificationReference) && Objects.equals(this.storedPaymentMethodId, upiCollectDetails.storedPaymentMethodId) + && Objects.equals( + this.isSetStoredPaymentMethodId, upiCollectDetails.isSetStoredPaymentMethodId) && Objects.equals(this.type, upiCollectDetails.type) - && Objects.equals(this.virtualPaymentAddress, upiCollectDetails.virtualPaymentAddress); + && Objects.equals(this.isSetType, upiCollectDetails.isSetType) + && Objects.equals(this.virtualPaymentAddress, upiCollectDetails.virtualPaymentAddress) + && Objects.equals( + this.isSetVirtualPaymentAddress, upiCollectDetails.isSetVirtualPaymentAddress); } @Override public int hashCode() { return Objects.hash( billingSequenceNumber, + isSetBillingSequenceNumber, checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperNotificationReference, + isSetShopperNotificationReference, storedPaymentMethodId, + isSetStoredPaymentMethodId, type, - virtualPaymentAddress); + isSetType, + virtualPaymentAddress, + isSetVirtualPaymentAddress); } @Override @@ -468,6 +558,52 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVirtualPaymentAddress) { + addIfNull(nulls, JSON_PROPERTY_VIRTUAL_PAYMENT_ADDRESS, this.virtualPaymentAddress); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpiCollectDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java index be40f6d0c..81b18bad6 100644 --- a/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiIntentDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -36,26 +38,47 @@ public class UpiIntentDetails { public static final String JSON_PROPERTY_APP_ID = "appId"; private String appId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAppId = false; + public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **upi_intent** */ public enum TypeEnum { UPI_INTENT(String.valueOf("upi_intent")); @@ -98,6 +121,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpiIntentDetails() {} /** @@ -108,6 +140,7 @@ public UpiIntentDetails() {} */ public UpiIntentDetails appId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set return this; } @@ -131,6 +164,7 @@ public String getAppId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAppId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set } /** @@ -144,6 +178,7 @@ public void setAppId(String appId) { */ public UpiIntentDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -173,6 +208,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -183,6 +219,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public UpiIntentDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -206,6 +243,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -220,6 +258,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public UpiIntentDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -251,6 +290,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -261,6 +301,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public UpiIntentDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -285,6 +326,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -297,6 +339,7 @@ public void setSdkData(String sdkData) { */ public UpiIntentDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -324,6 +367,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -336,6 +380,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public UpiIntentDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -363,6 +408,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -373,6 +419,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public UpiIntentDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -396,6 +443,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpiIntentDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpiIntentDetails object is equal to o. */ @@ -409,27 +477,48 @@ public boolean equals(Object o) { } UpiIntentDetails upiIntentDetails = (UpiIntentDetails) o; return Objects.equals(this.appId, upiIntentDetails.appId) + && Objects.equals(this.isSetAppId, upiIntentDetails.isSetAppId) && Objects.equals(this.billingSequenceNumber, upiIntentDetails.billingSequenceNumber) + && Objects.equals( + this.isSetBillingSequenceNumber, upiIntentDetails.isSetBillingSequenceNumber) && Objects.equals(this.checkoutAttemptId, upiIntentDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, upiIntentDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, upiIntentDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, upiIntentDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, upiIntentDetails.sdkData) + && Objects.equals(this.isSetSdkData, upiIntentDetails.isSetSdkData) && Objects.equals( this.shopperNotificationReference, upiIntentDetails.shopperNotificationReference) + && Objects.equals( + this.isSetShopperNotificationReference, + upiIntentDetails.isSetShopperNotificationReference) && Objects.equals(this.storedPaymentMethodId, upiIntentDetails.storedPaymentMethodId) - && Objects.equals(this.type, upiIntentDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, upiIntentDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, upiIntentDetails.type) + && Objects.equals(this.isSetType, upiIntentDetails.isSetType); } @Override public int hashCode() { return Objects.hash( appId, + isSetAppId, billingSequenceNumber, + isSetBillingSequenceNumber, checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperNotificationReference, + isSetShopperNotificationReference, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -466,6 +555,52 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAppId) { + addIfNull(nulls, JSON_PROPERTY_APP_ID, this.appId); + } + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpiIntentDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UpiQrDetails.java b/src/main/java/com/adyen/model/checkout/UpiQrDetails.java index d8f77ff27..1bc75908f 100644 --- a/src/main/java/com/adyen/model/checkout/UpiQrDetails.java +++ b/src/main/java/com/adyen/model/checkout/UpiQrDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,23 +37,41 @@ public class UpiQrDetails { public static final String JSON_PROPERTY_BILLING_SEQUENCE_NUMBER = "billingSequenceNumber"; private String billingSequenceNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetBillingSequenceNumber = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE = "shopperNotificationReference"; private String shopperNotificationReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperNotificationReference = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **upi_qr** */ public enum TypeEnum { UPI_QR(String.valueOf("upi_qr")); @@ -94,6 +114,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UpiQrDetails() {} /** @@ -107,6 +136,7 @@ public UpiQrDetails() {} */ public UpiQrDetails billingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set return this; } @@ -136,6 +166,7 @@ public String getBillingSequenceNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBillingSequenceNumber(String billingSequenceNumber) { this.billingSequenceNumber = billingSequenceNumber; + isSetBillingSequenceNumber = true; // mark as set } /** @@ -146,6 +177,7 @@ public void setBillingSequenceNumber(String billingSequenceNumber) { */ public UpiQrDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -169,6 +201,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -183,6 +216,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public UpiQrDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -214,6 +248,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -224,6 +259,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public UpiQrDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -248,6 +284,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -260,6 +297,7 @@ public void setSdkData(String sdkData) { */ public UpiQrDetails shopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set return this; } @@ -287,6 +325,7 @@ public String getShopperNotificationReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperNotificationReference(String shopperNotificationReference) { this.shopperNotificationReference = shopperNotificationReference; + isSetShopperNotificationReference = true; // mark as set } /** @@ -299,6 +338,7 @@ public void setShopperNotificationReference(String shopperNotificationReference) */ public UpiQrDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -326,6 +366,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -336,6 +377,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public UpiQrDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -359,6 +401,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UpiQrDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UpiQrDetails object is equal to o. */ @@ -372,25 +435,41 @@ public boolean equals(Object o) { } UpiQrDetails upiQrDetails = (UpiQrDetails) o; return Objects.equals(this.billingSequenceNumber, upiQrDetails.billingSequenceNumber) + && Objects.equals(this.isSetBillingSequenceNumber, upiQrDetails.isSetBillingSequenceNumber) && Objects.equals(this.checkoutAttemptId, upiQrDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, upiQrDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, upiQrDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, upiQrDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, upiQrDetails.sdkData) + && Objects.equals(this.isSetSdkData, upiQrDetails.isSetSdkData) && Objects.equals( this.shopperNotificationReference, upiQrDetails.shopperNotificationReference) + && Objects.equals( + this.isSetShopperNotificationReference, upiQrDetails.isSetShopperNotificationReference) && Objects.equals(this.storedPaymentMethodId, upiQrDetails.storedPaymentMethodId) - && Objects.equals(this.type, upiQrDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, upiQrDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, upiQrDetails.type) + && Objects.equals(this.isSetType, upiQrDetails.isSetType); } @Override public int hashCode() { return Objects.hash( billingSequenceNumber, + isSetBillingSequenceNumber, checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, shopperNotificationReference, + isSetShopperNotificationReference, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -426,6 +505,49 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetBillingSequenceNumber) { + addIfNull(nulls, JSON_PROPERTY_BILLING_SEQUENCE_NUMBER, this.billingSequenceNumber); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetShopperNotificationReference) { + addIfNull( + nulls, JSON_PROPERTY_SHOPPER_NOTIFICATION_REFERENCE, this.shopperNotificationReference); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UpiQrDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UtilityRequest.java b/src/main/java/com/adyen/model/checkout/UtilityRequest.java index cff9c4bd7..c91f6eca2 100644 --- a/src/main/java/com/adyen/model/checkout/UtilityRequest.java +++ b/src/main/java/com/adyen/model/checkout/UtilityRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class UtilityRequest { public static final String JSON_PROPERTY_ORIGIN_DOMAINS = "originDomains"; private List originDomains; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginDomains = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UtilityRequest() {} /** @@ -35,6 +46,7 @@ public UtilityRequest() {} */ public UtilityRequest originDomains(List originDomains) { this.originDomains = originDomains; + isSetOriginDomains = true; // mark as set return this; } @@ -66,6 +78,27 @@ public List getOriginDomains() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginDomains(List originDomains) { this.originDomains = originDomains; + isSetOriginDomains = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UtilityRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UtilityRequest object is equal to o. */ @@ -78,12 +111,13 @@ public boolean equals(Object o) { return false; } UtilityRequest utilityRequest = (UtilityRequest) o; - return Objects.equals(this.originDomains, utilityRequest.originDomains); + return Objects.equals(this.originDomains, utilityRequest.originDomains) + && Objects.equals(this.isSetOriginDomains, utilityRequest.isSetOriginDomains); } @Override public int hashCode() { - return Objects.hash(originDomains); + return Objects.hash(originDomains, isSetOriginDomains); } @Override @@ -105,6 +139,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOriginDomains) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN_DOMAINS, this.originDomains); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UtilityRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/UtilityResponse.java b/src/main/java/com/adyen/model/checkout/UtilityResponse.java index fcf98951d..4781269bc 100644 --- a/src/main/java/com/adyen/model/checkout/UtilityResponse.java +++ b/src/main/java/com/adyen/model/checkout/UtilityResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -25,6 +27,15 @@ public class UtilityResponse { public static final String JSON_PROPERTY_ORIGIN_KEYS = "originKeys"; private Map originKeys; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOriginKeys = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public UtilityResponse() {} /** @@ -37,6 +48,7 @@ public UtilityResponse() {} */ public UtilityResponse originKeys(Map originKeys) { this.originKeys = originKeys; + isSetOriginKeys = true; // mark as set return this; } @@ -72,6 +84,27 @@ public Map getOriginKeys() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOriginKeys(Map originKeys) { this.originKeys = originKeys; + isSetOriginKeys = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public UtilityResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this UtilityResponse object is equal to o. */ @@ -84,12 +117,13 @@ public boolean equals(Object o) { return false; } UtilityResponse utilityResponse = (UtilityResponse) o; - return Objects.equals(this.originKeys, utilityResponse.originKeys); + return Objects.equals(this.originKeys, utilityResponse.originKeys) + && Objects.equals(this.isSetOriginKeys, utilityResponse.isSetOriginKeys); } @Override public int hashCode() { - return Objects.hash(originKeys); + return Objects.hash(originKeys, isSetOriginKeys); } @Override @@ -111,6 +145,30 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetOriginKeys) { + addIfNull(nulls, JSON_PROPERTY_ORIGIN_KEYS, this.originKeys); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of UtilityResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java b/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java index 61bd95a9c..38019bad7 100644 --- a/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java +++ b/src/main/java/com/adyen/model/checkout/ValidateShopperIdRequest.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -29,18 +31,39 @@ public class ValidateShopperIdRequest { public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; private String merchantAccount; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; private ShopperIdPaymentMethod paymentMethod; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_SHOPPER_EMAIL = "shopperEmail"; private String shopperEmail; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperEmail = false; + public static final String JSON_PROPERTY_SHOPPER_I_P = "shopperIP"; private String shopperIP; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperIP = false; + public static final String JSON_PROPERTY_SHOPPER_REFERENCE = "shopperReference"; private String shopperReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetShopperReference = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ValidateShopperIdRequest() {} /** @@ -52,6 +75,7 @@ public ValidateShopperIdRequest() {} */ public ValidateShopperIdRequest merchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set return this; } @@ -77,6 +101,7 @@ public String getMerchantAccount() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMerchantAccount(String merchantAccount) { this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set } /** @@ -87,6 +112,7 @@ public void setMerchantAccount(String merchantAccount) { */ public ValidateShopperIdRequest paymentMethod(ShopperIdPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set return this; } @@ -110,6 +136,7 @@ public ShopperIdPaymentMethod getPaymentMethod() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaymentMethod(ShopperIdPaymentMethod paymentMethod) { this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set } /** @@ -120,6 +147,7 @@ public void setPaymentMethod(ShopperIdPaymentMethod paymentMethod) { */ public ValidateShopperIdRequest shopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set return this; } @@ -143,6 +171,7 @@ public String getShopperEmail() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperEmail(String shopperEmail) { this.shopperEmail = shopperEmail; + isSetShopperEmail = true; // mark as set } /** @@ -153,6 +182,7 @@ public void setShopperEmail(String shopperEmail) { */ public ValidateShopperIdRequest shopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set return this; } @@ -176,6 +206,7 @@ public String getShopperIP() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperIP(String shopperIP) { this.shopperIP = shopperIP; + isSetShopperIP = true; // mark as set } /** @@ -186,6 +217,7 @@ public void setShopperIP(String shopperIP) { */ public ValidateShopperIdRequest shopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set return this; } @@ -209,6 +241,27 @@ public String getShopperReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShopperReference(String shopperReference) { this.shopperReference = shopperReference; + isSetShopperReference = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ValidateShopperIdRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ValidateShopperIdRequest object is equal to o. */ @@ -222,15 +275,31 @@ public boolean equals(Object o) { } ValidateShopperIdRequest validateShopperIdRequest = (ValidateShopperIdRequest) o; return Objects.equals(this.merchantAccount, validateShopperIdRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, validateShopperIdRequest.isSetMerchantAccount) && Objects.equals(this.paymentMethod, validateShopperIdRequest.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, validateShopperIdRequest.isSetPaymentMethod) && Objects.equals(this.shopperEmail, validateShopperIdRequest.shopperEmail) + && Objects.equals(this.isSetShopperEmail, validateShopperIdRequest.isSetShopperEmail) && Objects.equals(this.shopperIP, validateShopperIdRequest.shopperIP) - && Objects.equals(this.shopperReference, validateShopperIdRequest.shopperReference); + && Objects.equals(this.isSetShopperIP, validateShopperIdRequest.isSetShopperIP) + && Objects.equals(this.shopperReference, validateShopperIdRequest.shopperReference) + && Objects.equals( + this.isSetShopperReference, validateShopperIdRequest.isSetShopperReference); } @Override public int hashCode() { - return Objects.hash(merchantAccount, paymentMethod, shopperEmail, shopperIP, shopperReference); + return Objects.hash( + merchantAccount, + isSetMerchantAccount, + paymentMethod, + isSetPaymentMethod, + shopperEmail, + isSetShopperEmail, + shopperIP, + isSetShopperIP, + shopperReference, + isSetShopperReference); } @Override @@ -256,6 +325,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } + if (isSetShopperEmail) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_EMAIL, this.shopperEmail); + } + if (isSetShopperIP) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_I_P, this.shopperIP); + } + if (isSetShopperReference) { + addIfNull(nulls, JSON_PROPERTY_SHOPPER_REFERENCE, this.shopperReference); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ValidateShopperIdRequest given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java b/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java index 6cfb52834..ad4d6dd1f 100644 --- a/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java +++ b/src/main/java/com/adyen/model/checkout/ValidateShopperIdResponse.java @@ -11,6 +11,8 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -26,9 +28,21 @@ public class ValidateShopperIdResponse { public static final String JSON_PROPERTY_REASON = "reason"; private String reason; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetReason = false; + public static final String JSON_PROPERTY_RESULT = "result"; private Result result; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetResult = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ValidateShopperIdResponse() {} /** @@ -39,6 +53,7 @@ public ValidateShopperIdResponse() {} */ public ValidateShopperIdResponse reason(String reason) { this.reason = reason; + isSetReason = true; // mark as set return this; } @@ -62,6 +77,7 @@ public String getReason() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReason(String reason) { this.reason = reason; + isSetReason = true; // mark as set } /** @@ -72,6 +88,7 @@ public void setReason(String reason) { */ public ValidateShopperIdResponse result(Result result) { this.result = result; + isSetResult = true; // mark as set return this; } @@ -95,6 +112,27 @@ public Result getResult() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setResult(Result result) { this.result = result; + isSetResult = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ValidateShopperIdResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ValidateShopperIdResponse object is equal to o. */ @@ -108,12 +146,14 @@ public boolean equals(Object o) { } ValidateShopperIdResponse validateShopperIdResponse = (ValidateShopperIdResponse) o; return Objects.equals(this.reason, validateShopperIdResponse.reason) - && Objects.equals(this.result, validateShopperIdResponse.result); + && Objects.equals(this.isSetReason, validateShopperIdResponse.isSetReason) + && Objects.equals(this.result, validateShopperIdResponse.result) + && Objects.equals(this.isSetResult, validateShopperIdResponse.isSetResult); } @Override public int hashCode() { - return Objects.hash(reason, result); + return Objects.hash(reason, isSetReason, result, isSetResult); } @Override @@ -136,6 +176,33 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetReason) { + addIfNull(nulls, JSON_PROPERTY_REASON, this.reason); + } + if (isSetResult) { + addIfNull(nulls, JSON_PROPERTY_RESULT, this.result); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ValidateShopperIdResponse given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/VippsDetails.java b/src/main/java/com/adyen/model/checkout/VippsDetails.java index 2ef5bac82..ec847cbb8 100644 --- a/src/main/java/com/adyen/model/checkout/VippsDetails.java +++ b/src/main/java/com/adyen/model/checkout/VippsDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class VippsDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + public static final String JSON_PROPERTY_TELEPHONE_NUMBER = "telephoneNumber"; private String telephoneNumber; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTelephoneNumber = false; + /** **vipps** */ public enum TypeEnum { VIPPS(String.valueOf("vipps")); @@ -89,6 +106,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VippsDetails() {} /** @@ -99,6 +125,7 @@ public VippsDetails() {} */ public VippsDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -122,6 +149,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public VippsDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -167,6 +196,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public VippsDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -201,6 +232,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -213,6 +245,7 @@ public void setSdkData(String sdkData) { */ public VippsDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -240,6 +273,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -248,6 +282,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public VippsDetails telephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set return this; } @@ -267,6 +302,7 @@ public String getTelephoneNumber() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTelephoneNumber(String telephoneNumber) { this.telephoneNumber = telephoneNumber; + isSetTelephoneNumber = true; // mark as set } /** @@ -277,6 +313,7 @@ public void setTelephoneNumber(String telephoneNumber) { */ public VippsDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -300,6 +337,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VippsDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this VippsDetails object is equal to o. */ @@ -313,22 +371,35 @@ public boolean equals(Object o) { } VippsDetails vippsDetails = (VippsDetails) o; return Objects.equals(this.checkoutAttemptId, vippsDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, vippsDetails.isSetCheckoutAttemptId) && Objects.equals(this.recurringDetailReference, vippsDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, vippsDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, vippsDetails.sdkData) + && Objects.equals(this.isSetSdkData, vippsDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, vippsDetails.storedPaymentMethodId) + && Objects.equals(this.isSetStoredPaymentMethodId, vippsDetails.isSetStoredPaymentMethodId) && Objects.equals(this.telephoneNumber, vippsDetails.telephoneNumber) - && Objects.equals(this.type, vippsDetails.type); + && Objects.equals(this.isSetTelephoneNumber, vippsDetails.isSetTelephoneNumber) + && Objects.equals(this.type, vippsDetails.type) + && Objects.equals(this.isSetType, vippsDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, + isSetStoredPaymentMethodId, telephoneNumber, - type); + isSetTelephoneNumber, + type, + isSetType); } @Override @@ -359,6 +430,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetTelephoneNumber) { + addIfNull(nulls, JSON_PROPERTY_TELEPHONE_NUMBER, this.telephoneNumber); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VippsDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java b/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java index ea3bbb9b4..9b748cd33 100644 --- a/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java +++ b/src/main/java/com/adyen/model/checkout/VisaCheckoutDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -33,6 +35,9 @@ public class VisaCheckoutDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + /** * The funding source that should be used when multiple sources are available. For Brazilian combo * cards, by default the funding source is credit. To use debit, set this value to **debit**. @@ -40,7 +45,9 @@ public class VisaCheckoutDetails { public enum FundingSourceEnum { CREDIT(String.valueOf("credit")), - DEBIT(String.valueOf("debit")); + DEBIT(String.valueOf("debit")), + + PREPAID(String.valueOf("prepaid")); private static final Logger LOG = Logger.getLogger(FundingSourceEnum.class.getName()); @@ -80,9 +87,15 @@ public static FundingSourceEnum fromValue(String value) { public static final String JSON_PROPERTY_FUNDING_SOURCE = "fundingSource"; private FundingSourceEnum fundingSource; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetFundingSource = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **visacheckout** */ public enum TypeEnum { VISACHECKOUT(String.valueOf("visacheckout")); @@ -125,9 +138,21 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + public static final String JSON_PROPERTY_VISA_CHECKOUT_CALL_ID = "visaCheckoutCallId"; private String visaCheckoutCallId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetVisaCheckoutCallId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public VisaCheckoutDetails() {} /** @@ -138,6 +163,7 @@ public VisaCheckoutDetails() {} */ public VisaCheckoutDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -161,6 +187,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -174,6 +201,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public VisaCheckoutDetails fundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set return this; } @@ -203,6 +231,7 @@ public FundingSourceEnum getFundingSource() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFundingSource(FundingSourceEnum fundingSource) { this.fundingSource = fundingSource; + isSetFundingSource = true; // mark as set } /** @@ -213,6 +242,7 @@ public void setFundingSource(FundingSourceEnum fundingSource) { */ public VisaCheckoutDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -237,6 +267,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -247,6 +278,7 @@ public void setSdkData(String sdkData) { */ public VisaCheckoutDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -270,6 +302,7 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set } /** @@ -283,6 +316,7 @@ public void setType(TypeEnum type) { */ public VisaCheckoutDetails visaCheckoutCallId(String visaCheckoutCallId) { this.visaCheckoutCallId = visaCheckoutCallId; + isSetVisaCheckoutCallId = true; // mark as set return this; } @@ -312,6 +346,27 @@ public String getVisaCheckoutCallId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVisaCheckoutCallId(String visaCheckoutCallId) { this.visaCheckoutCallId = visaCheckoutCallId; + isSetVisaCheckoutCallId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public VisaCheckoutDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this VisaCheckoutDetails object is equal to o. */ @@ -325,15 +380,31 @@ public boolean equals(Object o) { } VisaCheckoutDetails visaCheckoutDetails = (VisaCheckoutDetails) o; return Objects.equals(this.checkoutAttemptId, visaCheckoutDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, visaCheckoutDetails.isSetCheckoutAttemptId) && Objects.equals(this.fundingSource, visaCheckoutDetails.fundingSource) + && Objects.equals(this.isSetFundingSource, visaCheckoutDetails.isSetFundingSource) && Objects.equals(this.sdkData, visaCheckoutDetails.sdkData) + && Objects.equals(this.isSetSdkData, visaCheckoutDetails.isSetSdkData) && Objects.equals(this.type, visaCheckoutDetails.type) - && Objects.equals(this.visaCheckoutCallId, visaCheckoutDetails.visaCheckoutCallId); + && Objects.equals(this.isSetType, visaCheckoutDetails.isSetType) + && Objects.equals(this.visaCheckoutCallId, visaCheckoutDetails.visaCheckoutCallId) + && Objects.equals( + this.isSetVisaCheckoutCallId, visaCheckoutDetails.isSetVisaCheckoutCallId); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, fundingSource, sdkData, type, visaCheckoutCallId); + return Objects.hash( + checkoutAttemptId, + isSetCheckoutAttemptId, + fundingSource, + isSetFundingSource, + sdkData, + isSetSdkData, + type, + isSetType, + visaCheckoutCallId, + isSetVisaCheckoutCallId); } @Override @@ -359,6 +430,42 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetFundingSource) { + addIfNull(nulls, JSON_PROPERTY_FUNDING_SOURCE, this.fundingSource); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + if (isSetVisaCheckoutCallId) { + addIfNull(nulls, JSON_PROPERTY_VISA_CHECKOUT_CALL_ID, this.visaCheckoutCallId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of VisaCheckoutDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java b/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java index 765d56fb8..7ccfb02c7 100644 --- a/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java +++ b/src/main/java/com/adyen/model/checkout/WeChatPayDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -31,9 +33,15 @@ public class WeChatPayDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + /** **wechatpay** */ public enum TypeEnum { WECHATPAY(String.valueOf("wechatpay")), @@ -78,6 +86,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WeChatPayDetails() {} /** @@ -88,6 +105,7 @@ public WeChatPayDetails() {} */ public WeChatPayDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -111,6 +129,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -121,6 +140,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public WeChatPayDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -145,6 +165,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -155,6 +176,7 @@ public void setSdkData(String sdkData) { */ public WeChatPayDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -178,6 +200,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WeChatPayDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WeChatPayDetails object is equal to o. */ @@ -191,13 +234,17 @@ public boolean equals(Object o) { } WeChatPayDetails weChatPayDetails = (WeChatPayDetails) o; return Objects.equals(this.checkoutAttemptId, weChatPayDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, weChatPayDetails.isSetCheckoutAttemptId) && Objects.equals(this.sdkData, weChatPayDetails.sdkData) - && Objects.equals(this.type, weChatPayDetails.type); + && Objects.equals(this.isSetSdkData, weChatPayDetails.isSetSdkData) + && Objects.equals(this.type, weChatPayDetails.type) + && Objects.equals(this.isSetType, weChatPayDetails.isSetType); } @Override public int hashCode() { - return Objects.hash(checkoutAttemptId, sdkData, type); + return Objects.hash( + checkoutAttemptId, isSetCheckoutAttemptId, sdkData, isSetSdkData, type, isSetType); } @Override @@ -221,6 +268,36 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WeChatPayDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java b/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java index da6f0f456..507b1157e 100644 --- a/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java +++ b/src/main/java/com/adyen/model/checkout/WeChatPayMiniProgramDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -35,22 +37,40 @@ public class WeChatPayMiniProgramDetails { public static final String JSON_PROPERTY_APP_ID = "appId"; private String appId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetAppId = false; + public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_OPENID = "openid"; private String openid; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetOpenid = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **wechatpayMiniProgram** */ public enum TypeEnum { WECHATPAYMINIPROGRAM(String.valueOf("wechatpayMiniProgram")); @@ -93,6 +113,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public WeChatPayMiniProgramDetails() {} /** @@ -103,6 +132,7 @@ public WeChatPayMiniProgramDetails() {} */ public WeChatPayMiniProgramDetails appId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set return this; } @@ -126,6 +156,7 @@ public String getAppId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAppId(String appId) { this.appId = appId; + isSetAppId = true; // mark as set } /** @@ -136,6 +167,7 @@ public void setAppId(String appId) { */ public WeChatPayMiniProgramDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -159,6 +191,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -169,6 +202,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public WeChatPayMiniProgramDetails openid(String openid) { this.openid = openid; + isSetOpenid = true; // mark as set return this; } @@ -192,6 +226,7 @@ public String getOpenid() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOpenid(String openid) { this.openid = openid; + isSetOpenid = true; // mark as set } /** @@ -206,6 +241,7 @@ public void setOpenid(String openid) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public WeChatPayMiniProgramDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -237,6 +273,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -247,6 +284,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public WeChatPayMiniProgramDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -271,6 +309,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -283,6 +322,7 @@ public void setSdkData(String sdkData) { */ public WeChatPayMiniProgramDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -310,6 +350,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -320,6 +361,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public WeChatPayMiniProgramDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -343,6 +385,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public WeChatPayMiniProgramDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this WeChatPayMiniProgramDetails object is equal to o. */ @@ -356,26 +419,44 @@ public boolean equals(Object o) { } WeChatPayMiniProgramDetails weChatPayMiniProgramDetails = (WeChatPayMiniProgramDetails) o; return Objects.equals(this.appId, weChatPayMiniProgramDetails.appId) + && Objects.equals(this.isSetAppId, weChatPayMiniProgramDetails.isSetAppId) && Objects.equals(this.checkoutAttemptId, weChatPayMiniProgramDetails.checkoutAttemptId) + && Objects.equals( + this.isSetCheckoutAttemptId, weChatPayMiniProgramDetails.isSetCheckoutAttemptId) && Objects.equals(this.openid, weChatPayMiniProgramDetails.openid) + && Objects.equals(this.isSetOpenid, weChatPayMiniProgramDetails.isSetOpenid) && Objects.equals( this.recurringDetailReference, weChatPayMiniProgramDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, + weChatPayMiniProgramDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, weChatPayMiniProgramDetails.sdkData) + && Objects.equals(this.isSetSdkData, weChatPayMiniProgramDetails.isSetSdkData) && Objects.equals( this.storedPaymentMethodId, weChatPayMiniProgramDetails.storedPaymentMethodId) - && Objects.equals(this.type, weChatPayMiniProgramDetails.type); + && Objects.equals( + this.isSetStoredPaymentMethodId, weChatPayMiniProgramDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, weChatPayMiniProgramDetails.type) + && Objects.equals(this.isSetType, weChatPayMiniProgramDetails.isSetType); } @Override public int hashCode() { return Objects.hash( appId, + isSetAppId, checkoutAttemptId, + isSetCheckoutAttemptId, openid, + isSetOpenid, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -407,6 +488,48 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetAppId) { + addIfNull(nulls, JSON_PROPERTY_APP_ID, this.appId); + } + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetOpenid) { + addIfNull(nulls, JSON_PROPERTY_OPENID, this.openid); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of WeChatPayMiniProgramDetails given an JSON string * diff --git a/src/main/java/com/adyen/model/checkout/ZipDetails.java b/src/main/java/com/adyen/model/checkout/ZipDetails.java index e8b0b303e..f7253b5eb 100644 --- a/src/main/java/com/adyen/model/checkout/ZipDetails.java +++ b/src/main/java/com/adyen/model/checkout/ZipDetails.java @@ -11,7 +11,9 @@ package com.adyen.model.checkout; +import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; @@ -34,19 +36,34 @@ public class ZipDetails { public static final String JSON_PROPERTY_CHECKOUT_ATTEMPT_ID = "checkoutAttemptId"; private String checkoutAttemptId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCheckoutAttemptId = false; + public static final String JSON_PROPERTY_CLICK_AND_COLLECT = "clickAndCollect"; private String clickAndCollect; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetClickAndCollect = false; + public static final String JSON_PROPERTY_RECURRING_DETAIL_REFERENCE = "recurringDetailReference"; @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. private String recurringDetailReference; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRecurringDetailReference = false; + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; private String sdkData; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + public static final String JSON_PROPERTY_STORED_PAYMENT_METHOD_ID = "storedPaymentMethodId"; private String storedPaymentMethodId; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStoredPaymentMethodId = false; + /** **zip** */ public enum TypeEnum { ZIP(String.valueOf("zip")), @@ -91,6 +108,15 @@ public static TypeEnum fromValue(String value) { public static final String JSON_PROPERTY_TYPE = "type"; private TypeEnum type; + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + public ZipDetails() {} /** @@ -101,6 +127,7 @@ public ZipDetails() {} */ public ZipDetails checkoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set return this; } @@ -124,6 +151,7 @@ public String getCheckoutAttemptId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCheckoutAttemptId(String checkoutAttemptId) { this.checkoutAttemptId = checkoutAttemptId; + isSetCheckoutAttemptId = true; // mark as set } /** @@ -136,6 +164,7 @@ public void setCheckoutAttemptId(String checkoutAttemptId) { */ public ZipDetails clickAndCollect(String clickAndCollect) { this.clickAndCollect = clickAndCollect; + isSetClickAndCollect = true; // mark as set return this; } @@ -163,6 +192,7 @@ public String getClickAndCollect() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClickAndCollect(String clickAndCollect) { this.clickAndCollect = clickAndCollect; + isSetClickAndCollect = true; // mark as set } /** @@ -177,6 +207,7 @@ public void setClickAndCollect(String clickAndCollect) { @Deprecated // deprecated since Adyen Checkout API v49: Use `storedPaymentMethodId` instead. public ZipDetails recurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set return this; } @@ -208,6 +239,7 @@ public String getRecurringDetailReference() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRecurringDetailReference(String recurringDetailReference) { this.recurringDetailReference = recurringDetailReference; + isSetRecurringDetailReference = true; // mark as set } /** @@ -218,6 +250,7 @@ public void setRecurringDetailReference(String recurringDetailReference) { */ public ZipDetails sdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set return this; } @@ -242,6 +275,7 @@ public String getSdkData() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdkData(String sdkData) { this.sdkData = sdkData; + isSetSdkData = true; // mark as set } /** @@ -254,6 +288,7 @@ public void setSdkData(String sdkData) { */ public ZipDetails storedPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set return this; } @@ -281,6 +316,7 @@ public String getStoredPaymentMethodId() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStoredPaymentMethodId(String storedPaymentMethodId) { this.storedPaymentMethodId = storedPaymentMethodId; + isSetStoredPaymentMethodId = true; // mark as set } /** @@ -291,6 +327,7 @@ public void setStoredPaymentMethodId(String storedPaymentMethodId) { */ public ZipDetails type(TypeEnum type) { this.type = type; + isSetType = true; // mark as set return this; } @@ -314,6 +351,27 @@ public TypeEnum getType() { @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(TypeEnum type) { this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public ZipDetails includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; } /** Return true if this ZipDetails object is equal to o. */ @@ -327,22 +385,35 @@ public boolean equals(Object o) { } ZipDetails zipDetails = (ZipDetails) o; return Objects.equals(this.checkoutAttemptId, zipDetails.checkoutAttemptId) + && Objects.equals(this.isSetCheckoutAttemptId, zipDetails.isSetCheckoutAttemptId) && Objects.equals(this.clickAndCollect, zipDetails.clickAndCollect) + && Objects.equals(this.isSetClickAndCollect, zipDetails.isSetClickAndCollect) && Objects.equals(this.recurringDetailReference, zipDetails.recurringDetailReference) + && Objects.equals( + this.isSetRecurringDetailReference, zipDetails.isSetRecurringDetailReference) && Objects.equals(this.sdkData, zipDetails.sdkData) + && Objects.equals(this.isSetSdkData, zipDetails.isSetSdkData) && Objects.equals(this.storedPaymentMethodId, zipDetails.storedPaymentMethodId) - && Objects.equals(this.type, zipDetails.type); + && Objects.equals(this.isSetStoredPaymentMethodId, zipDetails.isSetStoredPaymentMethodId) + && Objects.equals(this.type, zipDetails.type) + && Objects.equals(this.isSetType, zipDetails.isSetType); } @Override public int hashCode() { return Objects.hash( checkoutAttemptId, + isSetCheckoutAttemptId, clickAndCollect, + isSetClickAndCollect, recurringDetailReference, + isSetRecurringDetailReference, sdkData, + isSetSdkData, storedPaymentMethodId, - type); + isSetStoredPaymentMethodId, + type, + isSetType); } @Override @@ -373,6 +444,45 @@ private String toIndentedString(Object o) { return o.toString().replace("\n", "\n "); } + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCheckoutAttemptId) { + addIfNull(nulls, JSON_PROPERTY_CHECKOUT_ATTEMPT_ID, this.checkoutAttemptId); + } + if (isSetClickAndCollect) { + addIfNull(nulls, JSON_PROPERTY_CLICK_AND_COLLECT, this.clickAndCollect); + } + if (isSetRecurringDetailReference) { + addIfNull(nulls, JSON_PROPERTY_RECURRING_DETAIL_REFERENCE, this.recurringDetailReference); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStoredPaymentMethodId) { + addIfNull(nulls, JSON_PROPERTY_STORED_PAYMENT_METHOD_ID, this.storedPaymentMethodId); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + /** * Create an instance of ZipDetails given an JSON string * diff --git a/src/main/java/com/adyen/service/checkout/RecurringApi.java b/src/main/java/com/adyen/service/checkout/RecurringApi.java index e6fbb7f54..2f6144aad 100644 --- a/src/main/java/com/adyen/service/checkout/RecurringApi.java +++ b/src/main/java/com/adyen/service/checkout/RecurringApi.java @@ -15,6 +15,8 @@ import com.adyen.Service; import com.adyen.constants.ApiConstants; import com.adyen.model.RequestOptions; +import com.adyen.model.checkout.CheckoutForwardRequest; +import com.adyen.model.checkout.CheckoutForwardResponse; import com.adyen.model.checkout.ListStoredPaymentMethodsResponse; import com.adyen.model.checkout.StoredPaymentMethodRequest; import com.adyen.model.checkout.StoredPaymentMethodResource; @@ -113,6 +115,37 @@ public void deleteTokenForStoredPaymentDetails( requestBody, requestOptions, ApiConstants.HttpMethod.DELETE, pathParams, queryParams); } + /** + * Forward stored payment details + * + * @param checkoutForwardRequest {@link CheckoutForwardRequest } (required) + * @return {@link CheckoutForwardResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutForwardResponse forward(CheckoutForwardRequest checkoutForwardRequest) + throws ApiException, IOException { + return forward(checkoutForwardRequest, null); + } + + /** + * Forward stored payment details + * + * @param checkoutForwardRequest {@link CheckoutForwardRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link CheckoutForwardResponse } + * @throws ApiException if fails to make API call + */ + public CheckoutForwardResponse forward( + CheckoutForwardRequest checkoutForwardRequest, RequestOptions requestOptions) + throws ApiException, IOException { + String requestBody = checkoutForwardRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/forward", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CheckoutForwardResponse.fromJson(jsonResult); + } + /** * Get tokens for stored payment details * From 47be0aa17d699a381c796e526d9fc935fddfacc6 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Fri, 12 Dec 2025 16:27:52 +0100 Subject: [PATCH 2/4] Add test --- src/test/java/com/adyen/CheckoutTest.java | 46 +++++++++++++++++++ .../mocks/checkout/forwardResponse.json | 11 +++++ 2 files changed, 57 insertions(+) create mode 100644 src/test/resources/mocks/checkout/forwardResponse.json diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index b6dc41c27..48a7d868b 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -803,4 +803,50 @@ public void testUpiQrCode() throws Exception { assertEquals( "upi_qr", paymentResponse.getAction().getCheckoutQrCodeAction().getPaymentMethodType()); } + + @Test + public void testForwardToken() throws Exception { + Client client = createMockClientFromFile("mocks/checkout/forwardResponse.json"); + RecurringApi recurringApi = new RecurringApi(client); + + Map headers = new HashMap<>(); + headers.put("Authorization", "Basic {{credentials}}"); + + CheckoutOutgoingForwardRequest outgoingForwardRequest = + new CheckoutOutgoingForwardRequest() + .httpMethod(CheckoutOutgoingForwardRequest.HttpMethodEnum.POST) + .urlSuffix("/payments") + .credentials("YOUR_CREDENTIALS_FOR_THE_THIRD_PARTY") + .headers(headers) + .body( + "{\n" + + " \"amount\": {\n" + + " \"value\": 100,\n" + + " \"currency\": \"USD\"\n" + + " },\n" + + " \"paymentMethod\": {\n" + + " \"creditCard\": {\n" + + " \"holderName\": \"{{holderName}}\",\n" + + " \"number\": \"{{number}}\",\n" + + " \"expiryMonth\": \"{{expiryMonth}}\",\n" + + " \"expiryYear\": \"{{expiryYear}}\"\n" + + " }\n" + + " }\n" + + " }"); + + CheckoutForwardRequest checkoutForwardRequest = + new CheckoutForwardRequest() + .merchantAccount("YOUR_MERCHANT_ACCOUNT") + .shopperReference("YOUR_SHOPPER_REFERENCE") + .storedPaymentMethodId("M5N7TQ4TG5PFWR50") + .baseUrl("http://thirdparty.example.com") + .request(outgoingForwardRequest); + + CheckoutForwardResponse response = recurringApi.forward(checkoutForwardRequest); + + assertEquals("PAYMENT_METHOD_ID", response.getStoredPaymentMethodId()); + assertNotNull(response.getResponse()); + assertEquals(200, (int) response.getResponse().getStatus()); + assertTrue(response.getResponse().getBody().contains("PAYMENT_METHOD_ID")); + } } diff --git a/src/test/resources/mocks/checkout/forwardResponse.json b/src/test/resources/mocks/checkout/forwardResponse.json new file mode 100644 index 000000000..bf4adf6dc --- /dev/null +++ b/src/test/resources/mocks/checkout/forwardResponse.json @@ -0,0 +1,11 @@ +{ + "pspReference": "8815658961765250", + "response": { + "body": "{\"data\": {\"tokenizeCreditCard\": {\"paymentMethod\": {\"id\": \"PAYMENT_METHOD_ID\"}}}}", + "headers": { + "Content-Type": "application/json" + }, + "status": 200 + }, + "storedPaymentMethodId": "PAYMENT_METHOD_ID" +} \ No newline at end of file From 476c96aca869523c054b190e1a5307cd7b226c44 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Tue, 16 Dec 2025 09:48:58 +0100 Subject: [PATCH 3/4] Generate models to support forward cards --- .../checkout/CheckoutForwardRequest.java | 50 ++ .../checkout/CheckoutForwardRequestCard.java | 733 ++++++++++++++++++ .../CheckoutForwardRequestOptions.java | 74 ++ 3 files changed, 857 insertions(+) create mode 100644 src/main/java/com/adyen/model/checkout/CheckoutForwardRequestCard.java diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java index 8e2c0da30..2f6c0cc86 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequest.java @@ -24,6 +24,7 @@ CheckoutForwardRequest.JSON_PROPERTY_BASE_URL, CheckoutForwardRequest.JSON_PROPERTY_MERCHANT_ACCOUNT, CheckoutForwardRequest.JSON_PROPERTY_OPTIONS, + CheckoutForwardRequest.JSON_PROPERTY_PAYMENT_METHOD, CheckoutForwardRequest.JSON_PROPERTY_REQUEST, CheckoutForwardRequest.JSON_PROPERTY_SHOPPER_REFERENCE, CheckoutForwardRequest.JSON_PROPERTY_STORED_PAYMENT_METHOD_ID @@ -47,6 +48,12 @@ public class CheckoutForwardRequest { /** Mark when the attribute has been explicitly set. */ private boolean isSetOptions = false; + public static final String JSON_PROPERTY_PAYMENT_METHOD = "paymentMethod"; + private CheckoutForwardRequestCard paymentMethod; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPaymentMethod = false; + public static final String JSON_PROPERTY_REQUEST = "request"; private CheckoutOutgoingForwardRequest request; @@ -184,6 +191,41 @@ public void setOptions(CheckoutForwardRequestOptions options) { isSetOptions = true; // mark as set } + /** + * paymentMethod + * + * @param paymentMethod + * @return the current {@code CheckoutForwardRequest} instance, allowing for method chaining + */ + public CheckoutForwardRequest paymentMethod(CheckoutForwardRequestCard paymentMethod) { + this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set + return this; + } + + /** + * Get paymentMethod + * + * @return paymentMethod + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CheckoutForwardRequestCard getPaymentMethod() { + return paymentMethod; + } + + /** + * paymentMethod + * + * @param paymentMethod + */ + @JsonProperty(JSON_PROPERTY_PAYMENT_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPaymentMethod(CheckoutForwardRequestCard paymentMethod) { + this.paymentMethod = paymentMethod; + isSetPaymentMethod = true; // mark as set + } + /** * request * @@ -349,6 +391,8 @@ public boolean equals(Object o) { && Objects.equals(this.isSetMerchantAccount, checkoutForwardRequest.isSetMerchantAccount) && Objects.equals(this.options, checkoutForwardRequest.options) && Objects.equals(this.isSetOptions, checkoutForwardRequest.isSetOptions) + && Objects.equals(this.paymentMethod, checkoutForwardRequest.paymentMethod) + && Objects.equals(this.isSetPaymentMethod, checkoutForwardRequest.isSetPaymentMethod) && Objects.equals(this.request, checkoutForwardRequest.request) && Objects.equals(this.isSetRequest, checkoutForwardRequest.isSetRequest) && Objects.equals(this.shopperReference, checkoutForwardRequest.shopperReference) @@ -367,6 +411,8 @@ public int hashCode() { isSetMerchantAccount, options, isSetOptions, + paymentMethod, + isSetPaymentMethod, request, isSetRequest, shopperReference, @@ -382,6 +428,7 @@ public String toString() { sb.append(" baseUrl: ").append(toIndentedString(baseUrl)).append("\n"); sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" paymentMethod: ").append(toIndentedString(paymentMethod)).append("\n"); sb.append(" request: ").append(toIndentedString(request)).append("\n"); sb.append(" shopperReference: ").append(toIndentedString(shopperReference)).append("\n"); sb.append(" storedPaymentMethodId: ") @@ -420,6 +467,9 @@ public Map getExplicitNulls() { if (isSetOptions) { addIfNull(nulls, JSON_PROPERTY_OPTIONS, this.options); } + if (isSetPaymentMethod) { + addIfNull(nulls, JSON_PROPERTY_PAYMENT_METHOD, this.paymentMethod); + } if (isSetRequest) { addIfNull(nulls, JSON_PROPERTY_REQUEST, this.request); } diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestCard.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestCard.java new file mode 100644 index 000000000..43e12f293 --- /dev/null +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestCard.java @@ -0,0 +1,733 @@ +/* + * Adyen Checkout API + * + * The version of the OpenAPI document: 71 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +package com.adyen.model.checkout; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.Arrays; +import java.util.logging.Logger; + +/** CheckoutForwardRequestCard */ +@JsonPropertyOrder({ + CheckoutForwardRequestCard.JSON_PROPERTY_CVC, + CheckoutForwardRequestCard.JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, + CheckoutForwardRequestCard.JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, + CheckoutForwardRequestCard.JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, + CheckoutForwardRequestCard.JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, + CheckoutForwardRequestCard.JSON_PROPERTY_EXPIRY_MONTH, + CheckoutForwardRequestCard.JSON_PROPERTY_EXPIRY_YEAR, + CheckoutForwardRequestCard.JSON_PROPERTY_HOLDER_NAME, + CheckoutForwardRequestCard.JSON_PROPERTY_NUMBER, + CheckoutForwardRequestCard.JSON_PROPERTY_TYPE +}) +public class CheckoutForwardRequestCard { + public static final String JSON_PROPERTY_CVC = "cvc"; + private String cvc; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCvc = false; + + public static final String JSON_PROPERTY_ENCRYPTED_CARD_NUMBER = "encryptedCardNumber"; + private String encryptedCardNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedCardNumber = false; + + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH = "encryptedExpiryMonth"; + private String encryptedExpiryMonth; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryMonth = false; + + public static final String JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR = "encryptedExpiryYear"; + private String encryptedExpiryYear; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedExpiryYear = false; + + public static final String JSON_PROPERTY_ENCRYPTED_SECURITY_CODE = "encryptedSecurityCode"; + private String encryptedSecurityCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEncryptedSecurityCode = false; + + public static final String JSON_PROPERTY_EXPIRY_MONTH = "expiryMonth"; + private String expiryMonth; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryMonth = false; + + public static final String JSON_PROPERTY_EXPIRY_YEAR = "expiryYear"; + private String expiryYear; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetExpiryYear = false; + + public static final String JSON_PROPERTY_HOLDER_NAME = "holderName"; + private String holderName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetHolderName = false; + + public static final String JSON_PROPERTY_NUMBER = "number"; + private String number; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNumber = false; + + /** + * Default payment method details. Common for scheme payment methods, and for simple payment + * method details. + */ + public enum TypeEnum { + SCHEME(String.valueOf("scheme")); + + private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName()); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + // handling unexpected value + LOG.warning( + "TypeEnum: unexpected enum value '" + + value + + "' - Supported values are " + + Arrays.toString(TypeEnum.values())); + return null; + } + } + + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CheckoutForwardRequestCard() {} + + /** + * The [card verification + * code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) + * (1-20 characters). Depending on the card brand, it is also known as: * CVV2/CVC2 – length: 3 + * digits * CID – length: 4 digits + * + * @param cvc The [card verification + * code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) + * (1-20 characters). Depending on the card brand, it is also known as: * CVV2/CVC2 – length: + * 3 digits * CID – length: 4 digits + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard cvc(String cvc) { + this.cvc = cvc; + isSetCvc = true; // mark as set + return this; + } + + /** + * The [card verification + * code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) + * (1-20 characters). Depending on the card brand, it is also known as: * CVV2/CVC2 – length: 3 + * digits * CID – length: 4 digits + * + * @return cvc The [card verification + * code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) + * (1-20 characters). Depending on the card brand, it is also known as: * CVV2/CVC2 – length: + * 3 digits * CID – length: 4 digits + */ + @JsonProperty(JSON_PROPERTY_CVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCvc() { + return cvc; + } + + /** + * The [card verification + * code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) + * (1-20 characters). Depending on the card brand, it is also known as: * CVV2/CVC2 – length: 3 + * digits * CID – length: 4 digits + * + * @param cvc The [card verification + * code](https://docs.adyen.com/payments-fundamentals/payment-glossary#card-security-code-cvc-cvv-cid) + * (1-20 characters). Depending on the card brand, it is also known as: * CVV2/CVC2 – length: + * 3 digits * CID – length: 4 digits + */ + @JsonProperty(JSON_PROPERTY_CVC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCvc(String cvc) { + this.cvc = cvc; + isSetCvc = true; // mark as set + } + + /** + * The encrypted card number. + * + * @param encryptedCardNumber The encrypted card number. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard encryptedCardNumber(String encryptedCardNumber) { + this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set + return this; + } + + /** + * The encrypted card number. + * + * @return encryptedCardNumber The encrypted card number. + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_CARD_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncryptedCardNumber() { + return encryptedCardNumber; + } + + /** + * The encrypted card number. + * + * @param encryptedCardNumber The encrypted card number. + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_CARD_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncryptedCardNumber(String encryptedCardNumber) { + this.encryptedCardNumber = encryptedCardNumber; + isSetEncryptedCardNumber = true; // mark as set + } + + /** + * The encrypted expiryMonth + * + * @param encryptedExpiryMonth The encrypted expiryMonth + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard encryptedExpiryMonth(String encryptedExpiryMonth) { + this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set + return this; + } + + /** + * The encrypted expiryMonth + * + * @return encryptedExpiryMonth The encrypted expiryMonth + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncryptedExpiryMonth() { + return encryptedExpiryMonth; + } + + /** + * The encrypted expiryMonth + * + * @param encryptedExpiryMonth The encrypted expiryMonth + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncryptedExpiryMonth(String encryptedExpiryMonth) { + this.encryptedExpiryMonth = encryptedExpiryMonth; + isSetEncryptedExpiryMonth = true; // mark as set + } + + /** + * The encrypted card expiry year. + * + * @param encryptedExpiryYear The encrypted card expiry year. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard encryptedExpiryYear(String encryptedExpiryYear) { + this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set + return this; + } + + /** + * The encrypted card expiry year. + * + * @return encryptedExpiryYear The encrypted card expiry year. + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncryptedExpiryYear() { + return encryptedExpiryYear; + } + + /** + * The encrypted card expiry year. + * + * @param encryptedExpiryYear The encrypted card expiry year. + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncryptedExpiryYear(String encryptedExpiryYear) { + this.encryptedExpiryYear = encryptedExpiryYear; + isSetEncryptedExpiryYear = true; // mark as set + } + + /** + * The encrypted security code. + * + * @param encryptedSecurityCode The encrypted security code. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard encryptedSecurityCode(String encryptedSecurityCode) { + this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set + return this; + } + + /** + * The encrypted security code. + * + * @return encryptedSecurityCode The encrypted security code. + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_SECURITY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEncryptedSecurityCode() { + return encryptedSecurityCode; + } + + /** + * The encrypted security code. + * + * @param encryptedSecurityCode The encrypted security code. + */ + @JsonProperty(JSON_PROPERTY_ENCRYPTED_SECURITY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEncryptedSecurityCode(String encryptedSecurityCode) { + this.encryptedSecurityCode = encryptedSecurityCode; + isSetEncryptedSecurityCode = true; // mark as set + } + + /** + * The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 + * = March * 11 = November + * + * @param expiryMonth The card expiry month. Format: 2 digits, zero-padded for single digits. For + * example: * 03 = March * 11 = November + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard expiryMonth(String expiryMonth) { + this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set + return this; + } + + /** + * The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 + * = March * 11 = November + * + * @return expiryMonth The card expiry month. Format: 2 digits, zero-padded for single digits. For + * example: * 03 = March * 11 = November + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiryMonth() { + return expiryMonth; + } + + /** + * The card expiry month. Format: 2 digits, zero-padded for single digits. For example: * 03 + * = March * 11 = November + * + * @param expiryMonth The card expiry month. Format: 2 digits, zero-padded for single digits. For + * example: * 03 = March * 11 = November + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_MONTH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryMonth(String expiryMonth) { + this.expiryMonth = expiryMonth; + isSetExpiryMonth = true; // mark as set + } + + /** + * The card expiry year. + * + * @param expiryYear The card expiry year. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard expiryYear(String expiryYear) { + this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set + return this; + } + + /** + * The card expiry year. + * + * @return expiryYear The card expiry year. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getExpiryYear() { + return expiryYear; + } + + /** + * The card expiry year. + * + * @param expiryYear The card expiry year. + */ + @JsonProperty(JSON_PROPERTY_EXPIRY_YEAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setExpiryYear(String expiryYear) { + this.expiryYear = expiryYear; + isSetExpiryYear = true; // mark as set + } + + /** + * The name of the cardholder. + * + * @param holderName The name of the cardholder. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard holderName(String holderName) { + this.holderName = holderName; + isSetHolderName = true; // mark as set + return this; + } + + /** + * The name of the cardholder. + * + * @return holderName The name of the cardholder. + */ + @JsonProperty(JSON_PROPERTY_HOLDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHolderName() { + return holderName; + } + + /** + * The name of the cardholder. + * + * @param holderName The name of the cardholder. + */ + @JsonProperty(JSON_PROPERTY_HOLDER_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHolderName(String holderName) { + this.holderName = holderName; + isSetHolderName = true; // mark as set + } + + /** + * The card number. Only collect raw card data if you are fully [PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Format: Do + * not use separators. + * + * @param number The card number. Only collect raw card data if you are fully [PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Format: + * Do not use separators. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard number(String number) { + this.number = number; + isSetNumber = true; // mark as set + return this; + } + + /** + * The card number. Only collect raw card data if you are fully [PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Format: Do + * not use separators. + * + * @return number The card number. Only collect raw card data if you are fully [PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Format: + * Do not use separators. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNumber() { + return number; + } + + /** + * The card number. Only collect raw card data if you are fully [PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Format: Do + * not use separators. + * + * @param number The card number. Only collect raw card data if you are fully [PCI + * compliant](https://docs.adyen.com/development-resources/pci-dss-compliance-guide). Format: + * Do not use separators. + */ + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNumber(String number) { + this.number = number; + isSetNumber = true; // mark as set + } + + /** + * Default payment method details. Common for scheme payment methods, and for simple payment + * method details. + * + * @param type Default payment method details. Common for scheme payment methods, and for simple + * payment method details. + * @return the current {@code CheckoutForwardRequestCard} instance, allowing for method chaining + */ + public CheckoutForwardRequestCard type(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * Default payment method details. Common for scheme payment methods, and for simple payment + * method details. + * + * @return type Default payment method details. Common for scheme payment methods, and for simple + * payment method details. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + /** + * Default payment method details. Common for scheme payment methods, and for simple payment + * method details. + * + * @param type Default payment method details. Common for scheme payment methods, and for simple + * payment method details. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CheckoutForwardRequestCard includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CheckoutForwardRequestCard object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckoutForwardRequestCard checkoutForwardRequestCard = (CheckoutForwardRequestCard) o; + return Objects.equals(this.cvc, checkoutForwardRequestCard.cvc) + && Objects.equals(this.isSetCvc, checkoutForwardRequestCard.isSetCvc) + && Objects.equals(this.encryptedCardNumber, checkoutForwardRequestCard.encryptedCardNumber) + && Objects.equals( + this.isSetEncryptedCardNumber, checkoutForwardRequestCard.isSetEncryptedCardNumber) + && Objects.equals( + this.encryptedExpiryMonth, checkoutForwardRequestCard.encryptedExpiryMonth) + && Objects.equals( + this.isSetEncryptedExpiryMonth, checkoutForwardRequestCard.isSetEncryptedExpiryMonth) + && Objects.equals(this.encryptedExpiryYear, checkoutForwardRequestCard.encryptedExpiryYear) + && Objects.equals( + this.isSetEncryptedExpiryYear, checkoutForwardRequestCard.isSetEncryptedExpiryYear) + && Objects.equals( + this.encryptedSecurityCode, checkoutForwardRequestCard.encryptedSecurityCode) + && Objects.equals( + this.isSetEncryptedSecurityCode, checkoutForwardRequestCard.isSetEncryptedSecurityCode) + && Objects.equals(this.expiryMonth, checkoutForwardRequestCard.expiryMonth) + && Objects.equals(this.isSetExpiryMonth, checkoutForwardRequestCard.isSetExpiryMonth) + && Objects.equals(this.expiryYear, checkoutForwardRequestCard.expiryYear) + && Objects.equals(this.isSetExpiryYear, checkoutForwardRequestCard.isSetExpiryYear) + && Objects.equals(this.holderName, checkoutForwardRequestCard.holderName) + && Objects.equals(this.isSetHolderName, checkoutForwardRequestCard.isSetHolderName) + && Objects.equals(this.number, checkoutForwardRequestCard.number) + && Objects.equals(this.isSetNumber, checkoutForwardRequestCard.isSetNumber) + && Objects.equals(this.type, checkoutForwardRequestCard.type) + && Objects.equals(this.isSetType, checkoutForwardRequestCard.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + cvc, + isSetCvc, + encryptedCardNumber, + isSetEncryptedCardNumber, + encryptedExpiryMonth, + isSetEncryptedExpiryMonth, + encryptedExpiryYear, + isSetEncryptedExpiryYear, + encryptedSecurityCode, + isSetEncryptedSecurityCode, + expiryMonth, + isSetExpiryMonth, + expiryYear, + isSetExpiryYear, + holderName, + isSetHolderName, + number, + isSetNumber, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckoutForwardRequestCard {\n"); + sb.append(" cvc: ").append(toIndentedString(cvc)).append("\n"); + sb.append(" encryptedCardNumber: ") + .append(toIndentedString(encryptedCardNumber)) + .append("\n"); + sb.append(" encryptedExpiryMonth: ") + .append(toIndentedString(encryptedExpiryMonth)) + .append("\n"); + sb.append(" encryptedExpiryYear: ") + .append(toIndentedString(encryptedExpiryYear)) + .append("\n"); + sb.append(" encryptedSecurityCode: ") + .append(toIndentedString(encryptedSecurityCode)) + .append("\n"); + sb.append(" expiryMonth: ").append(toIndentedString(expiryMonth)).append("\n"); + sb.append(" expiryYear: ").append(toIndentedString(expiryYear)).append("\n"); + sb.append(" holderName: ").append(toIndentedString(holderName)).append("\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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCvc) { + addIfNull(nulls, JSON_PROPERTY_CVC, this.cvc); + } + if (isSetEncryptedCardNumber) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_CARD_NUMBER, this.encryptedCardNumber); + } + if (isSetEncryptedExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_MONTH, this.encryptedExpiryMonth); + } + if (isSetEncryptedExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_EXPIRY_YEAR, this.encryptedExpiryYear); + } + if (isSetEncryptedSecurityCode) { + addIfNull(nulls, JSON_PROPERTY_ENCRYPTED_SECURITY_CODE, this.encryptedSecurityCode); + } + if (isSetExpiryMonth) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_MONTH, this.expiryMonth); + } + if (isSetExpiryYear) { + addIfNull(nulls, JSON_PROPERTY_EXPIRY_YEAR, this.expiryYear); + } + if (isSetHolderName) { + addIfNull(nulls, JSON_PROPERTY_HOLDER_NAME, this.holderName); + } + if (isSetNumber) { + addIfNull(nulls, JSON_PROPERTY_NUMBER, this.number); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CheckoutForwardRequestCard given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckoutForwardRequestCard + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CheckoutForwardRequestCard + */ + public static CheckoutForwardRequestCard fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CheckoutForwardRequestCard.class); + } + + /** + * Convert an instance of CheckoutForwardRequestCard to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java index 3f6c471d2..7f876d620 100644 --- a/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java +++ b/src/main/java/com/adyen/model/checkout/CheckoutForwardRequestOptions.java @@ -18,12 +18,15 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.core.JsonProcessingException; import java.util.*; +import java.util.ArrayList; +import java.util.List; /** CheckoutForwardRequestOptions */ @JsonPropertyOrder({ CheckoutForwardRequestOptions.JSON_PROPERTY_ACCOUNT_UPDATE, CheckoutForwardRequestOptions.JSON_PROPERTY_DRY_RUN, CheckoutForwardRequestOptions.JSON_PROPERTY_NETWORK_TOKEN, + CheckoutForwardRequestOptions.JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS, CheckoutForwardRequestOptions.JSON_PROPERTY_TOKENIZE }) public class CheckoutForwardRequestOptions { @@ -45,6 +48,12 @@ public class CheckoutForwardRequestOptions { /** Mark when the attribute has been explicitly set. */ private boolean isSetNetworkToken = false; + public static final String JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS = "networkTxReferencePaths"; + private List networkTxReferencePaths; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetNetworkTxReferencePaths = false; + public static final String JSON_PROPERTY_TOKENIZE = "tokenize"; private Boolean tokenize; @@ -179,6 +188,58 @@ public void setNetworkToken(CheckoutNetworkTokenOption networkToken) { isSetNetworkToken = true; // mark as set } + /** + * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of + * networkTxReference in the incoming 3rd party response + * + * @param networkTxReferencePaths Set in tokenize:true case when forwarding PAN. Addresses to the + * possible location(s) of networkTxReference in the incoming 3rd party response + * @return the current {@code CheckoutForwardRequestOptions} instance, allowing for method + * chaining + */ + public CheckoutForwardRequestOptions networkTxReferencePaths( + List networkTxReferencePaths) { + this.networkTxReferencePaths = networkTxReferencePaths; + isSetNetworkTxReferencePaths = true; // mark as set + return this; + } + + public CheckoutForwardRequestOptions addNetworkTxReferencePathsItem( + String networkTxReferencePathsItem) { + if (this.networkTxReferencePaths == null) { + this.networkTxReferencePaths = new ArrayList<>(); + } + this.networkTxReferencePaths.add(networkTxReferencePathsItem); + return this; + } + + /** + * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of + * networkTxReference in the incoming 3rd party response + * + * @return networkTxReferencePaths Set in tokenize:true case when forwarding PAN. Addresses to the + * possible location(s) of networkTxReference in the incoming 3rd party response + */ + @JsonProperty(JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNetworkTxReferencePaths() { + return networkTxReferencePaths; + } + + /** + * Set in tokenize:true case when forwarding PAN. Addresses to the possible location(s) of + * networkTxReference in the incoming 3rd party response + * + * @param networkTxReferencePaths Set in tokenize:true case when forwarding PAN. Addresses to the + * possible location(s) of networkTxReference in the incoming 3rd party response + */ + @JsonProperty(JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNetworkTxReferencePaths(List networkTxReferencePaths) { + this.networkTxReferencePaths = networkTxReferencePaths; + isSetNetworkTxReferencePaths = true; // mark as set + } + /** * Set to **true**, the payment details are * [tokenized](https://docs.adyen.com/online-payments/tokenization). @@ -257,6 +318,11 @@ public boolean equals(Object o) { && Objects.equals(this.isSetDryRun, checkoutForwardRequestOptions.isSetDryRun) && Objects.equals(this.networkToken, checkoutForwardRequestOptions.networkToken) && Objects.equals(this.isSetNetworkToken, checkoutForwardRequestOptions.isSetNetworkToken) + && Objects.equals( + this.networkTxReferencePaths, checkoutForwardRequestOptions.networkTxReferencePaths) + && Objects.equals( + this.isSetNetworkTxReferencePaths, + checkoutForwardRequestOptions.isSetNetworkTxReferencePaths) && Objects.equals(this.tokenize, checkoutForwardRequestOptions.tokenize) && Objects.equals(this.isSetTokenize, checkoutForwardRequestOptions.isSetTokenize); } @@ -270,6 +336,8 @@ public int hashCode() { isSetDryRun, networkToken, isSetNetworkToken, + networkTxReferencePaths, + isSetNetworkTxReferencePaths, tokenize, isSetTokenize); } @@ -281,6 +349,9 @@ public String toString() { sb.append(" accountUpdate: ").append(toIndentedString(accountUpdate)).append("\n"); sb.append(" dryRun: ").append(toIndentedString(dryRun)).append("\n"); sb.append(" networkToken: ").append(toIndentedString(networkToken)).append("\n"); + sb.append(" networkTxReferencePaths: ") + .append(toIndentedString(networkTxReferencePaths)) + .append("\n"); sb.append(" tokenize: ").append(toIndentedString(tokenize)).append("\n"); sb.append("}"); return sb.toString(); @@ -315,6 +386,9 @@ public Map getExplicitNulls() { if (isSetNetworkToken) { addIfNull(nulls, JSON_PROPERTY_NETWORK_TOKEN, this.networkToken); } + if (isSetNetworkTxReferencePaths) { + addIfNull(nulls, JSON_PROPERTY_NETWORK_TX_REFERENCE_PATHS, this.networkTxReferencePaths); + } if (isSetTokenize) { addIfNull(nulls, JSON_PROPERTY_TOKENIZE, this.tokenize); } From 21cb1734b8ccf35b50bcc4db4b0c97f7d4373359 Mon Sep 17 00:00:00 2001 From: gcatanese Date: Tue, 16 Dec 2025 10:07:16 +0100 Subject: [PATCH 4/4] Add test for forward cards --- src/test/java/com/adyen/CheckoutTest.java | 45 +++++++++++++++++++ .../checkout/forwardCardDetailsResponse.json | 7 +++ 2 files changed, 52 insertions(+) create mode 100644 src/test/resources/mocks/checkout/forwardCardDetailsResponse.json diff --git a/src/test/java/com/adyen/CheckoutTest.java b/src/test/java/com/adyen/CheckoutTest.java index 48a7d868b..b81e95531 100644 --- a/src/test/java/com/adyen/CheckoutTest.java +++ b/src/test/java/com/adyen/CheckoutTest.java @@ -849,4 +849,49 @@ public void testForwardToken() throws Exception { assertEquals(200, (int) response.getResponse().getStatus()); assertTrue(response.getResponse().getBody().contains("PAYMENT_METHOD_ID")); } + + @Test + public void testForwardCardDetails() throws Exception { + Client client = createMockClientFromFile("mocks/checkout/forwardCardDetailsResponse.json"); + RecurringApi recurringApi = new RecurringApi(client); + + Map headers = new HashMap<>(); + headers.put("Authorization", "Basic {{credentials}}"); + + CheckoutOutgoingForwardRequest outgoingForwardRequest = + new CheckoutOutgoingForwardRequest() + .httpMethod(CheckoutOutgoingForwardRequest.HttpMethodEnum.POST) + .urlSuffix("/payments") + .credentials("YOUR_CREDENTIALS_FOR_THE_THIRD_PARTY") + .headers(headers) + .body( + "{\n" + + " \"amount\": {\n" + + " \"value\": 100,\n" + + " \"currency\": \"USD\"\n" + + " }\n" + + " }"); + + CheckoutForwardRequest checkoutForwardRequest = + new CheckoutForwardRequest() + .merchantAccount("YOUR_MERCHANT_ACCOUNT") + .shopperReference("YOUR_SHOPPER_REFERENCE") + .paymentMethod( + new CheckoutForwardRequestCard() + .type(CheckoutForwardRequestCard.TypeEnum.SCHEME) + .number("4111111111111111") + .expiryMonth("03") + .expiryYear("2030") + .cvc("737") + .holderName("S. Hopper")) + .baseUrl("http://thirdparty.example.com") + .request(outgoingForwardRequest); + + CheckoutForwardResponse response = recurringApi.forward(checkoutForwardRequest); + + assertNull(response.getStoredPaymentMethodId()); // card is not tokenized + assertNotNull(response.getResponse()); + assertEquals(200, (int) response.getResponse().getStatus()); + assertTrue(response.getResponse().getBody().contains("PAYMENT_METHOD_ID")); + } } diff --git a/src/test/resources/mocks/checkout/forwardCardDetailsResponse.json b/src/test/resources/mocks/checkout/forwardCardDetailsResponse.json new file mode 100644 index 000000000..f3f6159da --- /dev/null +++ b/src/test/resources/mocks/checkout/forwardCardDetailsResponse.json @@ -0,0 +1,7 @@ +{ + "pspReference": "8815658961765250", + "response": { + "status": 200, + "body": "{\"success\": \"ok\",\"data\": {\"tokenizeCreditCard\": {\"paymentMethod\": {\"id\": \"PAYMENT_METHOD_ID\"}}}}" + } +}