Skip to content

Commit 32cf601

Browse files
authored
Merge branch 'main' into SUPPORT-28804_add_deserializer_for_import_api
2 parents 8c7e225 + 19d82fc commit 32cf601

File tree

75 files changed

+2033
-161
lines changed

Some content is hidden

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

75 files changed

+2033
-161
lines changed

changes.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,49 @@
1+
**Api changes**
2+
3+
<details>
4+
<summary>Added Type(s)</summary>
5+
6+
- added type `ApprovalRuleSetCustomFieldAction`
7+
- added type `ApprovalRuleSetCustomTypeAction`
8+
</details>
9+
10+
11+
<details>
12+
<summary>Added Property(s)</summary>
13+
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+
133
**Import changes**
234

335
<details>
436
<summary>Added Type(s)</summary>
537

638
- 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
748
</details>
849

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ type ApprovalRule implements Versioned {
778778
requesters: [RuleRequester!]!
779779
businessUnitRef: KeyReference!
780780
businessUnit: BusinessUnit!
781+
custom: CustomFieldsType
781782
id: String!
782783
version: Long!
783784
createdAt: DateTime!
@@ -864,6 +865,8 @@ input ApprovalRuleUpdateAction {
864865
setRequesters: SetApprovalRuleRequesters
865866
setStatus: SetApprovalRuleStatus
866867
setApprovers: SetApprovalRuleApprovers
868+
setCustomField: SetApprovalRuleCustomField
869+
setCustomType: SetApprovalRuleCustomType
867870
}
868871

869872
input ApproveApprovalFlow {
@@ -10532,6 +10535,18 @@ input SetApprovalRuleStatus {
1053210535
status: ApprovalRuleStatus!
1053310536
}
1053410537

10538+
input SetApprovalRuleCustomField {
10539+
name: String!
10540+
value: String
10541+
}
10542+
10543+
input SetApprovalRuleCustomType {
10544+
fields: [CustomFieldInput!]
10545+
type: ResourceIdentifierInput
10546+
typeKey: String
10547+
typeId: String
10548+
}
10549+
1053510550
input SetAssociateRoleCustomField {
1053610551
name: String!
1053710552
value: String
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
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.Collection;
8+
import java.util.List;
9+
import java.util.concurrent.CompletableFuture;
10+
import java.util.function.Function;
11+
import java.util.function.Supplier;
12+
import java.util.stream.Collectors;
13+
14+
import com.fasterxml.jackson.core.type.TypeReference;
15+
16+
import io.vrap.rmf.base.client.*;
17+
import io.vrap.rmf.base.client.utils.Generated;
18+
19+
import org.apache.commons.lang3.builder.EqualsBuilder;
20+
import org.apache.commons.lang3.builder.HashCodeBuilder;
21+
22+
/**
23+
* <p>Checks if a ProductTailoring exists for a given Query Predicate. Returns a <code>200 OK</code> status if any ProductTailoring match the Query Predicate or a <code>404 Not Found</code> otherwise.</p>
24+
*
25+
* <hr>
26+
* <div class=code-example>
27+
* <pre><code class='java'>{@code
28+
* CompletableFuture<ApiHttpResponse<com.fasterxml.jackson.databind.JsonNode>> result = apiRoot
29+
* .withProjectKey("{projectKey}")
30+
* .productTailoring()
31+
* .head()
32+
* .execute()
33+
* }</code></pre>
34+
* </div>
35+
*/
36+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
37+
public class ByProjectKeyProductTailoringHead
38+
extends TypeApiMethod<ByProjectKeyProductTailoringHead, com.fasterxml.jackson.databind.JsonNode>
39+
implements com.commercetools.api.client.ErrorableTrait<ByProjectKeyProductTailoringHead>,
40+
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyProductTailoringHead> {
41+
42+
@Override
43+
public TypeReference<com.fasterxml.jackson.databind.JsonNode> resultType() {
44+
return new TypeReference<com.fasterxml.jackson.databind.JsonNode>() {
45+
};
46+
}
47+
48+
private String projectKey;
49+
50+
public ByProjectKeyProductTailoringHead(final ApiHttpClient apiHttpClient, String projectKey) {
51+
super(apiHttpClient);
52+
this.projectKey = projectKey;
53+
}
54+
55+
public ByProjectKeyProductTailoringHead(ByProjectKeyProductTailoringHead t) {
56+
super(t);
57+
this.projectKey = t.projectKey;
58+
}
59+
60+
@Override
61+
protected ApiHttpRequest buildHttpRequest() {
62+
List<String> params = new ArrayList<>(getQueryParamUriStrings());
63+
String httpRequestPath = String.format("%s/product-tailoring", encodePathParam(this.projectKey));
64+
if (!params.isEmpty()) {
65+
httpRequestPath += "?" + String.join("&", params);
66+
}
67+
return new ApiHttpRequest(ApiHttpMethod.HEAD, URI.create(httpRequestPath), getHeaders(), null);
68+
}
69+
70+
@Override
71+
public ApiHttpResponse<com.fasterxml.jackson.databind.JsonNode> executeBlocking(final ApiHttpClient client,
72+
final Duration timeout) {
73+
return executeBlocking(client, timeout, com.fasterxml.jackson.databind.JsonNode.class);
74+
}
75+
76+
@Override
77+
public CompletableFuture<ApiHttpResponse<com.fasterxml.jackson.databind.JsonNode>> execute(
78+
final ApiHttpClient client) {
79+
return execute(client, com.fasterxml.jackson.databind.JsonNode.class);
80+
}
81+
82+
public String getProjectKey() {
83+
return this.projectKey;
84+
}
85+
86+
public List<String> getWhere() {
87+
return this.getQueryParam("where");
88+
}
89+
90+
public void setProjectKey(final String projectKey) {
91+
this.projectKey = projectKey;
92+
}
93+
94+
/**
95+
* set where with the specified value
96+
* @param where value to be set
97+
* @param <TValue> value type
98+
* @return ByProjectKeyProductTailoringHead
99+
*/
100+
public <TValue> ByProjectKeyProductTailoringHead withWhere(final TValue where) {
101+
return copy().withQueryParam("where", where);
102+
}
103+
104+
/**
105+
* add additional where query parameter
106+
* @param where value to be added
107+
* @param <TValue> value type
108+
* @return ByProjectKeyProductTailoringHead
109+
*/
110+
public <TValue> ByProjectKeyProductTailoringHead addWhere(final TValue where) {
111+
return copy().addQueryParam("where", where);
112+
}
113+
114+
/**
115+
* set where with the specified value
116+
* @param supplier supplier for the value to be set
117+
* @return ByProjectKeyProductTailoringHead
118+
*/
119+
public ByProjectKeyProductTailoringHead withWhere(final Supplier<String> supplier) {
120+
return copy().withQueryParam("where", supplier.get());
121+
}
122+
123+
/**
124+
* add additional where query parameter
125+
* @param supplier supplier for the value to be added
126+
* @return ByProjectKeyProductTailoringHead
127+
*/
128+
public ByProjectKeyProductTailoringHead addWhere(final Supplier<String> supplier) {
129+
return copy().addQueryParam("where", supplier.get());
130+
}
131+
132+
/**
133+
* set where with the specified value
134+
* @param op builder for the value to be set
135+
* @return ByProjectKeyProductTailoringHead
136+
*/
137+
public ByProjectKeyProductTailoringHead withWhere(final Function<StringBuilder, StringBuilder> op) {
138+
return copy().withQueryParam("where", op.apply(new StringBuilder()));
139+
}
140+
141+
/**
142+
* add additional where query parameter
143+
* @param op builder for the value to be added
144+
* @return ByProjectKeyProductTailoringHead
145+
*/
146+
public ByProjectKeyProductTailoringHead addWhere(final Function<StringBuilder, StringBuilder> op) {
147+
return copy().addQueryParam("where", op.apply(new StringBuilder()));
148+
}
149+
150+
/**
151+
* set where with the specified values
152+
* @param where values to be set
153+
* @param <TValue> value type
154+
* @return ByProjectKeyProductTailoringHead
155+
*/
156+
public <TValue> ByProjectKeyProductTailoringHead withWhere(final Collection<TValue> where) {
157+
return copy().withoutQueryParam("where")
158+
.addQueryParams(
159+
where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList()));
160+
}
161+
162+
/**
163+
* add additional where query parameters
164+
* @param where values to be added
165+
* @param <TValue> value type
166+
* @return ByProjectKeyProductTailoringHead
167+
*/
168+
public <TValue> ByProjectKeyProductTailoringHead addWhere(final Collection<TValue> where) {
169+
return copy().addQueryParams(
170+
where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList()));
171+
}
172+
173+
@Override
174+
public boolean equals(Object o) {
175+
if (this == o)
176+
return true;
177+
178+
if (o == null || getClass() != o.getClass())
179+
return false;
180+
181+
ByProjectKeyProductTailoringHead that = (ByProjectKeyProductTailoringHead) o;
182+
183+
return new EqualsBuilder().append(projectKey, that.projectKey).isEquals();
184+
}
185+
186+
@Override
187+
public int hashCode() {
188+
return new HashCodeBuilder(17, 37).append(projectKey).toHashCode();
189+
}
190+
191+
@Override
192+
protected ByProjectKeyProductTailoringHead copy() {
193+
return new ByProjectKeyProductTailoringHead(this);
194+
}
195+
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public ByProjectKeyProductTailoringGet get() {
2121
return new ByProjectKeyProductTailoringGet(apiHttpClient, projectKey);
2222
}
2323

24+
public ByProjectKeyProductTailoringHead head() {
25+
return new ByProjectKeyProductTailoringHead(apiHttpClient, projectKey);
26+
}
27+
2428
public ByProjectKeyProductTailoringPost post(
2529
com.commercetools.api.models.product_tailoring.ProductTailoringDraft productTailoringDraft) {
2630
return new ByProjectKeyProductTailoringPost(apiHttpClient, projectKey, productTailoringDraft);

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/approval_rule/ApprovalRule.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.commercetools.api.models.common.BaseResource;
1414
import com.commercetools.api.models.common.CreatedBy;
1515
import com.commercetools.api.models.common.LastModifiedBy;
16+
import com.commercetools.api.models.type.CustomFields;
1617
import com.fasterxml.jackson.annotation.*;
1718
import com.fasterxml.jackson.databind.annotation.*;
1819

@@ -162,6 +163,14 @@ public interface ApprovalRule extends BaseResource {
162163
@JsonProperty("businessUnit")
163164
public BusinessUnitKeyReference getBusinessUnit();
164165

166+
/**
167+
* <p>Custom Fields on the Approval Rule.</p>
168+
* @return custom
169+
*/
170+
@Valid
171+
@JsonProperty("custom")
172+
public CustomFields getCustom();
173+
165174
/**
166175
* <p>Unique identifier of the Approval Rule.</p>
167176
* @param id value to be set
@@ -268,6 +277,13 @@ public interface ApprovalRule extends BaseResource {
268277

269278
public void setBusinessUnit(final BusinessUnitKeyReference businessUnit);
270279

280+
/**
281+
* <p>Custom Fields on the Approval Rule.</p>
282+
* @param custom value to be set
283+
*/
284+
285+
public void setCustom(final CustomFields custom);
286+
271287
/**
272288
* factory method
273289
* @return instance of ApprovalRule
@@ -297,6 +313,7 @@ public static ApprovalRule of(final ApprovalRule template) {
297313
instance.setApprovers(template.getApprovers());
298314
instance.setRequesters(template.getRequesters());
299315
instance.setBusinessUnit(template.getBusinessUnit());
316+
instance.setCustom(template.getCustom());
300317
return instance;
301318
}
302319

@@ -332,6 +349,7 @@ public static ApprovalRule deepCopy(@Nullable final ApprovalRule template) {
332349
.orElse(null));
333350
instance.setBusinessUnit(
334351
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getBusinessUnit()));
352+
instance.setCustom(com.commercetools.api.models.type.CustomFields.deepCopy(template.getCustom()));
335353
return instance;
336354
}
337355

0 commit comments

Comments
 (0)