Skip to content

Commit 052f24c

Browse files
committed
DEVX-624: regenerating with codegen tool
1 parent 7b5a43c commit 052f24c

25 files changed

+176
-600
lines changed

commercetools/commercetools-sdk-java-checkout/src/main/java-generated/com/commercetools/checkout/models/payment_intents/PaymentIntentAction.java

Lines changed: 30 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,28 @@
77

88
import javax.annotation.Nullable;
99

10-
import com.commercetools.checkout.models.common.Amount;
1110
import com.fasterxml.jackson.annotation.*;
1211
import com.fasterxml.jackson.databind.annotation.*;
1312

1413
import io.vrap.rmf.base.client.utils.Generated;
1514

16-
import jakarta.validation.Valid;
1715
import jakarta.validation.constraints.NotNull;
1816

1917
/**
2018
* <p>Depending on the action specified, Checkout requests the <span>payment service provider</span> (PSP) or gift card management system to capture, refund, or cancel the authorization for the given Payment.</p>
2119
*
2220
* <hr>
23-
* Example to create an instance using the builder pattern
21+
* Example to create a subtype instance using the builder pattern
2422
* <div class=code-example>
2523
* <pre><code class='java'>
26-
* PaymentIntentAction paymentIntentAction = PaymentIntentAction.builder()
27-
* .action(PaymentIntentOperation.CAPTURE_PAYMENT)
24+
* PaymentIntentAction paymentIntentAction = PaymentIntentAction.cancelPaymentBuilder()
2825
* .build()
2926
* </code></pre>
3027
* </div>
3128
*/
32-
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
29+
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "action", defaultImpl = PaymentIntentActionImpl.class, visible = true)
3330
@JsonDeserialize(as = PaymentIntentActionImpl.class)
31+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
3432
public interface PaymentIntentAction {
3533

3634
/**
@@ -41,64 +39,6 @@ public interface PaymentIntentAction {
4139
@JsonProperty("action")
4240
public PaymentIntentOperation getAction();
4341

44-
/**
45-
* <p>Amount to be captured or refunded.</p>
46-
* @return amount
47-
*/
48-
@Valid
49-
@JsonProperty("amount")
50-
public Amount getAmount();
51-
52-
/**
53-
* <p>A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number.</p>
54-
* @return merchantReference
55-
*/
56-
57-
@JsonProperty("merchantReference")
58-
public String getMerchantReference();
59-
60-
/**
61-
* <p>Action to execute for the given <span>Payment</span>.</p>
62-
* @param action value to be set
63-
*/
64-
65-
public void setAction(final PaymentIntentOperation action);
66-
67-
/**
68-
* <p>Amount to be captured or refunded.</p>
69-
* @param amount value to be set
70-
*/
71-
72-
public void setAmount(final Amount amount);
73-
74-
/**
75-
* <p>A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number.</p>
76-
* @param merchantReference value to be set
77-
*/
78-
79-
public void setMerchantReference(final String merchantReference);
80-
81-
/**
82-
* factory method
83-
* @return instance of PaymentIntentAction
84-
*/
85-
public static PaymentIntentAction of() {
86-
return new PaymentIntentActionImpl();
87-
}
88-
89-
/**
90-
* factory method to create a shallow copy PaymentIntentAction
91-
* @param template instance to be copied
92-
* @return copy instance
93-
*/
94-
public static PaymentIntentAction of(final PaymentIntentAction template) {
95-
PaymentIntentActionImpl instance = new PaymentIntentActionImpl();
96-
instance.setAction(template.getAction());
97-
instance.setAmount(template.getAmount());
98-
instance.setMerchantReference(template.getMerchantReference());
99-
return instance;
100-
}
101-
10242
public PaymentIntentAction copyDeep();
10343

10444
/**
@@ -111,28 +51,44 @@ public static PaymentIntentAction deepCopy(@Nullable final PaymentIntentAction t
11151
if (template == null) {
11252
return null;
11353
}
54+
55+
if (!(template instanceof PaymentIntentActionImpl)) {
56+
return template.copyDeep();
57+
}
11458
PaymentIntentActionImpl instance = new PaymentIntentActionImpl();
115-
instance.setAction(template.getAction());
116-
instance.setAmount(com.commercetools.checkout.models.common.Amount.deepCopy(template.getAmount()));
117-
instance.setMerchantReference(template.getMerchantReference());
11859
return instance;
11960
}
12061

12162
/**
122-
* builder factory method for PaymentIntentAction
63+
* builder for cancelPayment subtype
64+
* @return builder
65+
*/
66+
public static com.commercetools.checkout.models.payment_intents.PaymentIntentCancelActionBuilder cancelPaymentBuilder() {
67+
return com.commercetools.checkout.models.payment_intents.PaymentIntentCancelActionBuilder.of();
68+
}
69+
70+
/**
71+
* builder for capturePayment subtype
72+
* @return builder
73+
*/
74+
public static com.commercetools.checkout.models.payment_intents.PaymentIntentCaptureActionBuilder capturePaymentBuilder() {
75+
return com.commercetools.checkout.models.payment_intents.PaymentIntentCaptureActionBuilder.of();
76+
}
77+
78+
/**
79+
* builder for refundPayment subtype
12380
* @return builder
12481
*/
125-
public static PaymentIntentActionBuilder builder() {
126-
return PaymentIntentActionBuilder.of();
82+
public static com.commercetools.checkout.models.payment_intents.PaymentIntentRefundActionBuilder refundPaymentBuilder() {
83+
return com.commercetools.checkout.models.payment_intents.PaymentIntentRefundActionBuilder.of();
12784
}
12885

12986
/**
130-
* create builder for PaymentIntentAction instance
131-
* @param template instance with prefilled values for the builder
87+
* builder for reversePayment subtype
13288
* @return builder
13389
*/
134-
public static PaymentIntentActionBuilder builder(final PaymentIntentAction template) {
135-
return PaymentIntentActionBuilder.of(template);
90+
public static com.commercetools.checkout.models.payment_intents.PaymentIntentReverseActionBuilder reversePaymentBuilder() {
91+
return com.commercetools.checkout.models.payment_intents.PaymentIntentReverseActionBuilder.of();
13692
}
13793

13894
/**

commercetools/commercetools-sdk-java-checkout/src/main/java-generated/com/commercetools/checkout/models/payment_intents/PaymentIntentActionBuilder.java

Lines changed: 9 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -2,138 +2,29 @@
22
package com.commercetools.checkout.models.payment_intents;
33

44
import java.util.*;
5-
import java.util.function.Function;
65

7-
import javax.annotation.Nullable;
8-
9-
import io.vrap.rmf.base.client.Builder;
106
import io.vrap.rmf.base.client.utils.Generated;
117

128
/**
139
* PaymentIntentActionBuilder
14-
* <hr>
15-
* Example to create an instance using the builder pattern
16-
* <div class=code-example>
17-
* <pre><code class='java'>
18-
* PaymentIntentAction paymentIntentAction = PaymentIntentAction.builder()
19-
* .action(PaymentIntentOperation.CAPTURE_PAYMENT)
20-
* .build()
21-
* </code></pre>
22-
* </div>
2310
*/
2411
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
25-
public class PaymentIntentActionBuilder implements Builder<PaymentIntentAction> {
26-
27-
private com.commercetools.checkout.models.payment_intents.PaymentIntentOperation action;
28-
29-
@Nullable
30-
private com.commercetools.checkout.models.common.Amount amount;
31-
32-
@Nullable
33-
private String merchantReference;
34-
35-
/**
36-
* <p>Action to execute for the given <span>Payment</span>.</p>
37-
* @param action value to be set
38-
* @return Builder
39-
*/
12+
public class PaymentIntentActionBuilder {
4013

41-
public PaymentIntentActionBuilder action(
42-
final com.commercetools.checkout.models.payment_intents.PaymentIntentOperation action) {
43-
this.action = action;
44-
return this;
14+
public com.commercetools.checkout.models.payment_intents.PaymentIntentCancelActionBuilder cancelPaymentBuilder() {
15+
return com.commercetools.checkout.models.payment_intents.PaymentIntentCancelActionBuilder.of();
4516
}
4617

47-
/**
48-
* <p>Amount to be captured or refunded.</p>
49-
* @param builder function to build the amount value
50-
* @return Builder
51-
*/
52-
53-
public PaymentIntentActionBuilder amount(
54-
Function<com.commercetools.checkout.models.common.AmountBuilder, com.commercetools.checkout.models.common.AmountBuilder> builder) {
55-
this.amount = builder.apply(com.commercetools.checkout.models.common.AmountBuilder.of()).build();
56-
return this;
18+
public com.commercetools.checkout.models.payment_intents.PaymentIntentCaptureActionBuilder capturePaymentBuilder() {
19+
return com.commercetools.checkout.models.payment_intents.PaymentIntentCaptureActionBuilder.of();
5720
}
5821

59-
/**
60-
* <p>Amount to be captured or refunded.</p>
61-
* @param builder function to build the amount value
62-
* @return Builder
63-
*/
64-
65-
public PaymentIntentActionBuilder withAmount(
66-
Function<com.commercetools.checkout.models.common.AmountBuilder, com.commercetools.checkout.models.common.Amount> builder) {
67-
this.amount = builder.apply(com.commercetools.checkout.models.common.AmountBuilder.of());
68-
return this;
22+
public com.commercetools.checkout.models.payment_intents.PaymentIntentRefundActionBuilder refundPaymentBuilder() {
23+
return com.commercetools.checkout.models.payment_intents.PaymentIntentRefundActionBuilder.of();
6924
}
7025

71-
/**
72-
* <p>Amount to be captured or refunded.</p>
73-
* @param amount value to be set
74-
* @return Builder
75-
*/
76-
77-
public PaymentIntentActionBuilder amount(@Nullable final com.commercetools.checkout.models.common.Amount amount) {
78-
this.amount = amount;
79-
return this;
80-
}
81-
82-
/**
83-
* <p>A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number.</p>
84-
* @param merchantReference value to be set
85-
* @return Builder
86-
*/
87-
88-
public PaymentIntentActionBuilder merchantReference(@Nullable final String merchantReference) {
89-
this.merchantReference = merchantReference;
90-
return this;
91-
}
92-
93-
/**
94-
* <p>Action to execute for the given <span>Payment</span>.</p>
95-
* @return action
96-
*/
97-
98-
public com.commercetools.checkout.models.payment_intents.PaymentIntentOperation getAction() {
99-
return this.action;
100-
}
101-
102-
/**
103-
* <p>Amount to be captured or refunded.</p>
104-
* @return amount
105-
*/
106-
107-
@Nullable
108-
public com.commercetools.checkout.models.common.Amount getAmount() {
109-
return this.amount;
110-
}
111-
112-
/**
113-
* <p>A merchant-defined identifier associated with the Payment to track and reconcile the Payment Intent Action on the merchant's side. For example, an invoice number.</p>
114-
* @return merchantReference
115-
*/
116-
117-
@Nullable
118-
public String getMerchantReference() {
119-
return this.merchantReference;
120-
}
121-
122-
/**
123-
* builds PaymentIntentAction with checking for non-null required values
124-
* @return PaymentIntentAction
125-
*/
126-
public PaymentIntentAction build() {
127-
Objects.requireNonNull(action, PaymentIntentAction.class + ": action is missing");
128-
return new PaymentIntentActionImpl(action, amount, merchantReference);
129-
}
130-
131-
/**
132-
* builds PaymentIntentAction without checking for non-null required values
133-
* @return PaymentIntentAction
134-
*/
135-
public PaymentIntentAction buildUnchecked() {
136-
return new PaymentIntentActionImpl(action, amount, merchantReference);
26+
public com.commercetools.checkout.models.payment_intents.PaymentIntentReverseActionBuilder reversePaymentBuilder() {
27+
return com.commercetools.checkout.models.payment_intents.PaymentIntentReverseActionBuilder.of();
13728
}
13829

13930
/**
@@ -144,17 +35,4 @@ public static PaymentIntentActionBuilder of() {
14435
return new PaymentIntentActionBuilder();
14536
}
14637

147-
/**
148-
* create builder for PaymentIntentAction instance
149-
* @param template instance with prefilled values for the builder
150-
* @return builder
151-
*/
152-
public static PaymentIntentActionBuilder of(final PaymentIntentAction template) {
153-
PaymentIntentActionBuilder builder = new PaymentIntentActionBuilder();
154-
builder.action = template.getAction();
155-
builder.amount = template.getAmount();
156-
builder.merchantReference = template.getMerchantReference();
157-
return builder;
158-
}
159-
16038
}

0 commit comments

Comments
 (0)