Skip to content

Commit 3172f0e

Browse files
committed
build(codegen): updating SDK
1 parent 0621fc2 commit 3172f0e

File tree

5 files changed

+218
-0
lines changed

5 files changed

+218
-0
lines changed

changes.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
**Api changes**
2+
3+
<details>
4+
<summary>Added Method(s)</summary>
5+
6+
- added method `apiRoot.withProjectKey().productTailoring().head()`
7+
</details>
8+
19
**Import changes**
210

311
<details>
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

+4
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/test/java-generated/com/commercetools/api/client/resource/ByProjectKeyProductTailoringTest.java

+10
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ public static Object[][] requestWithMethodParameters() {
103103
"get", "test_projectKey/product-tailoring?var.varName=var.varName", },
104104
new Object[] { apiRoot.withProjectKey("test_projectKey").productTailoring().get().createHttpRequest(),
105105
"get", "test_projectKey/product-tailoring", },
106+
new Object[] { apiRoot.withProjectKey("test_projectKey")
107+
.productTailoring()
108+
.head()
109+
.withWhere("where")
110+
.createHttpRequest(), "head", "test_projectKey/product-tailoring?where=where", },
111+
new Object[] { apiRoot.withProjectKey("test_projectKey").productTailoring().head().createHttpRequest(),
112+
"head", "test_projectKey/product-tailoring", },
106113
new Object[] { apiRoot.withProjectKey("test_projectKey")
107114
.productTailoring()
108115
.post(com.commercetools.api.models.product_tailoring.ProductTailoringDraft.of())
@@ -130,6 +137,9 @@ public static Object[][] executeMethodParameters() {
130137
.get()
131138
.withPredicateVar("varName", "var.varName"), },
132139
new Object[] { apiRoot.withProjectKey("test_projectKey").productTailoring().get(), },
140+
new Object[] {
141+
apiRoot.withProjectKey("test_projectKey").productTailoring().head().withWhere("where"), },
142+
new Object[] { apiRoot.withProjectKey("test_projectKey").productTailoring().head(), },
133143
new Object[] { apiRoot.withProjectKey("test_projectKey")
134144
.productTailoring()
135145
.post(com.commercetools.api.models.product_tailoring.ProductTailoringDraft.of())

references.txt

+1
Original file line numberDiff line numberDiff line change
@@ -313,3 +313,4 @@ c77ec902f368c2c31505fcb65a835ce148350077
313313
4d99474bc43b90f392085d18a75bb826c4cb25e0
314314
e985f4b7aa55610705ee49bd3eb645c2fd03eb6c
315315
3bde1efd0d5dbff77065d355e9d00e8a0e8f466a
316+
c27603f949e869148570ebb8bd3ec6db34a985b7

0 commit comments

Comments
 (0)