Skip to content

Commit 9167a78

Browse files
authored
Merge branch 'main' into SUPPORT-28804_add_deserializer_for_import_api
2 parents 866317d + a248061 commit 9167a78

File tree

98 files changed

+726
-420
lines changed

Some content is hidden

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

98 files changed

+726
-420
lines changed

CHANGELOG.md

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,35 @@
11

2-
# 17.16.0 (2024-10-07)
2+
# 17.17.0 (2024-11-07)
33

4-
**Api changes**
5-
6-
<details>
7-
<summary>Added Property(s)</summary>
8-
9-
- added property `warnings` to type `ProductTailoring`
10-
- added property `attributes` to type `ProductVariantTailoring`
11-
- added property `attributes` to type `ProductVariantTailoringDraft`
12-
- added property `attributes` to type `ProductTailoringAddVariantAction`
13-
- added property `warnings` to type `Product`
14-
- added property `customers` to type `SearchIndexingConfiguration`
15-
</details>
16-
17-
18-
<details>
19-
<summary>Added Type(s)</summary>
20-
21-
- added type `SearchNotReadyError`
22-
- added type `GraphQLSearchNotReadyError`
23-
- added type `ProductTailoringAttribute`
24-
- added type `ProductTailoringSetAttributeAction`
25-
- added type `ProductTailoringSetAttributeInAllVariantsAction`
26-
- added type `ImageProcessingOngoingWarning`
27-
- added type `WarningObject`
28-
</details>
29-
30-
31-
<details>
32-
<summary>Removed Type(s)</summary>
33-
34-
- :warning: removed type `ProductSearchStatus`
35-
</details>
4+
## What's Changed
5+
* Update changelog by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/739
6+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/740
7+
* optimize OkHttp3 client by @jenschude in https://github.com/commercetools/commercetools-sdk-java-v2/pull/741
8+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/743
9+
* fix exportSignatures plugin by @jenschude in https://github.com/commercetools/commercetools-sdk-java-v2/pull/745
10+
* Fix deserialization if subtype discriminator is missing by @jenschude in https://github.com/commercetools/commercetools-sdk-java-v2/pull/746
11+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/747
12+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/749
3613

3714

38-
<details>
39-
<summary>Added Enum(s)</summary>
40-
41-
- added enum `customer-group` to type `ExtensionResourceTypeId`
42-
- added enum `product-tailoring` to type `MessageSubscriptionResourceTypeId`
43-
- added enum `product-tailoring` to type `ResourceTypeId`
44-
</details>
15+
**Full Changelog**: https://github.com/commercetools/commercetools-sdk-java-v2/compare/17.16.0...17.17.0
4516

17+
# 17.16.0 (2024-10-07)
18+
19+
## What's Changed
20+
* Update changelog by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/728
21+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/729
22+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/730
23+
* update service regions by @jenschude in https://github.com/commercetools/commercetools-sdk-java-v2/pull/731
24+
* Create config.yml by @jenschude in https://github.com/commercetools/commercetools-sdk-java-v2/pull/732
25+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/733
26+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/735
27+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/736
28+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/737
29+
* Update generated SDKs by @ct-sdks in https://github.com/commercetools/commercetools-sdk-java-v2/pull/738
30+
31+
32+
**Full Changelog**: https://github.com/commercetools/commercetools-sdk-java-v2/compare/17.15.1...17.16.0
4633

