Skip to content

Commit 8810cb1

Browse files
committed
build(codegen): updating SDK
1 parent d20843c commit 8810cb1

File tree

91 files changed

+7835
-72
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+7835
-72
lines changed

changes.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,37 @@
1+
**Api changes**
2+
3+
<details>
4+
<summary>Added Type(s)</summary>
5+
6+
- added type `CheckoutOrderCreationFailedEvent`
7+
- added type `CheckoutPaymentAuthorizationCancelledEvent`
8+
- added type `CheckoutPaymentAuthorizationFailedEvent`
9+
- added type `CheckoutPaymentAuthorizedEvent`
10+
- added type `CheckoutPaymentCancelAuthorizationFailedEvent`
11+
- added type `CheckoutPaymentChargeFailedEvent`
12+
- added type `CheckoutPaymentChargedEvent`
13+
- added type `CheckoutPaymentRefundFailedEvent`
14+
- added type `CheckoutPaymentRefundedEvent`
15+
- added type `CheckoutMessageOrderPayloadBaseData`
16+
- added type `CheckoutMessagePaymentsPayloadBaseData`
17+
</details>
18+
19+
20+
<details>
21+
<summary>Added Enum(s)</summary>
22+
23+
- added enum `checkout` to type `EventSubscriptionResourceTypeId`
24+
- added enum `CheckoutOrderCreationFailed` to type `EventType`
25+
- added enum `CheckoutPaymentAuthorizationCancelled` to type `EventType`
26+
- added enum `CheckoutPaymentAuthorizationFailed` to type `EventType`
27+
- added enum `CheckoutPaymentAuthorized` to type `EventType`
28+
- added enum `CheckoutPaymentCancelAuthorizationFailed` to type `EventType`
29+
- added enum `CheckoutPaymentCharged` to type `EventType`
30+
- added enum `CheckoutPaymentChargeFailed` to type `EventType`
31+
- added enum `CheckoutPaymentRefunded` to type `EventType`
32+
- added enum `CheckoutPaymentRefundFailed` to type `EventType`
33+
</details>
34+
135
**Import changes**
236

