Skip to content

Commit e6a3be7

Browse files
committed
build(codegen): updating SDK
1 parent 30a5826 commit e6a3be7

File tree

19 files changed

+352
-15
lines changed

19 files changed

+352
-15
lines changed

changes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<summary>Added Type(s)</summary>
55

66
- added type `CartLock`
7+
- added type `FreezeStrategy`
78
- added type `CartLockCartAction`
89
- added type `CartSetPurchaseOrderNumberAction`
910
- added type `CartUnlockCartAction`
@@ -15,8 +16,10 @@
1516
<details>
1617
<summary>Added Property(s)</summary>
1718

19+
- added property `freezeStrategy` to type `Cart`
1820
- added property `lock` to type `Cart`
1921
- added property `purchaseOrderNumber` to type `Cart`
2022
- added property `purchaseOrderNumber` to type `CartDraft`
23+
- added property `strategy` to type `CartFreezeCartAction`
2124
</details>
2225

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,7 @@ type Cart implements Versioned & ReferenceExpandable {
18351835
shippingCustomFields: CustomFieldsType
18361836
discountTypeCombination: DiscountTypeCombination
18371837
cartState: CartState!
1838+
freezeStrategy: FreezeStrategy
18381839
key: String
18391840
lock: CartLock
18401841
custom: CustomFieldsType
@@ -4978,8 +4979,21 @@ input FixedPriceDiscountValueInput {
49784979
money: [CartDiscountValueBaseMoneyInput!]!
49794980
}
49804981

4982+
enum FreezeStrategy {
4983+
"""
4984+
More lenient version of a Cart freeze (See [Freeze a Cart](https://docs.commercetools.com/api/carts-orders-overview#freeze-a-cart) for details).
4985+
"""
4986+
SoftFreeze
4987+
4988+
"""
4989+
Stricter version of a Cart freeze (See [Freeze a Cart](https://docs.commercetools.com/api/carts-orders-overview#freeze-a-cart) for details).
4990+
"""
4991+
HardFreeze
4992+
}
4993+
49814994
input FreezeCart {
49824995
dummy: String
4996+
strategy: FreezeStrategy
49834997
}
49844998

49854999
interface Geometry {

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,14 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod
252252
@JsonProperty("cartState")
253253
public CartState getCartState();
254254

255+
/**
256+
* <p>Determines freezing behavior when <code>cartState</code> is <code>Frozen</code>.</p>
257+
* @return freezeStrategy
258+
*/
259+
260+
@JsonProperty("freezeStrategy")
261+
public FreezeStrategy getFreezeStrategy();
262+
255263
/**
256264
* <p>Billing address associated with the Cart.</p>
257265
* @return billingAddress
@@ -640,6 +648,13 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod
640648

641649
public void setCartState(final CartState cartState);
642650

651+
/**
652+
* <p>Determines freezing behavior when <code>cartState</code> is <code>Frozen</code>.</p>
653+
* @param freezeStrategy value to be set
654+
*/
655+
656+
public void setFreezeStrategy(final FreezeStrategy freezeStrategy);
657+
643658
/**
644659
* <p>Billing address associated with the Cart.</p>
645660
* @param billingAddress value to be set
@@ -902,6 +917,7 @@ public static Cart of(final Cart template) {
902917
instance.setTaxCalculationMode(template.getTaxCalculationMode());
903918
instance.setInventoryMode(template.getInventoryMode());
904919
instance.setCartState(template.getCartState());
920+
instance.setFreezeStrategy(template.getFreezeStrategy());
905921
instance.setBillingAddress(template.getBillingAddress());
906922
instance.setShippingAddress(template.getShippingAddress());
907923
instance.setShippingMode(template.getShippingMode());
@@ -978,6 +994,7 @@ public static Cart deepCopy(@Nullable final Cart template) {
978994
instance.setTaxCalculationMode(template.getTaxCalculationMode());
979995
instance.setInventoryMode(template.getInventoryMode());
980996
instance.setCartState(template.getCartState());
997+
instance.setFreezeStrategy(template.getFreezeStrategy());
981998
instance.setBillingAddress(com.commercetools.api.models.common.Address.deepCopy(template.getBillingAddress()));
982999
instance.setShippingAddress(
9831000
com.commercetools.api.models.common.Address.deepCopy(template.getShippingAddress()));

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

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ public class CartBuilder implements Builder<Cart> {
102102

103103
private com.commercetools.api.models.cart.CartState cartState;
104104

105+
@Nullable
106+
private com.commercetools.api.models.cart.FreezeStrategy freezeStrategy;
107+
105108
@Nullable
106109
private com.commercetools.api.models.common.Address billingAddress;
107110

@@ -777,6 +780,17 @@ public CartBuilder cartState(final com.commercetools.api.models.cart.CartState c
777780
return this;
778781
}
779782

783+
/**
784+
* <p>Determines freezing behavior when <code>cartState</code> is <code>Frozen</code>.</p>
785+
* @param freezeStrategy value to be set
786+
* @return Builder
787+
*/
788+
789+
public CartBuilder freezeStrategy(@Nullable final com.commercetools.api.models.cart.FreezeStrategy freezeStrategy) {
790+
this.freezeStrategy = freezeStrategy;
791+
return this;
792+
}
793+
780794
/**
781795
* <p>Billing address associated with the Cart.</p>
782796
* @param builder function to build the billingAddress value
@@ -1914,6 +1928,16 @@ public com.commercetools.api.models.cart.CartState getCartState() {
19141928
return this.cartState;
19151929
}
19161930

1931+
/**
1932+
* <p>Determines freezing behavior when <code>cartState</code> is <code>Frozen</code>.</p>
1933+
* @return freezeStrategy
1934+
*/
1935+
1936+
@Nullable
1937+
public com.commercetools.api.models.cart.FreezeStrategy getFreezeStrategy() {
1938+
return this.freezeStrategy;
1939+
}
1940+
19171941
/**
19181942
* <p>Billing address associated with the Cart.</p>
19191943
* @return billingAddress
@@ -2172,9 +2196,9 @@ public Cart build() {
21722196
return new CartImpl(id, version, createdAt, lastModifiedAt, key, customerId, customerEmail, customerGroup,
21732197
anonymousId, businessUnit, store, lineItems, customLineItems, totalLineItemQuantity, totalPrice, taxedPrice,
21742198
taxedShippingPrice, discountOnTotalPrice, taxMode, priceRoundingMode, taxRoundingMode, taxCalculationMode,
2175-
inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo,
2176-
shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts,
2177-
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
2199+
inventoryMode, cartState, freezeStrategy, billingAddress, shippingAddress, shippingMode, shippingKey,
2200+
shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes,
2201+
directDiscounts, refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
21782202
deleteDaysAfterLastModification, purchaseOrderNumber, lastModifiedBy, createdBy);
21792203
}
21802204

@@ -2186,9 +2210,9 @@ public Cart buildUnchecked() {
21862210
return new CartImpl(id, version, createdAt, lastModifiedAt, key, customerId, customerEmail, customerGroup,
21872211
anonymousId, businessUnit, store, lineItems, customLineItems, totalLineItemQuantity, totalPrice, taxedPrice,
21882212
taxedShippingPrice, discountOnTotalPrice, taxMode, priceRoundingMode, taxRoundingMode, taxCalculationMode,
2189-
inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo,
2190-
shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts,
2191-
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
2213+
inventoryMode, cartState, freezeStrategy, billingAddress, shippingAddress, shippingMode, shippingKey,
2214+
shippingInfo, shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes,
2215+
directDiscounts, refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
21922216
deleteDaysAfterLastModification, purchaseOrderNumber, lastModifiedBy, createdBy);
21932217
}
21942218

@@ -2231,6 +2255,7 @@ public static CartBuilder of(final Cart template) {
22312255
builder.taxCalculationMode = template.getTaxCalculationMode();
22322256
builder.inventoryMode = template.getInventoryMode();
22332257
builder.cartState = template.getCartState();
2258+
builder.freezeStrategy = template.getFreezeStrategy();
22342259
builder.billingAddress = template.getBillingAddress();
22352260
builder.shippingAddress = template.getShippingAddress();
22362261
builder.shippingMode = template.getShippingMode();

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,14 @@
1313
import io.vrap.rmf.base.client.utils.Generated;
1414

1515
/**
16-
* <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>
16+
* <p>Freezes the Cart based on the provided <a href="https://docs.commercetools.com/apis/ctp:api:type:FreezeStrategy" rel="nofollow">FreezeStrategy</a>.</p>
17+
* <p>The following behavior occurs:</p>
18+
* <ul>
19+
* <li>Changes the Cart State from <code>Active</code> to <code>Frozen</code>.</li>
20+
* <li>Sets the corresponding <a href="https://docs.commercetools.com/apis/ctp:api:type:FreezeStrategy" rel="nofollow">FreezeStrategy</a> on the Cart's <code>freezeStrategy</code> field.</li>
21+
* <li>Produces the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartFrozenMessage" rel="nofollow">CartFrozen</a> Message.</li>
22+
* </ul>
23+
* <p>If the Cart is empty, an <a href="https://docs.commercetools.com/apis/ctp:api:type:InvalidOperationError" rel="nofollow">InvalidOperation</a> error is returned.</p>
1824
*
1925
* <hr>
2026
* Example to create an instance using the builder pattern
@@ -35,6 +41,21 @@ public interface CartFreezeCartAction extends CartUpdateAction {
3541
*/
3642
String FREEZE_CART = "freezeCart";
3743

44+
/**
45+
* <p>Strategy that determines the freezing behavior.</p>
46+
* @return strategy
47+
*/
48+
49+
@JsonProperty("strategy")
50+
public FreezeStrategy getStrategy();
51+
52+
/**
53+
* <p>Strategy that determines the freezing behavior.</p>
54+
* @param strategy value to be set
55+
*/
56+
57+
public void setStrategy(final FreezeStrategy strategy);
58+
3859
/**
3960
* factory method
4061
* @return instance of CartFreezeCartAction
@@ -50,6 +71,7 @@ public static CartFreezeCartAction of() {
5071
*/
5172
public static CartFreezeCartAction of(final CartFreezeCartAction template) {
5273
CartFreezeCartActionImpl instance = new CartFreezeCartActionImpl();
74+
instance.setStrategy(template.getStrategy());
5375
return instance;
5476
}
5577

@@ -66,6 +88,7 @@ public static CartFreezeCartAction deepCopy(@Nullable final CartFreezeCartAction
6688
return null;
6789
}
6890
CartFreezeCartActionImpl instance = new CartFreezeCartActionImpl();
91+
instance.setStrategy(template.getStrategy());
6992
return instance;
7093
}
7194

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

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
import java.util.*;
55

6+
import javax.annotation.Nullable;
7+
68
import io.vrap.rmf.base.client.Builder;
79
import io.vrap.rmf.base.client.utils.Generated;
810

@@ -20,20 +22,45 @@
2022
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
2123
public class CartFreezeCartActionBuilder implements Builder<CartFreezeCartAction> {
2224

25+
@Nullable
26+
private com.commercetools.api.models.cart.FreezeStrategy strategy;
27+
28+
/**
29+
* <p>Strategy that determines the freezing behavior.</p>
30+
* @param strategy value to be set
31+
* @return Builder
32+
*/
33+
34+
public CartFreezeCartActionBuilder strategy(
35+
@Nullable final com.commercetools.api.models.cart.FreezeStrategy strategy) {
36+
this.strategy = strategy;
37+
return this;
38+
}
39+
40+
/**
41+
* <p>Strategy that determines the freezing behavior.</p>
42+
* @return strategy
43+
*/
44+
45+
@Nullable
46+
public com.commercetools.api.models.cart.FreezeStrategy getStrategy() {
47+
return this.strategy;
48+
}
49+
2350
/**
2451
* builds CartFreezeCartAction with checking for non-null required values
2552
* @return CartFreezeCartAction
2653
*/
2754
public CartFreezeCartAction build() {
28-
return new CartFreezeCartActionImpl();
55+
return new CartFreezeCartActionImpl(strategy);
2956
}
3057

3158
/**
3259
* builds CartFreezeCartAction without checking for non-null required values
3360
* @return CartFreezeCartAction
3461
*/
3562
public CartFreezeCartAction buildUnchecked() {
36-
return new CartFreezeCartActionImpl();
63+
return new CartFreezeCartActionImpl(strategy);
3764
}
3865

3966
/**
@@ -51,6 +78,7 @@ public static CartFreezeCartActionBuilder of() {
5178
*/
5279
public static CartFreezeCartActionBuilder of(final CartFreezeCartAction template) {
5380
CartFreezeCartActionBuilder builder = new CartFreezeCartActionBuilder();
81+
builder.strategy = template.getStrategy();
5482
return builder;
5583
}
5684

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

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import java.util.*;
66

77
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonProperty;
89
import com.fasterxml.jackson.databind.annotation.*;
910

1011
import io.vrap.rmf.base.client.ModelBase;
@@ -16,18 +17,35 @@
1617
import org.apache.commons.lang3.builder.ToStringStyle;
1718

1819
/**
19-
* <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>
20+
* <p>Freezes the Cart based on the provided <a href="https://docs.commercetools.com/apis/ctp:api:type:FreezeStrategy" rel="nofollow">FreezeStrategy</a>.</p>
21+
* <p>The following behavior occurs:</p>
22+
* <ul>
23+
* <li>Changes the Cart State from <code>Active</code> to <code>Frozen</code>.</li>
24+
* <li>Sets the corresponding <a href="https://docs.commercetools.com/apis/ctp:api:type:FreezeStrategy" rel="nofollow">FreezeStrategy</a> on the Cart's <code>freezeStrategy</code> field.</li>
25+
* <li>Produces the <a href="https://docs.commercetools.com/apis/ctp:api:type:CartFrozenMessage" rel="nofollow">CartFrozen</a> Message.</li>
26+
* </ul>
27+
* <p>If the Cart is empty, an <a href="https://docs.commercetools.com/apis/ctp:api:type:InvalidOperationError" rel="nofollow">InvalidOperation</a> error is returned.</p>
2128
*/
2229
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
2330
public class CartFreezeCartActionImpl implements CartFreezeCartAction, ModelBase {
2431

2532
private String action;
2633

34+
private com.commercetools.api.models.cart.FreezeStrategy strategy;
35+
2736
/**
2837
* create instance with all properties
2938
*/
3039
@JsonCreator
40+
CartFreezeCartActionImpl(
41+
@JsonProperty("strategy") final com.commercetools.api.models.cart.FreezeStrategy strategy) {
42+
this.strategy = strategy;
43+
this.action = FREEZE_CART;
44+
}
45+
46+
/**
47+
* create empty instance
48+
*/
3149
public CartFreezeCartActionImpl() {
3250
this.action = FREEZE_CART;
3351
}
@@ -40,6 +58,18 @@ public String getAction() {
4058
return this.action;
4159
}
4260

61+
/**
62+
* <p>Strategy that determines the freezing behavior.</p>
63+
*/
64+
65+
public com.commercetools.api.models.cart.FreezeStrategy getStrategy() {
66+
return this.strategy;
67+
}
68+
69+
public void setStrategy(final com.commercetools.api.models.cart.FreezeStrategy strategy) {
70+
this.strategy = strategy;
71+
}
72+
4373
@Override
4474
public boolean equals(Object o) {
4575
if (this == o)
@@ -50,17 +80,23 @@ public boolean equals(Object o) {
5080

5181
CartFreezeCartActionImpl that = (CartFreezeCartActionImpl) o;
5282

53-
return new EqualsBuilder().append(action, that.action).append(action, that.action).isEquals();
83+
return new EqualsBuilder().append(action, that.action)
84+
.append(strategy, that.strategy)
85+
.append(action, that.action)
86+
.append(strategy, that.strategy)
87+
.isEquals();
5488
}
5589

5690
@Override
5791
public int hashCode() {
58-
return new HashCodeBuilder(17, 37).append(action).toHashCode();
92+
return new HashCodeBuilder(17, 37).append(action).append(strategy).toHashCode();
5993
}
6094

6195
@Override
6296
public String toString() {
63-
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action).build();
97+
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("action", action)
98+
.append("strategy", strategy)
99+
.build();
64100
}
65101

66102
@Override

0 commit comments

Comments
 (0)