Skip to content

Commit 02515d4

Browse files
author
Auto Mation
committed
TASK: Updating SDK
1 parent 284dfc0 commit 02515d4

33 files changed

+2486
-38
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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+
import java.util.function.Function;
10+
import java.util.function.Supplier;
11+
import java.util.stream.Collectors;
12+
13+
import io.vrap.rmf.base.client.*;
14+
import io.vrap.rmf.base.client.utils.Generated;
15+
16+
import org.apache.commons.lang3.builder.EqualsBuilder;
17+
import org.apache.commons.lang3.builder.HashCodeBuilder;
18+
19+
/**
20+
*
21+
*
22+
* <hr>
23+
* <div class=code-example>
24+
* <pre><code class='java'>{@code
25+
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.quote.Quote>> result = apiRoot
26+
* .withProjectKey("{projectKey}")
27+
* .me()
28+
* .quotes()
29+
* .withId("{ID}")
30+
* .get()
31+
* .execute()
32+
* }</code></pre>
33+
* </div>
34+
*/
35+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
36+
public class ByProjectKeyMeQuotesByIDGet
37+
extends ApiMethod<ByProjectKeyMeQuotesByIDGet, com.commercetools.api.models.quote.Quote>
38+
implements com.commercetools.api.client.ExpandableTrait<ByProjectKeyMeQuotesByIDGet>,
39+
com.commercetools.api.client.ErrorableTrait<ByProjectKeyMeQuotesByIDGet>,
40+
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyMeQuotesByIDGet> {
41+
42+
private String projectKey;
43+
private String ID;
44+
45+
public ByProjectKeyMeQuotesByIDGet(final ApiHttpClient apiHttpClient, String projectKey, String ID) {
46+
super(apiHttpClient);
47+
this.projectKey = projectKey;
48+
this.ID = ID;
49+
}
50+
51+
public ByProjectKeyMeQuotesByIDGet(ByProjectKeyMeQuotesByIDGet t) {
52+
super(t);
53+
this.projectKey = t.projectKey;
54+
this.ID = t.ID;
55+
}
56+
57+
@Override
58+
protected ApiHttpRequest buildHttpRequest() {
59+
List<String> params = new ArrayList<>(getQueryParamUriStrings());
60+
String httpRequestPath = String.format("/%s/me/quotes/%s", this.projectKey, this.ID);
61+
if (!params.isEmpty()) {
62+
httpRequestPath += "?" + String.join("&", params);
63+
}
64+
return new ApiHttpRequest(ApiHttpMethod.GET, URI.create(httpRequestPath), getHeaders(), null);
65+
}
66+
67+
@Override
68+
public ApiHttpResponse<com.commercetools.api.models.quote.Quote> executeBlocking(final ApiHttpClient client,
69+
final Duration timeout) {
70+
return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class);
71+
}
72+
73+
@Override
74+
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.quote.Quote>> execute(
75+
final ApiHttpClient client) {
76+
return execute(client, com.commercetools.api.models.quote.Quote.class);
77+
}
78+
79+
public String getProjectKey() {
80+
return this.projectKey;
81+
}
82+
83+
public String getID() {
84+
return this.ID;
85+
}
86+
87+
public List<String> getExpand() {
88+
return this.getQueryParam("expand");
89+
}
90+
91+
public void setProjectKey(final String projectKey) {
92+
this.projectKey = projectKey;
93+
}
94+
95+
public void setID(final String ID) {
96+
this.ID = ID;
97+
}
98+
99+
/**
100+
* set expand with the specified value
101+
*/
102+
public <TValue> ByProjectKeyMeQuotesByIDGet withExpand(final TValue expand) {
103+
return copy().withQueryParam("expand", expand);
104+
}
105+
106+
/**
107+
* add additional expand query parameter
108+
*/
109+
public <TValue> ByProjectKeyMeQuotesByIDGet addExpand(final TValue expand) {
110+
return copy().addQueryParam("expand", expand);
111+
}
112+
113+
/**
114+
* set expand with the specified value
115+
*/
116+
public ByProjectKeyMeQuotesByIDGet withExpand(final Supplier<String> supplier) {
117+
return copy().withQueryParam("expand", supplier.get());
118+
}
119+
120+
/**
121+
* add additional expand query parameter
122+
*/
123+
public ByProjectKeyMeQuotesByIDGet addExpand(final Supplier<String> supplier) {
124+
return copy().addQueryParam("expand", supplier.get());
125+
}
126+
127+
/**
128+
* set expand with the specified value
129+
*/
130+
public ByProjectKeyMeQuotesByIDGet withExpand(final Function<StringBuilder, StringBuilder> op) {
131+
return copy().withQueryParam("expand", op.apply(new StringBuilder()));
132+
}
133+
134+
/**
135+
* add additional expand query parameter
136+
*/
137+
public ByProjectKeyMeQuotesByIDGet addExpand(final Function<StringBuilder, StringBuilder> op) {
138+
return copy().addQueryParam("expand", op.apply(new StringBuilder()));
139+
}
140+
141+
/**
142+
* set expand with the specified values
143+
*/
144+
public <TValue> ByProjectKeyMeQuotesByIDGet withExpand(final List<TValue> expand) {
145+
return copy().withoutQueryParam("expand")
146+
.addQueryParams(
147+
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
148+
}
149+
150+
/**
151+
* add additional expand query parameters
152+
*/
153+
public <TValue> ByProjectKeyMeQuotesByIDGet addExpand(final List<TValue> expand) {
154+
return copy().addQueryParams(
155+
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
156+
}
157+
158+
@Override
159+
public boolean equals(Object o) {
160+
if (this == o)
161+
return true;
162+
163+
if (o == null || getClass() != o.getClass())
164+
return false;
165+
166+
ByProjectKeyMeQuotesByIDGet that = (ByProjectKeyMeQuotesByIDGet) o;
167+
168+
return new EqualsBuilder().append(projectKey, that.projectKey).append(ID, that.ID).isEquals();
169+
}
170+
171+
@Override
172+
public int hashCode() {
173+
return new HashCodeBuilder(17, 37).append(projectKey).append(ID).toHashCode();
174+
}
175+
176+
@Override
177+
protected ByProjectKeyMeQuotesByIDGet copy() {
178+
return new ByProjectKeyMeQuotesByIDGet(this);
179+
}
180+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,202 @@
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+
import java.util.function.Function;
10+
import java.util.function.Supplier;
11+
import java.util.stream.Collectors;
12+
13+
import io.vrap.rmf.base.client.*;
14+
import io.vrap.rmf.base.client.utils.Generated;
15+
16+
import org.apache.commons.lang3.builder.EqualsBuilder;
17+
import org.apache.commons.lang3.builder.HashCodeBuilder;
18+
19+
/**
20+
*
21+
*
22+
* <hr>
23+
* <div class=code-example>
24+
* <pre><code class='java'>{@code
25+
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.quote.Quote>> result = apiRoot
26+
* .withProjectKey("{projectKey}")
27+
* .me()
28+
* .quotes()
29+
* .withId("{ID}")
30+
* .post(null)
31+
* .execute()
32+
* }</code></pre>
33+
* </div>
34+
*/
35+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
36+
public class ByProjectKeyMeQuotesByIDPost extends
37+
BodyApiMethod<ByProjectKeyMeQuotesByIDPost, com.commercetools.api.models.quote.Quote, com.commercetools.api.models.me.MyQuoteUpdate>
38+
implements com.commercetools.api.client.ConflictingTrait<ByProjectKeyMeQuotesByIDPost>,
39+
com.commercetools.api.client.ExpandableTrait<ByProjectKeyMeQuotesByIDPost>,
40+
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyMeQuotesByIDPost>,
41+
com.commercetools.api.client.ErrorableTrait<ByProjectKeyMeQuotesByIDPost> {
42+
43+
private String projectKey;
44+
private String ID;
45+
46+
private com.commercetools.api.models.me.MyQuoteUpdate myQuoteUpdate;
47+
48+
public ByProjectKeyMeQuotesByIDPost(final ApiHttpClient apiHttpClient, String projectKey, String ID,
49+
com.commercetools.api.models.me.MyQuoteUpdate myQuoteUpdate) {
50+
super(apiHttpClient);
51+
this.projectKey = projectKey;
52+
this.ID = ID;
53+
this.myQuoteUpdate = myQuoteUpdate;
54+
}
55+
56+
public ByProjectKeyMeQuotesByIDPost(ByProjectKeyMeQuotesByIDPost t) {
57+
super(t);
58+
this.projectKey = t.projectKey;
59+
this.ID = t.ID;
60+
this.myQuoteUpdate = t.myQuoteUpdate;
61+
}
62+
63+
@Override
64+
protected ApiHttpRequest buildHttpRequest() {
65+
List<String> params = new ArrayList<>(getQueryParamUriStrings());
66+
String httpRequestPath = String.format("/%s/me/quotes/%s", this.projectKey, this.ID);
67+
if (!params.isEmpty()) {
68+
httpRequestPath += "?" + String.join("&", params);
69+
}
70+
return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(),
71+
io.vrap.rmf.base.client.utils.json.JsonUtils
72+
.executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(myQuoteUpdate)));
73+
74+
}
75+
76+
@Override
77+
public ApiHttpResponse<com.commercetools.api.models.quote.Quote> executeBlocking(final ApiHttpClient client,
78+
final Duration timeout) {
79+
return executeBlocking(client, timeout, com.commercetools.api.models.quote.Quote.class);
80+
}
81+
82+
@Override
83+
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.quote.Quote>> execute(
84+
final ApiHttpClient client) {
85+
return execute(client, com.commercetools.api.models.quote.Quote.class);
86+
}
87+
88+
public String getProjectKey() {
89+
return this.projectKey;
90+
}
91+
92+
public String getID() {
93+
return this.ID;
94+
}
95+
96+
public List<String> getExpand() {
97+
return this.getQueryParam("expand");
98+
}
99+
100+
public void setProjectKey(final String projectKey) {
101+
this.projectKey = projectKey;
102+
}
103+
104+
public void setID(final String ID) {
105+
this.ID = ID;
106+
}
107+
108+
/**
109+
* set expand with the specified value
110+
*/
111+
public <TValue> ByProjectKeyMeQuotesByIDPost withExpand(final TValue expand) {
112+
return copy().withQueryParam("expand", expand);
113+
}
114+
115+
/**
116+
* add additional expand query parameter
117+
*/
118+
public <TValue> ByProjectKeyMeQuotesByIDPost addExpand(final TValue expand) {
119+
return copy().addQueryParam("expand", expand);
120+
}
121+
122+
/**
123+
* set expand with the specified value
124+
*/
125+
public ByProjectKeyMeQuotesByIDPost withExpand(final Supplier<String> supplier) {
126+
return copy().withQueryParam("expand", supplier.get());
127+
}
128+
129+
/**
130+
* add additional expand query parameter
131+
*/
132+
public ByProjectKeyMeQuotesByIDPost addExpand(final Supplier<String> supplier) {
133+
return copy().addQueryParam("expand", supplier.get());
134+
}
135+
136+
/**
137+
* set expand with the specified value
138+
*/
139+
public ByProjectKeyMeQuotesByIDPost withExpand(final Function<StringBuilder, StringBuilder> op) {
140+
return copy().withQueryParam("expand", op.apply(new StringBuilder()));
141+
}
142+
143+
/**
144+
* add additional expand query parameter
145+
*/
146+
public ByProjectKeyMeQuotesByIDPost addExpand(final Function<StringBuilder, StringBuilder> op) {
147+
return copy().addQueryParam("expand", op.apply(new StringBuilder()));
148+
}
149+
150+
/**
151+
* set expand with the specified values
152+
*/
153+
public <TValue> ByProjectKeyMeQuotesByIDPost withExpand(final List<TValue> expand) {
154+
return copy().withoutQueryParam("expand")
155+
.addQueryParams(
156+
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
157+
}
158+
159+
/**
160+
* add additional expand query parameters
161+
*/
162+
public <TValue> ByProjectKeyMeQuotesByIDPost addExpand(final List<TValue> expand) {
163+
return copy().addQueryParams(
164+
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
165+
}
166+
167+
public com.commercetools.api.models.me.MyQuoteUpdate getBody() {
168+
return myQuoteUpdate;
169+
}
170+
171+
public ByProjectKeyMeQuotesByIDPost withBody(com.commercetools.api.models.me.MyQuoteUpdate myQuoteUpdate) {
172+
ByProjectKeyMeQuotesByIDPost t = copy();
173+
t.myQuoteUpdate = myQuoteUpdate;
174+
return t;
175+
}
176+
177+
@Override
178+
public boolean equals(Object o) {
179+
if (this == o)
180+
return true;
181+
182+
if (o == null || getClass() != o.getClass())
183+
return false;
184+
185+
ByProjectKeyMeQuotesByIDPost that = (ByProjectKeyMeQuotesByIDPost) o;
186+
187+
return new EqualsBuilder().append(projectKey, that.projectKey)
188+
.append(ID, that.ID)
189+
.append(myQuoteUpdate, that.myQuoteUpdate)
190+
.isEquals();
191+
}
192+
193+
@Override
194+
public int hashCode() {
195+
return new HashCodeBuilder(17, 37).append(projectKey).append(ID).append(myQuoteUpdate).toHashCode();
196+
}
197+
198+
@Override
199+
protected ByProjectKeyMeQuotesByIDPost copy() {
200+
return new ByProjectKeyMeQuotesByIDPost(this);
201+
}
202+
}

0 commit comments

Comments
 (0)