Skip to content

Commit 0bd172a

Browse files
authored
Merge branch 'main' into DEVX-714-How-to-queryAll-with-GraphQL-in-Java-SDK
2 parents 3968779 + 5232863 commit 0bd172a

26 files changed

Lines changed: 1106 additions & 2 deletions

changes.md

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

6+
- added type `CartLock`
7+
- added type `CartLockCartAction`
68
- added type `CartSetPurchaseOrderNumberAction`
9+
- added type `CartUnlockCartAction`
710
- added type `CartPurchaseOrderNumberSetMessage`
811
- added type `CartPurchaseOrderNumberSetMessagePayload`
912
</details>
@@ -12,6 +15,7 @@
1215
<details>
1316
<summary>Added Property(s)</summary>
1417

18+
- added property `lock` to type `Cart`
1519
- added property `purchaseOrderNumber` to type `Cart`
1620
- added property `purchaseOrderNumber` to type `CartDraft`
1721
</details>

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,7 @@ type Cart implements Versioned & ReferenceExpandable {
18361836
discountTypeCombination: DiscountTypeCombination
18371837
cartState: CartState!
18381838
key: String
1839+
lock: CartLock
18391840
custom: CustomFieldsType
18401841
deleteDaysAfterLastModification: Int
18411842
totalLineItemQuantity: Long
@@ -2114,6 +2115,12 @@ type CartLimitsProjection {
21142115
total: CartLimitWithCurrent!
21152116
}
21162117

2118+
"Prevents edits on a Cart unless the caller has the `manage_locked_carts` OAuth scope."
2119+
type CartLock {
2120+
createdAt: DateTime!
2121+
clientId: String!
2122+
}
2123+
21172124
enum CartMergeMode {
21182125
"""
21192126
`LineItem`s of the anonymous cart will be copied to the customer’s active cart that has been modified most recently.
@@ -2253,6 +2260,8 @@ input CartUpdateAction {
22532260
updateItemShippingAddress: UpdateCartItemShippingAddress
22542261
freezeCart: FreezeCart
22552262
unfreezeCart: UnfreezeCart
2263+
lockCart: LockCart
2264+
unlockCart: UnlockCart
22562265
applyDeltaToLineItemShippingDetailsTargets: ApplyCartDeltaToLineItemShippingDetailsTargets
22572266
applyDeltaToCustomLineItemShippingDetailsTargets: ApplyCartDeltaToCustomLineItemShippingDetailsTargets
22582267
addLineItem: AddCartLineItem
@@ -5849,6 +5858,10 @@ type Location {
58495858
state: String
58505859
}
58515860

5861+
input LockCart {
5862+
dummy: String
5863+
}
5864+
58525865
"The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1."
58535866
scalar Long
58545867

@@ -16796,6 +16809,10 @@ input UnfreezeCart {
1679616809
dummy: String
1679716810
}
1679816811

16812+
input UnlockCart {
16813+
dummy: String
16814+
}
16815+
1679916816
input UnpublishProduct {
1680016817
dummy: String
1680116818
}

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
@@ -407,6 +407,14 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod
407407
@JsonProperty("discountTypeCombination")
408408
public DiscountTypeCombination getDiscountTypeCombination();
409409

410+
/**
411+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
412+
* @return lock
413+
*/
414+
@Valid
415+
@JsonProperty("lock")
416+
public CartLock getLock();
417+
410418
/**
411419
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
412420
* @return deleteDaysAfterLastModification
@@ -805,6 +813,13 @@ public interface Cart extends BaseResource, CartMixin, com.commercetools.api.mod
805813

806814
public void setDiscountTypeCombination(final DiscountTypeCombination discountTypeCombination);
807815

816+
/**
817+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
818+
* @param lock value to be set
819+
*/
820+
821+
public void setLock(final CartLock lock);
822+
808823
/**
809824
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
810825
* @param deleteDaysAfterLastModification value to be set
@@ -905,6 +920,7 @@ public static Cart of(final Cart template) {
905920
instance.setOrigin(template.getOrigin());
906921
instance.setCustom(template.getCustom());
907922
instance.setDiscountTypeCombination(template.getDiscountTypeCombination());
923+
instance.setLock(template.getLock());
908924
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
909925
instance.setPurchaseOrderNumber(template.getPurchaseOrderNumber());
910926
instance.setLastModifiedBy(template.getLastModifiedBy());
@@ -1004,6 +1020,7 @@ public static Cart deepCopy(@Nullable final Cart template) {
10041020
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
10051021
instance.setDiscountTypeCombination(
10061022
com.commercetools.api.models.cart.DiscountTypeCombination.deepCopy(template.getDiscountTypeCombination()));
1023+
instance.setLock(com.commercetools.api.models.cart.CartLock.deepCopy(template.getLock()));
10071024
instance.setDeleteDaysAfterLastModification(template.getDeleteDaysAfterLastModification());
10081025
instance.setPurchaseOrderNumber(template.getPurchaseOrderNumber());
10091026
instance.setLastModifiedBy(

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

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ public class CartBuilder implements Builder<Cart> {
149149
@Nullable
150150
private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination;
151151

152+
@Nullable
153+
private com.commercetools.api.models.cart.CartLock lock;
154+
152155
@Nullable
153156
private Integer deleteDaysAfterLastModification;
154157

@@ -1549,6 +1552,41 @@ public CartBuilder discountTypeCombination(
15491552
return this;
15501553
}
15511554

1555+
/**
1556+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
1557+
* @param builder function to build the lock value
1558+
* @return Builder
1559+
*/
1560+
1561+
public CartBuilder lock(
1562+
Function<com.commercetools.api.models.cart.CartLockBuilder, com.commercetools.api.models.cart.CartLockBuilder> builder) {
1563+
this.lock = builder.apply(com.commercetools.api.models.cart.CartLockBuilder.of()).build();
1564+
return this;
1565+
}
1566+
1567+
/**
1568+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
1569+
* @param builder function to build the lock value
1570+
* @return Builder
1571+
*/
1572+
1573+
public CartBuilder withLock(
1574+
Function<com.commercetools.api.models.cart.CartLockBuilder, com.commercetools.api.models.cart.CartLock> builder) {
1575+
this.lock = builder.apply(com.commercetools.api.models.cart.CartLockBuilder.of());
1576+
return this;
1577+
}
1578+
1579+
/**
1580+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
1581+
* @param lock value to be set
1582+
* @return Builder
1583+
*/
1584+
1585+
public CartBuilder lock(@Nullable final com.commercetools.api.models.cart.CartLock lock) {
1586+
this.lock = lock;
1587+
return this;
1588+
}
1589+
15521590
/**
15531591
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
15541592
* @param deleteDaysAfterLastModification value to be set
@@ -2055,6 +2093,16 @@ public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountType
20552093
return this.discountTypeCombination;
20562094
}
20572095

2096+
/**
2097+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
2098+
* @return lock
2099+
*/
2100+
2101+
@Nullable
2102+
public com.commercetools.api.models.cart.CartLock getLock() {
2103+
return this.lock;
2104+
}
2105+
20582106
/**
20592107
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
20602108
* @return deleteDaysAfterLastModification
@@ -2126,7 +2174,7 @@ public Cart build() {
21262174
taxedShippingPrice, discountOnTotalPrice, taxMode, priceRoundingMode, taxRoundingMode, taxCalculationMode,
21272175
inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo,
21282176
shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts,
2129-
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination,
2177+
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
21302178
deleteDaysAfterLastModification, purchaseOrderNumber, lastModifiedBy, createdBy);
21312179
}
21322180

@@ -2140,7 +2188,7 @@ public Cart buildUnchecked() {
21402188
taxedShippingPrice, discountOnTotalPrice, taxMode, priceRoundingMode, taxRoundingMode, taxCalculationMode,
21412189
inventoryMode, cartState, billingAddress, shippingAddress, shippingMode, shippingKey, shippingInfo,
21422190
shippingRateInput, shippingCustomFields, shipping, itemShippingAddresses, discountCodes, directDiscounts,
2143-
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination,
2191+
refusedGifts, paymentInfo, country, locale, origin, custom, discountTypeCombination, lock,
21442192
deleteDaysAfterLastModification, purchaseOrderNumber, lastModifiedBy, createdBy);
21452193
}
21462194

@@ -2201,6 +2249,7 @@ public static CartBuilder of(final Cart template) {
22012249
builder.origin = template.getOrigin();
22022250
builder.custom = template.getCustom();
22032251
builder.discountTypeCombination = template.getDiscountTypeCombination();
2252+
builder.lock = template.getLock();
22042253
builder.deleteDaysAfterLastModification = template.getDeleteDaysAfterLastModification();
22052254
builder.purchaseOrderNumber = template.getPurchaseOrderNumber();
22062255
builder.lastModifiedBy = template.getLastModifiedBy();

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ public class CartImpl implements Cart, ModelBase {
106106

107107
private com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination;
108108

109+
private com.commercetools.api.models.cart.CartLock lock;
110+
109111
private Integer deleteDaysAfterLastModification;
110112

111113
private String purchaseOrderNumber;
@@ -157,6 +159,7 @@ public class CartImpl implements Cart, ModelBase {
157159
@JsonProperty("origin") final com.commercetools.api.models.cart.CartOrigin origin,
158160
@JsonProperty("custom") final com.commercetools.api.models.type.CustomFields custom,
159161
@JsonProperty("discountTypeCombination") final com.commercetools.api.models.cart.DiscountTypeCombination discountTypeCombination,
162+
@JsonProperty("lock") final com.commercetools.api.models.cart.CartLock lock,
160163
@JsonProperty("deleteDaysAfterLastModification") final Integer deleteDaysAfterLastModification,
161164
@JsonProperty("purchaseOrderNumber") final String purchaseOrderNumber,
162165
@JsonProperty("lastModifiedBy") final com.commercetools.api.models.common.LastModifiedBy lastModifiedBy,
@@ -203,6 +206,7 @@ public class CartImpl implements Cart, ModelBase {
203206
this.origin = origin;
204207
this.custom = custom;
205208
this.discountTypeCombination = discountTypeCombination;
209+
this.lock = lock;
206210
this.deleteDaysAfterLastModification = deleteDaysAfterLastModification;
207211
this.purchaseOrderNumber = purchaseOrderNumber;
208212
this.lastModifiedBy = lastModifiedBy;
@@ -563,6 +567,14 @@ public com.commercetools.api.models.cart.DiscountTypeCombination getDiscountType
563567
return this.discountTypeCombination;
564568
}
565569

570+
/**
571+
* <p>Indicates whether the Cart has been <span>locked</span>, preventing edits.</p>
572+
*/
573+
574+
public com.commercetools.api.models.cart.CartLock getLock() {
575+
return this.lock;
576+
}
577+
566578
/**
567579
* <p>Number of days after the last modification before a Cart is deleted. Configured in <a href="https://docs.commercetools.com/apis/ctp:api:type:CartsConfiguration" rel="nofollow">Project settings</a>.</p>
568580
*/
@@ -802,6 +814,10 @@ public void setDiscountTypeCombination(
802814
this.discountTypeCombination = discountTypeCombination;
803815
}
804816

817+
public void setLock(final com.commercetools.api.models.cart.CartLock lock) {
818+
this.lock = lock;
819+
}
820+
805821
public void setDeleteDaysAfterLastModification(final Integer deleteDaysAfterLastModification) {
806822
this.deleteDaysAfterLastModification = deleteDaysAfterLastModification;
807823
}
@@ -870,6 +886,7 @@ public boolean equals(Object o) {
870886
.append(origin, that.origin)
871887
.append(custom, that.custom)
872888
.append(discountTypeCombination, that.discountTypeCombination)
889+
.append(lock, that.lock)
873890
.append(deleteDaysAfterLastModification, that.deleteDaysAfterLastModification)
874891
.append(purchaseOrderNumber, that.purchaseOrderNumber)
875892
.append(lastModifiedBy, that.lastModifiedBy)
@@ -916,6 +933,7 @@ public boolean equals(Object o) {
916933
.append(origin, that.origin)
917934
.append(custom, that.custom)
918935
.append(discountTypeCombination, that.discountTypeCombination)
936+
.append(lock, that.lock)
919937
.append(deleteDaysAfterLastModification, that.deleteDaysAfterLastModification)
920938
.append(purchaseOrderNumber, that.purchaseOrderNumber)
921939
.append(lastModifiedBy, that.lastModifiedBy)
@@ -967,6 +985,7 @@ public int hashCode() {
967985
.append(origin)
968986
.append(custom)
969987
.append(discountTypeCombination)
988+
.append(lock)
970989
.append(deleteDaysAfterLastModification)
971990
.append(purchaseOrderNumber)
972991
.append(lastModifiedBy)
@@ -1018,6 +1037,7 @@ public String toString() {
10181037
.append("origin", origin)
10191038
.append("custom", custom)
10201039
.append("discountTypeCombination", discountTypeCombination)
1040+
.append("lock", lock)
10211041
.append("deleteDaysAfterLastModification", deleteDaysAfterLastModification)
10221042
.append("purchaseOrderNumber", purchaseOrderNumber)
10231043
.append("lastModifiedBy", lastModifiedBy)

0 commit comments

Comments
 (0)