Skip to content

Commit 825e5d7

Browse files
committed
build(codegen): updating SDK
1 parent e14e963 commit 825e5d7

35 files changed

+2550
-0
lines changed

changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
- added type `MergeCartDraft`
88
- added type `RecurringOrderFailureError`
99
- added type `GraphQLRecurringOrderFailureError`
10+
- added type `CartFrozenMessage`
11+
- added type `CartUnfrozenMessage`
1012
- added type `RecurringOrderFailedMessage`
13+
- added type `CartFrozenMessagePayload`
14+
- added type `CartUnfrozenMessagePayload`
1115
- added type `RecurringOrderFailedMessagePayload`
1216
- added type `DiscountCombinationMode`
1317
- added type `DiscountsConfiguration`

commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,6 +2048,10 @@ input CartDraft {
20482048
origin: CartOrigin = Customer
20492049
}
20502050

2051+
type CartFrozen implements MessagePayload {
2052+
type: String!
2053+
}
2054+
20512055
type CartLimitWithCurrent implements LimitWithCurrent {
20522056
limit: Long
20532057
current: Long!
@@ -2123,6 +2127,10 @@ enum CartState {
21232127
Ordered
21242128
}
21252129

2130+
type CartUnfrozen implements MessagePayload {
2131+
type: String!
2132+
}
2133+
21262134
input CartUpdateAction {
21272135
addCustomShippingMethod: AddCartCustomShippingMethod
21282136
addDiscountCode: AddCartDiscountCode

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartFreezeCartAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
/**
1616
* <p>Changes the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartState" rel="nofollow">CartState</a> from <code>Active</code> to <code>Frozen</code>. Results in a <a href="https://docs.commercetools.com/apis/ctp:api:type:FrozenCarts" rel="nofollow">Frozen Cart</a>. Fails with <a href="https://docs.commercetools.com/apis/ctp:api:type:InvalidOperationError" rel="nofollow">InvalidOperation</a> error when the Cart is empty.</p>
17+
* <p>Freezing a Cart produces the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartFrozenMessage" rel="nofollow">CartFrozen</a> Message.</p>
1718
*
1819
* <hr>
1920
* Example to create an instance using the builder pattern

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartFreezeCartActionImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
/**
1919
* <p>Changes the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartState" rel="nofollow">CartState</a> from <code>Active</code> to <code>Frozen</code>. Results in a <a href="https://docs.commercetools.com/apis/ctp:api:type:FrozenCarts" rel="nofollow">Frozen Cart</a>. Fails with <a href="https://docs.commercetools.com/apis/ctp:api:type:InvalidOperationError" rel="nofollow">InvalidOperation</a> error when the Cart is empty.</p>
20+
* <p>Freezing a Cart produces the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartFrozenMessage" rel="nofollow">CartFrozen</a> Message.</p>
2021
*/
2122
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
2223
public class CartFreezeCartActionImpl implements CartFreezeCartAction, ModelBase {

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartUnfreezeCartAction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
/**
1616
* <p>Changes the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartState" rel="nofollow">CartState</a> from <code>Frozen</code> to <code>Active</code>. Reactivates a <a href="https://docs.commercetools.com/apis/ctp:api:type:FrozenCarts" rel="nofollow">Frozen Cart</a>. This action updates all prices in the Cart according to latest Prices on related Product Variants and Shipping Methods and by applying all discounts currently being active and applicable for the Cart.</p>
17+
* <p>Unfreezing a Cart produces the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartUnfrozenMessage" rel="nofollow">CartUnfrozen</a> Message.</p>
1718
*
1819
* <hr>
1920
* Example to create an instance using the builder pattern

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartUnfreezeCartActionImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
/**
1919
* <p>Changes the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartState" rel="nofollow">CartState</a> from <code>Frozen</code> to <code>Active</code>. Reactivates a <a href="https://docs.commercetools.com/apis/ctp:api:type:FrozenCarts" rel="nofollow">Frozen Cart</a>. This action updates all prices in the Cart according to latest Prices on related Product Variants and Shipping Methods and by applying all discounts currently being active and applicable for the Cart.</p>
20+
* <p>Unfreezing a Cart produces the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartUnfrozenMessage" rel="nofollow">CartUnfrozen</a> Message.</p>
2021
*/
2122
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
2223
public class CartUnfreezeCartActionImpl implements CartUnfreezeCartAction, ModelBase {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
2+
package com.commercetools.api.models.message;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
import java.util.function.Function;
7+
8+
import javax.annotation.Nullable;
9+
10+
import com.fasterxml.jackson.annotation.*;
11+
import com.fasterxml.jackson.databind.annotation.*;
12+
13+
import io.vrap.rmf.base.client.utils.Generated;
14+
15+
/**
16+
* <p>Generated after a successful <a href="https://docs.commercetools.com/apis/ctp:api:type:CartFreezeCartAction" rel="nofollow">Freeze Cart</a> update action.</p>
17+
*
18+
* <hr>
19+
* Example to create an instance using the builder pattern
20+
* <div class=code-example>
21+
* <pre><code class='java'>
22+
* CartFrozenMessage cartFrozenMessage = CartFrozenMessage.builder()
23+
* .id("{id}")
24+
* .version(0.3)
25+
* .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
26+
* .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
27+
* .sequenceNumber(0.3)
28+
* .resource(resourceBuilder -> resourceBuilder)
29+
* .resourceVersion(0.3)
30+
* .build()
31+
* </code></pre>
32+
* </div>
33+
*/
34+
@io.vrap.rmf.base.client.utils.json.SubType("CartFrozen")
35+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
36+
@JsonDeserialize(as = CartFrozenMessageImpl.class)
37+
public interface CartFrozenMessage extends Message {
38+
39+
/**
40+
* discriminator value for CartFrozenMessage
41+
*/
42+
String CART_FROZEN = "CartFrozen";
43+
44+
/**
45+
* factory method
46+
* @return instance of CartFrozenMessage
47+
*/
48+
public static CartFrozenMessage of() {
49+
return new CartFrozenMessageImpl();
50+
}
51+
52+
/**
53+
* factory method to create a shallow copy CartFrozenMessage
54+
* @param template instance to be copied
55+
* @return copy instance
56+
*/
57+
public static CartFrozenMessage of(final CartFrozenMessage template) {
58+
CartFrozenMessageImpl instance = new CartFrozenMessageImpl();
59+
instance.setId(template.getId());
60+
instance.setVersion(template.getVersion());
61+
instance.setCreatedAt(template.getCreatedAt());
62+
instance.setLastModifiedAt(template.getLastModifiedAt());
63+
instance.setLastModifiedBy(template.getLastModifiedBy());
64+
instance.setCreatedBy(template.getCreatedBy());
65+
instance.setSequenceNumber(template.getSequenceNumber());
66+
instance.setResource(template.getResource());
67+
instance.setResourceVersion(template.getResourceVersion());
68+
instance.setResourceUserProvidedIdentifiers(template.getResourceUserProvidedIdentifiers());
69+
return instance;
70+
}
71+
72+
public CartFrozenMessage copyDeep();
73+
74+
/**
75+
* factory method to create a deep copy of CartFrozenMessage
76+
* @param template instance to be copied
77+
* @return copy instance
78+
*/
79+
@Nullable
80+
public static CartFrozenMessage deepCopy(@Nullable final CartFrozenMessage template) {
81+
if (template == null) {
82+
return null;
83+
}
84+
CartFrozenMessageImpl instance = new CartFrozenMessageImpl();
85+
instance.setId(template.getId());
86+
instance.setVersion(template.getVersion());
87+
instance.setCreatedAt(template.getCreatedAt());
88+
instance.setLastModifiedAt(template.getLastModifiedAt());
89+
instance.setLastModifiedBy(
90+
com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
91+
instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy()));
92+
instance.setSequenceNumber(template.getSequenceNumber());
93+
instance.setResource(com.commercetools.api.models.common.Reference.deepCopy(template.getResource()));
94+
instance.setResourceVersion(template.getResourceVersion());
95+
instance.setResourceUserProvidedIdentifiers(com.commercetools.api.models.message.UserProvidedIdentifiers
96+
.deepCopy(template.getResourceUserProvidedIdentifiers()));
97+
return instance;
98+
}
99+
100+
/**
101+
* builder factory method for CartFrozenMessage
102+
* @return builder
103+
*/
104+
public static CartFrozenMessageBuilder builder() {
105+
return CartFrozenMessageBuilder.of();
106+
}
107+
108+
/**
109+
* create builder for CartFrozenMessage instance
110+
* @param template instance with prefilled values for the builder
111+
* @return builder
112+
*/
113+
public static CartFrozenMessageBuilder builder(final CartFrozenMessage template) {
114+
return CartFrozenMessageBuilder.of(template);
115+
}
116+
117+
/**
118+
* accessor map function
119+
* @param <T> mapped type
120+
* @param helper function to map the object
121+
* @return mapped value
122+
*/
123+
default <T> T withCartFrozenMessage(Function<CartFrozenMessage, T> helper) {
124+
return helper.apply(this);
125+
}
126+
127+
/**
128+
* gives a TypeReference for usage with Jackson DataBind
129+
* @return TypeReference
130+
*/
131+
public static com.fasterxml.jackson.core.type.TypeReference<CartFrozenMessage> typeReference() {
132+
return new com.fasterxml.jackson.core.type.TypeReference<CartFrozenMessage>() {
133+
@Override
134+
public String toString() {
135+
return "TypeReference<CartFrozenMessage>";
136+
}
137+
};
138+
}
139+
}

0 commit comments

Comments
 (0)