Skip to content

Commit

Permalink
false[adyen-sdk-automation] automated change
Browse files Browse the repository at this point in the history
  • Loading branch information
AdyenAutomationBot committed Nov 29, 2024
1 parent 36684da commit 8ffe278
Show file tree
Hide file tree
Showing 20 changed files with 2,343 additions and 106 deletions.
16 changes: 8 additions & 8 deletions src/main/java/com/adyen/model/checkout/Amount.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Amount() {
}

/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
*
* @param currency
* @return the current {@code Amount} instance, allowing for method chaining
Expand All @@ -57,18 +57,18 @@ public Amount currency(String currency) {
}

/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
* @return currency
*/
@ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).")
@ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).")
@JsonProperty(JSON_PROPERTY_CURRENCY)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getCurrency() {
return currency;
}

/**
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes#currency-codes).
*
* @param currency
*/
Expand All @@ -79,7 +79,7 @@ public void setCurrency(String currency) {
}

/**
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
*
* @param value
* @return the current {@code Amount} instance, allowing for method chaining
Expand All @@ -90,18 +90,18 @@ public Amount value(Long value) {
}

/**
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
* @return value
*/
@ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).")
@ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).")
@JsonProperty(JSON_PROPERTY_VALUE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getValue() {
return value;
}

/**
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes#minor-units).
*
* @param value
*/
Expand Down
60 changes: 56 additions & 4 deletions src/main/java/com/adyen/model/checkout/CheckoutPaymentMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import com.adyen.model.checkout.PayUUpiDetails;
import com.adyen.model.checkout.PayWithGoogleDetails;
import com.adyen.model.checkout.PaymentDetails;
import com.adyen.model.checkout.PseDetails;
import com.adyen.model.checkout.RatepayDetails;
import com.adyen.model.checkout.RivertyDetails;
import com.adyen.model.checkout.SamsungPayDetails;
Expand Down Expand Up @@ -1120,6 +1121,34 @@ public CheckoutPaymentMethod deserialize(JsonParser jp, DeserializationContext c
}


// deserialize PseDetails
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (PseDetails.class.equals(Integer.class) || PseDetails.class.equals(Long.class) || PseDetails.class.equals(Float.class) || PseDetails.class.equals(Double.class) || PseDetails.class.equals(Boolean.class) || PseDetails.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((PseDetails.class.equals(Integer.class) || PseDetails.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((PseDetails.class.equals(Float.class) || PseDetails.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (PseDetails.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (PseDetails.class.equals(String.class) && token == JsonToken.VALUE_STRING);
}
}
// Checks if the unique type of the oneOf json matches any of the object TypeEnum values
boolean typeMatch = Arrays.stream(PseDetails.TypeEnum.values()).anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText()));
if (attemptParsing || typeMatch) {
// Strict deserialization for oneOf models
deserialized = JSON.getMapper().readValue(tree.toString(), PseDetails.class);
// typeMatch should enforce proper deserialization
match++;
log.log(Level.FINER, "Input data matches schema 'PseDetails'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'PseDetails'", e);
}


// deserialize RatepayDetails
try {
boolean attemptParsing = true;
Expand Down Expand Up @@ -1688,6 +1717,11 @@ public CheckoutPaymentMethod(PaymentDetails o) {
setActualInstance(o);
}

public CheckoutPaymentMethod(PseDetails o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}

public CheckoutPaymentMethod(RatepayDetails o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
Expand Down Expand Up @@ -1824,6 +1858,8 @@ public CheckoutPaymentMethod(ZipDetails o) {
});
schemas.put("PaymentDetails", new GenericType<PaymentDetails>() {
});
schemas.put("PseDetails", new GenericType<PseDetails>() {
});
schemas.put("RatepayDetails", new GenericType<RatepayDetails>() {
});
schemas.put("RivertyDetails", new GenericType<RivertyDetails>() {
Expand Down Expand Up @@ -1861,7 +1897,7 @@ public Map<String, GenericType> getSchemas() {
/**
* Set the instance that matches the oneOf child schema, check
* the instance parameter is valid against the oneOf child schemas:
* AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails
* AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PseDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, 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).
Expand Down Expand Up @@ -2043,6 +2079,11 @@ public void setActualInstance(Object instance) {
return;
}

if (JSON.isInstanceOf(PseDetails.class, instance, new HashSet<Class<?>>())) {
super.setActualInstance(instance);
return;
}

if (JSON.isInstanceOf(RatepayDetails.class, instance, new HashSet<Class<?>>())) {
super.setActualInstance(instance);
return;
Expand Down Expand Up @@ -2108,14 +2149,14 @@ public void setActualInstance(Object instance) {
return;
}

throw new RuntimeException("Invalid instance type. Must be AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails");
throw new RuntimeException("Invalid instance type. Must be AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PseDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails");
}

/**
* Get the actual instance, which can be the following:
* AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails
* AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PseDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails
*
* @return The actual instance (AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails)
* @return The actual instance (AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EBankingFinlandDetails, EcontextVoucherDetails, EftDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayByBankAISDirectDebitDetails, PayByBankDetails, PayPalDetails, PayToDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, PseDetails, RatepayDetails, RivertyDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, TwintDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails)
*/
@Override
public Object getActualInstance() {
Expand Down Expand Up @@ -2507,6 +2548,17 @@ public PaymentDetails getPaymentDetails() throws ClassCastException {
return (PaymentDetails)super.getActualInstance();
}

/**
* Get the actual instance of `PseDetails`. If the actual instance is not `PseDetails`,
* the ClassCastException will be thrown.
*
* @return The actual instance of `PseDetails`
* @throws ClassCastException if the instance is not `PseDetails`
*/
public PseDetails getPseDetails() throws ClassCastException {
return (PseDetails)super.getActualInstance();
}

/**
* Get the actual instance of `RatepayDetails`. If the actual instance is not `RatepayDetails`,
* the ClassCastException will be thrown.
Expand Down
Loading

0 comments on commit 8ffe278

Please sign in to comment.