Skip to content

Commit 00ce576

Browse files
authored
Merge pull request #1001 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 995271b + 8a4d74e commit 00ce576

File tree

1,644 files changed

+132201
-6837
lines changed

Some content is hidden

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

1,644 files changed

+132201
-6837
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ af9205fa592e4ae32ceca951c560a48b512b7744
1717
f58dd73747791edcd45722a4903da44da1b9b2d3
1818
fcdaa3d6735d2382a44d066a6ce051a2c5e6469f
1919
9bbe16b7d1600fc96100f54cb25869cbdf425521
20+
165a4da6a015267909adf7e7d5f3edc16a56dda6
21+
c4e2bf407aa0b7a3d34605134791013ba8a2d376

changes.md

Lines changed: 756 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 59 additions & 2 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!
@@ -2057,6 +2061,22 @@ type CartLimitsProjection {
20572061
total: CartLimitWithCurrent!
20582062
}
20592063

2064+
enum CartMergeMode {
2065+
"""
2066+
`LineItem`s of the anonymous cart will be copied to the customer’s active cart that has been modified most recently.
2067+
2068+
The `CartState` of the anonymous cart gets changed to `Merged` while the `CartState` of the customer’s cart remains `Active`.
2069+
2070+
`CustomLineItems` and `CustomFields` of the anonymous cart will not be copied to the customers cart.
2071+
2072+
If a `LineItem` in the anonymous cart matches an existing line item in the customer’s cart (same product ID and variant ID), the maximum quantity of both LineItems is used as the new quantity. In that case `CustomFields` on the `LineItem` of the anonymous cart will not be in the resulting `LineItem`.
2073+
"""
2074+
MergeWithExistingCustomerCart
2075+
2076+
"The anonymous cart is used as new active customer cart. No `LineItem`s get merged."
2077+
UseAsNewActiveCustomerCart
2078+
}
2079+
20602080
enum CartOrigin {
20612081
"The cart was created by the customer. This is the default value"
20622082
Customer
@@ -2107,6 +2127,10 @@ enum CartState {
21072127
Ordered
21082128
}
21092129

2130+
type CartUnfrozen implements MessagePayload {
2131+
type: String!
2132+
}
2133+
21102134
input CartUpdateAction {
21112135
addCustomShippingMethod: AddCartCustomShippingMethod
21122136
addDiscountCode: AddCartDiscountCode
@@ -4612,6 +4636,17 @@ input EnumValueInput {
46124636
label: String!
46134637
}
46144638

4639+
type RecurringOrderFailureError {
4640+
"Error identifier"
4641+
code: String!
4642+
4643+
"Plain text description of the cause of the error."
4644+
message: String!
4645+
4646+
"Information about the cause of the error."
4647+
details: Json!
4648+
}
4649+
46154650
type EventBridgeDestination implements Destination {
46164651
source: String!
46174652
region: String!
@@ -5306,6 +5341,7 @@ type InventoryEntryQuantitySet implements MessagePayload {
53065341
newQuantityOnStock: Long!
53075342
oldAvailableQuantity: Long!
53085343
newAvailableQuantity: Long!
5344+
sku: String
53095345
supplyChannel: Channel
53105346
supplyChannelRef: Reference
53115347
type: String!
@@ -5825,6 +5861,13 @@ interface MeQueryInterface implements CartQueryInterface & ActiveCartInterface &
58255861
shoppingLists(where: String, sort: [String!], limit: Int, offset: Int): ShoppingListQueryResult!
58265862
}
58275863

5864+
input MergeCartDraft {
5865+
anonymousCart: ResourceIdentifierInput
5866+
mergeMode: CartMergeMode = MergeWithExistingCustomerCart
5867+
anonymousId: String
5868+
updateProductData: Boolean = false
5869+
}
5870+
58285871
type Message implements Versioned & ReferenceExpandable {
58295872
id: String!
58305873
type: String!
@@ -6442,6 +6485,11 @@ type Mutation {
64426485
"Create/modify entity as an associate in business-unit."
64436486
asAssociate: AsAssociateArgument): Cart
64446487

6488+
mergeCart(customerId: String!, draft: MergeCartDraft!,
6489+
6490+
"The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions."
6491+
storeKey: KeyReferenceInput): Cart
6492+
64456493
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
64466494
createMyCart(draft: MyCartDraft!,
64476495

@@ -10452,10 +10500,10 @@ type Query {
1045210500
apiClient(id: String!): APIClientWithoutSecret
1045310501
apiClients(where: String, sort: [String!], limit: Int, offset: Int): APIClientWithoutSecretQueryResult!
1045410502
limits: ProjectCustomLimitsProjection!
10455-
productProjectionSearch(projectExpandedProducts: Boolean = false, locale: Locale, text: String, facets: [SearchFacetInput!] = [], filters: [SearchFilterInput!] = [], queryFilters: [SearchFilterInput!] = [], facetFilters: [SearchFilterInput!] = [], sorts: [String!] = [], limit: Int = 10, offset: Int = 0, fuzzy: Boolean = false, fuzzyLevel: Int, priceSelector: PriceSelectorInput, markMatchingVariants: Boolean = false,
10503+
productProjectionSearch(projectExpandedProducts: Boolean = false, locale: Locale, text: String, facets: [SearchFacetInput!] = [], filters: [SearchFilterInput!] = [], queryFilters: [SearchFilterInput!] = [], facetFilters: [SearchFilterInput!] = [], sorts: [String!] = [], limit: Int = 10, offset: Int = 0, fuzzy: Boolean = false, fuzzyLevel: Int, priceSelector: PriceSelectorInput, markMatchingVariants: Boolean,
1045610504

1045710505
"Deprecated: please use 'markMatchingVariants'."
10458-
markMatchingVariant: Boolean = false, storeProjection: String, localeProjection: [Locale!], staged: Boolean = false): ProductProjectionSearchResult!
10506+
markMatchingVariant: Boolean, storeProjection: String, localeProjection: [Locale!], staged: Boolean = false): ProductProjectionSearchResult!
1045910507

1046010508
"""
1046110509
StandalonePrices are managed and queried through the StandalonePrices API
@@ -11016,6 +11064,15 @@ type RecurringOrderCustomFieldChanged implements MessagePayload {
1101611064
type: String!
1101711065
}
1101811066

11067+
type RecurringOrderFailed implements MessagePayload {
11068+
cartId: String!
11069+
failedAt: DateTime!
11070+
failureReason: String!
11071+
orderScheduledAt: DateTime!
11072+
errors: [RecurringOrderFailureError!]
11073+
type: String!
11074+
}
11075+
1101911076
type RecurringOrderCustomFieldRemoved implements MessagePayload {
1102011077
name: String!
1102111078
type: String!

commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/cart/CartQueryTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import commercetools.utils.CommercetoolsTestUtils;
1717

1818
import io.vrap.rmf.base.client.error.ForbiddenException;
19-
import io.vrap.rmf.base.client.error.NotFoundException;
2019

2120
import org.assertj.core.api.Assertions;
2221
import org.junit.jupiter.api.Test;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
2+
package com.commercetools.api.client;
3+
4+
import java.net.URI;
5+
import java.time.Duration;
6+
import java.util.ArrayList;
7+
import java.util.List;
8+
import java.util.concurrent.CompletableFuture;
9+
10+
import com.fasterxml.jackson.core.type.TypeReference;
11+
12+
import io.vrap.rmf.base.client.*;
13+
import io.vrap.rmf.base.client.utils.Generated;
14+
15+
import org.apache.commons.lang3.builder.EqualsBuilder;
16+
import org.apache.commons.lang3.builder.HashCodeBuilder;
17+
18+
/**
19+
* <p>Merges items from an anonymous Cart into the most recently modified active Cart of a Customer. If no active Cart exists, the anonymous Cart becomes the Customer's active Cart. For more information, see <span>Merge behavior</span>.</p>
20+
*
21+
* <hr>
22+
* <div class=code-example>
23+
* <pre><code class='java'>{@code
24+
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> result = apiRoot
25+
* .withProjectKey("{projectKey}")
26+
* .carts()
27+
* .customerIdWithCustomerIdValueMerge("{customerId}")
28+
* .post(null)
29+
* .execute()
30+
* }</code></pre>
31+
* </div>
32+
*/
33+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
34+
public class ByProjectKeyCartsCustomerIdByCustomerIdMergePost extends
35+
TypeBodyApiMethod<ByProjectKeyCartsCustomerIdByCustomerIdMergePost, com.commercetools.api.models.cart.Cart, com.commercetools.api.models.cart.MergeCartDraft>
36+
implements com.commercetools.api.client.ErrorableTrait<ByProjectKeyCartsCustomerIdByCustomerIdMergePost> {
37+
38+
@Override
39+
public TypeReference<com.commercetools.api.models.cart.Cart> resultType() {
40+
return new TypeReference<com.commercetools.api.models.cart.Cart>() {
41+
};
42+
}
43+
44+
private String projectKey;
45+
private String customerId;
46+
47+
private com.commercetools.api.models.cart.MergeCartDraft mergeCartDraft;
48+
49+
public ByProjectKeyCartsCustomerIdByCustomerIdMergePost(final ApiHttpClient apiHttpClient, String projectKey,
50+
String customerId, com.commercetools.api.models.cart.MergeCartDraft mergeCartDraft) {
51+
super(apiHttpClient);
52+
this.projectKey = projectKey;
53+
this.customerId = customerId;
54+
this.mergeCartDraft = mergeCartDraft;
55+
}
56+
57+
public ByProjectKeyCartsCustomerIdByCustomerIdMergePost(ByProjectKeyCartsCustomerIdByCustomerIdMergePost t) {
58+
super(t);
59+
this.projectKey = t.projectKey;
60+
this.customerId = t.customerId;
61+
this.mergeCartDraft = t.mergeCartDraft;
62+
}
63+
64+
@Override
65+
protected ApiHttpRequest buildHttpRequest() {
66+
List<String> params = new ArrayList<>(getQueryParamUriStrings());
67+
String httpRequestPath = String.format("%s/carts/customer-id=%s/merge", encodePathParam(this.projectKey),
68+
encodePathParam(this.customerId));
69+
if (!params.isEmpty()) {
70+
httpRequestPath += "?" + String.join("&", params);
71+
}
72+
return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(),
73+
io.vrap.rmf.base.client.utils.json.JsonUtils
74+
.executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(mergeCartDraft)));
75+
76+
}
77+
78+
@Override
79+
public ApiHttpResponse<com.commercetools.api.models.cart.Cart> executeBlocking(final ApiHttpClient client,
80+
final Duration timeout) {
81+
return executeBlocking(client, timeout, com.commercetools.api.models.cart.Cart.class);
82+
}
83+
84+
@Override
85+
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.cart.Cart>> execute(
86+
final ApiHttpClient client) {
87+
return execute(client, com.commercetools.api.models.cart.Cart.class);
88+
}
89+
90+
public String getProjectKey() {
91+
return this.projectKey;
92+
}
93+
94+
public String getCustomerId() {
95+
return this.customerId;
96+
}
97+
98+
public void setProjectKey(final String projectKey) {
99+
this.projectKey = projectKey;
100+
}
101+
102+
public void setCustomerId(final String customerId) {
103+
this.customerId = customerId;
104+
}
105+
106+
public com.commercetools.api.models.cart.MergeCartDraft getBody() {
107+
return mergeCartDraft;
108+
}
109+
110+
public ByProjectKeyCartsCustomerIdByCustomerIdMergePost withBody(
111+
com.commercetools.api.models.cart.MergeCartDraft mergeCartDraft) {
112+
ByProjectKeyCartsCustomerIdByCustomerIdMergePost t = copy();
113+
t.mergeCartDraft = mergeCartDraft;
114+
return t;
115+
}
116+
117+
@Override
118+
public boolean equals(Object o) {
119+
if (this == o)
120+
return true;
121+
122+
if (o == null || getClass() != o.getClass())
123+
return false;
124+
125+
ByProjectKeyCartsCustomerIdByCustomerIdMergePost that = (ByProjectKeyCartsCustomerIdByCustomerIdMergePost) o;
126+
127+
return new EqualsBuilder().append(projectKey, that.projectKey)
128+
.append(customerId, that.customerId)
129+
.append(mergeCartDraft, that.mergeCartDraft)
130+
.isEquals();
131+
}
132+
133+
@Override
134+
public int hashCode() {
135+
return new HashCodeBuilder(17, 37).append(projectKey).append(customerId).append(mergeCartDraft).toHashCode();
136+
}
137+
138+
@Override
139+
protected ByProjectKeyCartsCustomerIdByCustomerIdMergePost copy() {
140+
return new ByProjectKeyCartsCustomerIdByCustomerIdMergePost(this);
141+
}
142+
}

0 commit comments

Comments
 (0)