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 Apr 5, 2024
1 parent 0e4330f commit 63ea306
Show file tree
Hide file tree
Showing 9 changed files with 615 additions and 62 deletions.
459 changes: 459 additions & 0 deletions src/main/java/com/adyen/model/checkout/CashAppDetails.java

Large diffs are not rendered by default.

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 @@ -26,6 +26,7 @@
import com.adyen.model.checkout.BillDeskDetails;
import com.adyen.model.checkout.BlikDetails;
import com.adyen.model.checkout.CardDetails;
import com.adyen.model.checkout.CashAppDetails;
import com.adyen.model.checkout.CellulantDetails;
import com.adyen.model.checkout.DokuDetails;
import com.adyen.model.checkout.DotpayDetails;
Expand Down Expand Up @@ -412,6 +413,34 @@ public CheckoutPaymentMethod deserialize(JsonParser jp, DeserializationContext c
}


// deserialize CashAppDetails
try {
boolean attemptParsing = true;
// ensure that we respect type coercion as set on the client ObjectMapper
if (CashAppDetails.class.equals(Integer.class) || CashAppDetails.class.equals(Long.class) || CashAppDetails.class.equals(Float.class) || CashAppDetails.class.equals(Double.class) || CashAppDetails.class.equals(Boolean.class) || CashAppDetails.class.equals(String.class)) {
attemptParsing = typeCoercion;
if (!attemptParsing) {
attemptParsing |= ((CashAppDetails.class.equals(Integer.class) || CashAppDetails.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT);
attemptParsing |= ((CashAppDetails.class.equals(Float.class) || CashAppDetails.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT);
attemptParsing |= (CashAppDetails.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));
attemptParsing |= (CashAppDetails.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(CashAppDetails.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(), CashAppDetails.class);
// typeMatch should enforce proper deserialization
match++;
log.log(Level.FINER, "Input data matches schema 'CashAppDetails'");
}
} catch (Exception e) {
// deserialization failed, continue
log.log(Level.FINER, "Input data does not match schema 'CashAppDetails'", e);
}


// deserialize CellulantDetails
try {
boolean attemptParsing = true;
Expand Down Expand Up @@ -1331,6 +1360,11 @@ public CheckoutPaymentMethod(CardDetails o) {
setActualInstance(o);
}

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

public CheckoutPaymentMethod(CellulantDetails o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
Expand Down Expand Up @@ -1502,6 +1536,8 @@ public CheckoutPaymentMethod(ZipDetails o) {
});
schemas.put("CardDetails", new GenericType<CardDetails>() {
});
schemas.put("CashAppDetails", new GenericType<CashAppDetails>() {
});
schemas.put("CellulantDetails", new GenericType<CellulantDetails>() {
});
schemas.put("DokuDetails", new GenericType<DokuDetails>() {
Expand Down Expand Up @@ -1573,7 +1609,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, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails
* AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails
*
* 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 @@ -1630,6 +1666,11 @@ public void setActualInstance(Object instance) {
return;
}

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

if (JSON.isInstanceOf(CellulantDetails.class, instance, new HashSet<Class<?>>())) {
super.setActualInstance(instance);
return;
Expand Down Expand Up @@ -1780,14 +1821,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, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails");
throw new RuntimeException("Invalid instance type. Must be AchDetails, AfterpayDetails, AmazonPayDetails, AncvDetails, AndroidPayDetails, ApplePayDetails, BacsDirectDebitDetails, BillDeskDetails, BlikDetails, CardDetails, CashAppDetails, CellulantDetails, DokuDetails, DotpayDetails, DragonpayDetails, EcontextVoucherDetails, GenericIssuerPaymentMethodDetails, GiropayDetails, GooglePayDetails, IdealDetails, KlarnaDetails, MasterpassDetails, MbwayDetails, MobilePayDetails, MolPayDetails, OpenInvoiceDetails, PayPalDetails, PayUUpiDetails, PayWithGoogleDetails, PaymentDetails, RatepayDetails, SamsungPayDetails, SepaDirectDebitDetails, StoredPaymentMethodDetails, UpiCollectDetails, UpiIntentDetails, VippsDetails, VisaCheckoutDetails, WeChatPayDetails, WeChatPayMiniProgramDetails, ZipDetails");
}

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

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

/**
* Get the actual instance of `CellulantDetails`. If the actual instance is not `CellulantDetails`,
* the ClassCastException will be thrown.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,23 @@ public class CheckoutSessionInstallmentOption {
* Gets or Sets plans
*/
public enum PlansEnum {
BUYNOW_PAYLATER("buynow_paylater"),

INTERES_REFUND_PRCTG("interes_refund_prctg"),

INTEREST_BONUS("interest_bonus"),

NOINTERES_REFUND_PRCTG("nointeres_refund_prctg"),

NOINTEREST_BONUS("nointerest_bonus"),

REFUND_PRCTG("refund_prctg"),

REGULAR("regular"),

REVOLVING("revolving");
REVOLVING("revolving"),

WITH_INTEREST("with_interest");

private String value;

Expand Down
16 changes: 15 additions & 1 deletion src/main/java/com/adyen/model/checkout/InstallmentOption.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,23 @@ public class InstallmentOption {
* Gets or Sets plans
*/
public enum PlansEnum {
BUYNOW_PAYLATER("buynow_paylater"),

INTERES_REFUND_PRCTG("interes_refund_prctg"),

INTEREST_BONUS("interest_bonus"),

NOINTERES_REFUND_PRCTG("nointeres_refund_prctg"),

NOINTEREST_BONUS("nointerest_bonus"),

REFUND_PRCTG("refund_prctg"),

REGULAR("regular"),

REVOLVING("revolving");
REVOLVING("revolving"),

WITH_INTEREST("with_interest");

private String value;

Expand Down
70 changes: 60 additions & 10 deletions src/main/java/com/adyen/model/checkout/Installments.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,36 @@
* Installments
*/
@JsonPropertyOrder({
Installments.JSON_PROPERTY_EXTRA,
Installments.JSON_PROPERTY_PLAN,
Installments.JSON_PROPERTY_VALUE
})

public class Installments {
public static final String JSON_PROPERTY_EXTRA = "extra";
private Integer extra;

/**
* The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving**
* The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**.
*/
public enum PlanEnum {
BUYNOW_PAYLATER("buynow_paylater"),

INTERES_REFUND_PRCTG("interes_refund_prctg"),

INTEREST_BONUS("interest_bonus"),

NOINTERES_REFUND_PRCTG("nointeres_refund_prctg"),

NOINTEREST_BONUS("nointerest_bonus"),

REFUND_PRCTG("refund_prctg"),

REGULAR("regular"),

REVOLVING("revolving");
REVOLVING("revolving"),

WITH_INTEREST("with_interest");

private String value;

Expand Down Expand Up @@ -80,16 +98,46 @@ public static PlanEnum fromValue(String value) {
public Installments() {
}

public Installments extra(Integer extra) {
this.extra = extra;
return this;
}

/**
* Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico)
* @return extra
**/
@ApiModelProperty(value = "Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico) ")
@JsonProperty(JSON_PROPERTY_EXTRA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public Integer getExtra() {
return extra;
}


/**
* Defines the bonus percentage, refund percentage or if the transaction is Buy now Pay later. Used for [card installments in Mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico)
*
* @param extra
*/
@JsonProperty(JSON_PROPERTY_EXTRA)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setExtra(Integer extra) {
this.extra = extra;
}


public Installments plan(PlanEnum plan) {
this.plan = plan;
return this;
}

/**
* The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving**
* The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**.
* @return plan
**/
@ApiModelProperty(value = "The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving** ")
@ApiModelProperty(value = "The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**. ")
@JsonProperty(JSON_PROPERTY_PLAN)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

Expand All @@ -99,7 +147,7 @@ public PlanEnum getPlan() {


/**
* The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). By default, this is set to **regular**. Possible values: * **regular** * **revolving**
* The installment plan, used for [card installments in Japan](https://docs.adyen.com/payment-methods/cards/credit-card-installments#make-a-payment-japan). and [mexico](https://docs.adyen.com/payment-methods/cards/credit-card-installments/#getting-paid-mexico). By default, this is set to **regular**.
*
* @param plan
*/
Expand All @@ -116,10 +164,10 @@ public Installments value(Integer value) {
}

/**
* Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary.
* Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico
* @return value
**/
@ApiModelProperty(required = true, value = "Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary.")
@ApiModelProperty(required = true, value = "Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico")
@JsonProperty(JSON_PROPERTY_VALUE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

Expand All @@ -129,7 +177,7 @@ public Integer getValue() {


/**
* Defines the number of installments. Its value needs to be greater than zero. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary.
* Defines the number of installments. Usually, the maximum allowed number of installments is capped. For example, it may not be possible to split a payment in more than 24 installments. The acquirer sets this upper limit, so its value may vary. This value can be zero for Installments processed in Mexico
*
* @param value
*/
Expand All @@ -152,19 +200,21 @@ public boolean equals(Object o) {
return false;
}
Installments installments = (Installments) o;
return Objects.equals(this.plan, installments.plan) &&
return Objects.equals(this.extra, installments.extra) &&
Objects.equals(this.plan, installments.plan) &&
Objects.equals(this.value, installments.value);
}

@Override
public int hashCode() {
return Objects.hash(plan, value);
return Objects.hash(extra, plan, value);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Installments {\n");
sb.append(" extra: ").append(toIndentedString(extra)).append("\n");
sb.append(" plan: ").append(toIndentedString(plan)).append("\n");
sb.append(" value: ").append(toIndentedString(value)).append("\n");
sb.append("}");
Expand Down
Loading

0 comments on commit 63ea306

Please sign in to comment.