4734
# 17.15.1 (2024-09-17)
4835

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The latest stable SDK release can be retrieved from [Maven Central](https://sear
2121
```gradle
2222
ext {
2323
versions = [
24-
commercetools: "17.16.0"
24+
commercetools: "17.17.0"
2525
]
2626
}
2727
@@ -42,7 +42,7 @@ dependencies {
4242

4343
```maven
4444
<properties>
45-
<commercetools.version>17.16.0</commercetools.version>
45+
<commercetools.version>17.17.0</commercetools.version>
4646
</properties>
4747
<dependencies>
4848
<dependency>

changes.md

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,19 @@
11
**Api changes**
22

33
<details>
4-
<summary>Added Type(s)</summary>
4+
<summary>Changed Property(s)</summary>
55

6-
- added type `ApprovalRuleSetCustomFieldAction`
7-
- added type `ApprovalRuleSetCustomTypeAction`
6+
- :warning: changed property `line` of type `GraphQLErrorLocation` from type `integer` to `number`
7+
- :warning: changed property `column` of type `GraphQLErrorLocation` from type `integer` to `number`
8+
- :warning: changed property `totalPrice` of type `StagedOrder` from type `TypedMoney` to `CentPrecisionMoney`
9+
- :warning: changed property `totalPrice` of type `Order` from type `TypedMoney` to `CentPrecisionMoney`
810
</details>
911

1012

1113
<details>
12-
<summary>Added Property(s)</summary>
14+
<summary>Added QueryParameter(s)</summary>
1315

14-
- added property `custom` to type `ApprovalRule`
15-
- added property `source` to type `EventBridgeDestination`
16-
</details>
17-
18-
19-
<details>
20-
<summary>Added Enum(s)</summary>
21-
22-
- added enum `approval-rule` to type `CustomFieldReferenceValue`
23-
- added enum `approval-rule` to type `ResourceTypeId`
24-
</details>
25-
26-
27-
<details>
28-
<summary>Added Method(s)</summary>
29-
30-
- added method `apiRoot.withProjectKey().productTailoring().head()`
31-
</details>
32-
33-
**Import changes**
34-
35-
<details>
36-
<summary>Added Type(s)</summary>
37-
38-
- added type `InvalidFieldsUpdateError`
39-
- added type `NewMasterVariantAdditionNotAllowedError`
40-
</details>
41-
42-
**History changes**
43-
44-
<details>
45-
<summary>Required Property(s)</summary>
46-
47-
- changed property `id` of type `ModifiedBy` to be optional
16+
- added query parameter `where` to method `get /{projectKey}/product-selections/key={key}/products`
17+
- added query parameter `where` to method `get /{projectKey}/product-selections/{ID}/products`
4818
</details>
4919

commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/ConcurrentModificationTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ public void concurrentModMiddlewareSuccess() {
195195
.build())
196196
.executeBlocking()
197197
.getBody();
198+
199+
Assertions.assertThat(modCart.getId()).isEqualTo(cart.getId());
200+
Assertions.assertThat(modCart.getVersion()).isGreaterThan(cart.getVersion());
198201
return modCart;
199202
});
200203
}
@@ -230,6 +233,11 @@ public void concurrentModMiddleware() {
230233
.build())
231234
.executeBlocking()
232235
.getBody();
236+
237+
Assertions.assertThat(modCart.getId()).isEqualTo(cart.getId());
238+
Assertions.assertThat(modCart.getVersion()).isGreaterThan(cart.getVersion());
239+
Assertions.assertThat(modCart.getVersion()).isGreaterThan(deCart.getBody().getVersion());
240+
233241
return modCart;
234242
});
235243
}