337
<details>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/event/BaseEvent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
* BaseEvent baseEvent = BaseEvent.builder()
2929
* .id("{id}")
3030
* .notificationType("{notificationType}")
31-
* .resourceType(EventSubscriptionResourceTypeId.IMPORT_API)
32-
* .type(EventType.IMPORT_CONTAINER_CREATED)
31+
* .resourceType(EventSubscriptionResourceTypeId.CHECKOUT)
32+
* .type(EventType.CHECKOUT_ORDER_CREATION_FAILED)
3333
* .data(dataBuilder -> dataBuilder)
3434
* .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
3535
* .build()

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/event/BaseEventBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* BaseEvent baseEvent = BaseEvent.builder()
1616
* .id("{id}")
1717
* .notificationType("{notificationType}")
18-
* .resourceType(EventSubscriptionResourceTypeId.IMPORT_API)
19-
* .type(EventType.IMPORT_CONTAINER_CREATED)
18+
* .resourceType(EventSubscriptionResourceTypeId.CHECKOUT)
19+
* .type(EventType.CHECKOUT_ORDER_CREATION_FAILED)
2020
* .data(dataBuilder -> dataBuilder)
2121
* .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
2222
* .build()
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
2+
package com.commercetools.api.models.event;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
import java.util.function.Function;
7+
import java.util.stream.Collectors;
8+
9+
import javax.annotation.Nullable;
10+
11+
import com.commercetools.api.models.cart.CartReference;
12+
import com.commercetools.api.models.error.ErrorObject;
13+
import com.commercetools.api.models.payment.PaymentReference;
14+
import com.fasterxml.jackson.annotation.*;
15+
import com.fasterxml.jackson.databind.annotation.*;
16+
17+
import io.vrap.rmf.base.client.utils.Generated;
18+
19+
import jakarta.validation.Valid;
20+
import jakarta.validation.constraints.NotNull;
21+
22+
/**
23+
* <p>The <code>data</code> payload of all related order event messages.</p>
24+
*
25+
* <hr>
26+
* Example to create an instance using the builder pattern
27+
* <div class=code-example>
28+
* <pre><code class='java'>
29+
* CheckoutMessageOrderPayloadBaseData checkoutMessageOrderPayloadBaseData = CheckoutMessageOrderPayloadBaseData.builder()
30+
* .projectKey("{projectKey}")
31+
* .cart(cartBuilder -> cartBuilder)
32+
* .plusPayments(paymentsBuilder -> paymentsBuilder)
33+
* .plusErrors(errorsBuilder -> errorsBuilder)
34+
* .build()
35+
* </code></pre>
36+
* </div>
37+
*/
38+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
39+
@JsonDeserialize(as = CheckoutMessageOrderPayloadBaseDataImpl.class)
40+
public interface CheckoutMessageOrderPayloadBaseData {
41+
42+
/**
43+
* <p><code>key</code> of the Project where the order would belong to.</p>
44+
* @return projectKey
45+
*/
46+
@NotNull
47+
@JsonProperty("projectKey")
48+
public String getProjectKey();
49+
50+
/**
51+
* <p>The Cart on which the change or action was performed.</p>
52+
* @return cart
53+
*/
54+
@NotNull
55+
@Valid
56+
@JsonProperty("cart")
57+
public CartReference getCart();
58+
59+
/**
60+
* <p>The Payments on which the change or action was performed.</p>
61+
* @return payments
62+
*/
63+
@NotNull
64+
@Valid
65+
@JsonProperty("payments")
66+
public List<PaymentReference> getPayments();
67+
68+
/**
69+
* <p>Errors associated with the order event.</p>
70+
* @return errors
71+
*/
72+
@NotNull
73+
@Valid
74+
@JsonProperty("errors")
75+
public List<ErrorObject> getErrors();
76+
77+
/**
78+
* <p><code>key</code> of the Project where the order would belong to.</p>
79+
* @param projectKey value to be set
80+
*/
81+
82+
public void setProjectKey(final String projectKey);
83+
84+
/**
85+
* <p>The Cart on which the change or action was performed.</p>
86+
* @param cart value to be set
87+
*/
88+
89+
public void setCart(final CartReference cart);
90+
91+
/**
92+
* <p>The Payments on which the change or action was performed.</p>
93+
* @param payments values to be set
94+
*/
95+
96+
@JsonIgnore
97+
public void setPayments(final PaymentReference... payments);
98+
99+
/**
100+
* <p>The Payments on which the change or action was performed.</p>
101+
* @param payments values to be set
102+
*/
103+
104+
public void setPayments(final List<PaymentReference> payments);
105+
106+
/**
107+
* <p>Errors associated with the order event.</p>
108+
* @param errors values to be set
109+
*/
110+
111+
@JsonIgnore
112+
public void setErrors(final ErrorObject... errors);
113+
114+
/**
115+
* <p>Errors associated with the order event.</p>
116+
* @param errors values to be set
117+
*/
118+
119+
public void setErrors(final List<ErrorObject> errors);
120+
121+
/**
122+
* factory method
123+
* @return instance of CheckoutMessageOrderPayloadBaseData
124+
*/
125+
public static CheckoutMessageOrderPayloadBaseData of() {
126+
return new CheckoutMessageOrderPayloadBaseDataImpl();
127+
}
128+
129+
/**
130+
* factory method to create a shallow copy CheckoutMessageOrderPayloadBaseData
131+
* @param template instance to be copied
132+
* @return copy instance
133+
*/
134+
public static CheckoutMessageOrderPayloadBaseData of(final CheckoutMessageOrderPayloadBaseData template) {
135+
CheckoutMessageOrderPayloadBaseDataImpl instance = new CheckoutMessageOrderPayloadBaseDataImpl();
136+
instance.setProjectKey(template.getProjectKey());
137+
instance.setCart(template.getCart());
138+
instance.setPayments(template.getPayments());
139+
instance.setErrors(template.getErrors());
140+
return instance;
141+
}
142+
143+
public CheckoutMessageOrderPayloadBaseData copyDeep();
144+
145+
/**
146+
* factory method to create a deep copy of CheckoutMessageOrderPayloadBaseData
147+
* @param template instance to be copied
148+
* @return copy instance
149+
*/
150+
@Nullable
151+
public static CheckoutMessageOrderPayloadBaseData deepCopy(
152+
@Nullable final CheckoutMessageOrderPayloadBaseData template) {
153+
if (template == null) {
154+
return null;
155+
}
156+
CheckoutMessageOrderPayloadBaseDataImpl instance = new CheckoutMessageOrderPayloadBaseDataImpl();
157+
instance.setProjectKey(template.getProjectKey());
158+
instance.setCart(com.commercetools.api.models.cart.CartReference.deepCopy(template.getCart()));
159+
instance.setPayments(Optional.ofNullable(template.getPayments())
160+
.map(t -> t.stream()
161+
.map(com.commercetools.api.models.payment.PaymentReference::deepCopy)
162+
.collect(Collectors.toList()))
163+
.orElse(null));
164+
instance.setErrors(Optional.ofNullable(template.getErrors())
165+
.map(t -> t.stream()
166+
.map(com.commercetools.api.models.error.ErrorObject::deepCopy)
167+
.collect(Collectors.toList()))
168+
.orElse(null));
169+
return instance;
170+
}
171+
172+
/**
173+
* builder factory method for CheckoutMessageOrderPayloadBaseData
174+
* @return builder
175+
*/
176+
public static CheckoutMessageOrderPayloadBaseDataBuilder builder() {
177+
return CheckoutMessageOrderPayloadBaseDataBuilder.of();
178+
}
179+
180+
/**
181+
* create builder for CheckoutMessageOrderPayloadBaseData instance
182+
* @param template instance with prefilled values for the builder
183+
* @return builder
184+
*/
185+
public static CheckoutMessageOrderPayloadBaseDataBuilder builder(
186+
final CheckoutMessageOrderPayloadBaseData template) {
187+
return CheckoutMessageOrderPayloadBaseDataBuilder.of(template);
188+
}
189+
190+
/**
191+
* accessor map function
192+
* @param <T> mapped type
193+
* @param helper function to map the object
194+
* @return mapped value
195+
*/
196+
default <T> T withCheckoutMessageOrderPayloadBaseData(Function<CheckoutMessageOrderPayloadBaseData, T> helper) {
197+
return helper.apply(this);
198+
}
199+
200+
/**
201+
* gives a TypeReference for usage with Jackson DataBind
202+
* @return TypeReference
203+
*/
204+
public static com.fasterxml.jackson.core.type.TypeReference<CheckoutMessageOrderPayloadBaseData> typeReference() {
205+
return new com.fasterxml.jackson.core.type.TypeReference<CheckoutMessageOrderPayloadBaseData>() {
206+
@Override
207+
public String toString() {
208+
return "TypeReference<CheckoutMessageOrderPayloadBaseData>";
209+
}
210+
};
211+
}
212+
}

0 commit comments

Comments
 (0)