commercetools/commercetools-sdk-java-api/src/integrationTest/java/commercetools/TimeoutTest.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,39 @@ public void timeoutWithRetry() {
5858
.getBody();
5959
});
6060
}
61+
62+
@Test
63+
public void timeoutWithRetryTimeout() {
64+
String projectKey = CommercetoolsTestUtils.getProjectKey();
65+
66+
ProjectApiRoot b = ApiRootBuilder.of()
67+
.defaultClient(ClientCredentials.of()
68+
.withClientId(CommercetoolsTestUtils.getClientId())
69+
.withClientSecret(CommercetoolsTestUtils.getClientSecret())
70+
.build(),
71+
ServiceRegion.GCP_EUROPE_WEST1)
72+
.withTelemetryMiddleware((request, next) -> next.apply(request).thenApply((response) -> {
73+
try {
74+
Thread.sleep(15000); // ensure timeout
75+
}
76+
catch (InterruptedException e) {
77+
throw new RuntimeException(e);
78+
}
79+
return response;
80+
}))
81+
.withPolicies(policyBuilder -> policyBuilder.withTimeout(Duration.ofSeconds(7))
82+
.withRetry(builder -> builder.maxRetries(3)
83+
.statusCodes(singletonList(HttpStatusCode.NOT_FOUND_404))
84+
.failures(singletonList(TimeoutExceededException.class)))
85+
.withTimeout(Duration.ofSeconds(3)))
86+
.build(projectKey);
87+
88+
Assertions.assertThatExceptionOfType(TimeoutExceededException.class).isThrownBy(() -> {
89+
Category category = b.categories()
90+
.withId("fdbaf4ea-fbc9-4fea-bac4-1d7e6c1995b3")
91+
.get()
92+
.executeBlocking()
93+
.getBody();
94+
});
95+
}
6196
}

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyCustomObjectsPost.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
/**
2323
* <p>If an object with the given container/key exists, the object will be replaced with the new value and the version is incremented. If the request contains a version and an object with the given container/key, then the version must match the version of the existing object. Concurrent updates to the same Custom Object returns a ConcurrentModification error even if the version is not provided.</p>
24-
* <p>Fields with <code>null</code> values will <strong>not be saved</strong>.</p>
24+
* <p>Fields within <code>value</code> that have <code>null</code> values <strong>are not saved</strong>.</p>
2525
*
2626
* <hr>
2727
* <div class=code-example>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyCustomObjectsPostString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
/**
2424
* <p>If an object with the given container/key exists, the object will be replaced with the new value and the version is incremented. If the request contains a version and an object with the given container/key, then the version must match the version of the existing object. Concurrent updates to the same Custom Object returns a ConcurrentModification error even if the version is not provided.</p>
25-
* <p>Fields with <code>null</code> values will <strong>not be saved</strong>.</p>
25+
* <p>Fields within <code>value</code> that have <code>null</code> values <strong>are not saved</strong>.</p>
2626
*
2727
* <hr>
2828
* <div class=code-example>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyGraphqlPost.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import org.apache.commons.lang3.builder.HashCodeBuilder;
1717

1818
/**
19-
* <p>Execute a GraphQL query</p>
19+
* <p>Execute a GraphQL request.</p>
2020
*
2121
* <hr>
2222
* <div class=code-example>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyGraphqlPostString.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.apache.commons.lang3.builder.HashCodeBuilder;
1818

1919
/**
20-
* <p>Execute a GraphQL query</p>
20+
* <p>Execute a GraphQL request.</p>
2121
*
2222
* <hr>
2323
* <div class=code-example>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyProductSelectionsByIDProductsGet.java

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ public String getID() {
9999
return this.ID;
100100
}
101101

102+
public List<String> getWhere() {
103+
return this.getQueryParam("where");
104+
}
105+
102106
public List<String> getExpand() {
103107
return this.getQueryParam("expand");
104108
}
@@ -127,6 +131,85 @@ public void setID(final String ID) {
127131
this.ID = ID;
128132
}
129133

134+
/**
135+
* set where with the specified value
136+
* @param where value to be set
137+
* @param <TValue> value type
138+
* @return ByProjectKeyProductSelectionsByIDProductsGet
139+
*/
140+
public <TValue> ByProjectKeyProductSelectionsByIDProductsGet withWhere(final TValue where) {
141+
return copy().withQueryParam("where", where);
142+
}
143+
144+
/**
145+
* add additional where query parameter
146+
* @param where value to be added
147+
* @param <TValue> value type
148+
* @return ByProjectKeyProductSelectionsByIDProductsGet
149+
*/
150+
public <TValue> ByProjectKeyProductSelectionsByIDProductsGet addWhere(final TValue where) {
151+
return copy().addQueryParam("where", where);
152+
}
153+
154+
/**
155+
* set where with the specified value
156+
* @param supplier supplier for the value to be set
157+
* @return ByProjectKeyProductSelectionsByIDProductsGet
158+
*/
159+
public ByProjectKeyProductSelectionsByIDProductsGet withWhere(final Supplier<String> supplier) {
160+
return copy().withQueryParam("where", supplier.get());
161+
}
162+
163+
/**
164+
* add additional where query parameter
165+
* @param supplier supplier for the value to be added
166+
* @return ByProjectKeyProductSelectionsByIDProductsGet
167+
*/
168+
public ByProjectKeyProductSelectionsByIDProductsGet addWhere(final Supplier<String> supplier) {
169+
return copy().addQueryParam("where", supplier.get());
170+
}
171+
172+
/**
173+
* set where with the specified value
174+
* @param op builder for the value to be set
175+
* @return ByProjectKeyProductSelectionsByIDProductsGet
176+
*/
177+
public ByProjectKeyProductSelectionsByIDProductsGet withWhere(final Function<StringBuilder, StringBuilder> op) {
178+
return copy().withQueryParam("where", op.apply(new StringBuilder()));
179+
}
180+
181+
/**
182+
* add additional where query parameter
183+
* @param op builder for the value to be added
184+
* @return ByProjectKeyProductSelectionsByIDProductsGet
185+
*/
186+
public ByProjectKeyProductSelectionsByIDProductsGet addWhere(final Function<StringBuilder, StringBuilder> op) {
187+
return copy().addQueryParam("where", op.apply(new StringBuilder()));
188+
}
189+
190+
/**
191+
* set where with the specified values
192+
* @param where values to be set
193+
* @param <TValue> value type
194+
* @return ByProjectKeyProductSelectionsByIDProductsGet
195+
*/
196+
public <TValue> ByProjectKeyProductSelectionsByIDProductsGet withWhere(final Collection<TValue> where) {
197+
return copy().withoutQueryParam("where")
198+
.addQueryParams(
199+
where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList()));
200+
}
201+
202+
/**
203+
* add additional where query parameters
204+
* @param where values to be added
205+
* @param <TValue> value type
206+
* @return ByProjectKeyProductSelectionsByIDProductsGet
207+
*/
208+
public <TValue> ByProjectKeyProductSelectionsByIDProductsGet addWhere(final Collection<TValue> where) {
209+
return copy().addQueryParams(
210+
where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList()));
211+
}
212+
130213
/**
131214
* set expand with the specified value
132215
* @param expand value to be set

0 commit comments

Comments
 (0)