-
Notifications
You must be signed in to change notification settings - Fork 15
/
ByProjectKeyMessagesGet.java
522 lines (445 loc) · 17.3 KB
/
ByProjectKeyMessagesGet.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
package com.commercetools.api.client;
import java.net.URI;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import io.vrap.rmf.base.client.*;
import io.vrap.rmf.base.client.utils.Generated;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
/**
* <p>Deprecated scope: <code>view_orders:{projectKey}</code></p>
*
* <hr>
* <div class=code-example>
* <pre><code class='java'>{@code
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.message.MessagePagedQueryResponse>> result = apiRoot
* .withProjectKey("{projectKey}")
* .messages()
* .get()
* .execute()
* }</code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ByProjectKeyMessagesGet extends
ApiMethod<ByProjectKeyMessagesGet, com.commercetools.api.models.message.MessagePagedQueryResponse> implements
com.commercetools.api.models.PagedQueryResourceRequest<ByProjectKeyMessagesGet, com.commercetools.api.models.message.MessagePagedQueryResponse>,
com.commercetools.api.client.ExpandableTrait<ByProjectKeyMessagesGet>,
com.commercetools.api.client.SortableTrait<ByProjectKeyMessagesGet>,
com.commercetools.api.client.PagingTrait<ByProjectKeyMessagesGet>,
com.commercetools.api.client.QueryTrait<ByProjectKeyMessagesGet>,
com.commercetools.api.client.ErrorableTrait<ByProjectKeyMessagesGet>,
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyMessagesGet> {
private String projectKey;
public ByProjectKeyMessagesGet(final ApiHttpClient apiHttpClient, String projectKey) {
super(apiHttpClient);
this.projectKey = projectKey;
}
public ByProjectKeyMessagesGet(ByProjectKeyMessagesGet t) {
super(t);
this.projectKey = t.projectKey;
}
@Override
protected ApiHttpRequest buildHttpRequest() {
List<String> params = new ArrayList<>(getQueryParamUriStrings());
String httpRequestPath = String.format("/%s/messages", this.projectKey);
if (!params.isEmpty()) {
httpRequestPath += "?" + String.join("&", params);
}
return new ApiHttpRequest(ApiHttpMethod.GET, URI.create(httpRequestPath), getHeaders(), null);
}
@Override
public ApiHttpResponse<com.commercetools.api.models.message.MessagePagedQueryResponse> executeBlocking(
final ApiHttpClient client, final Duration timeout) {
return executeBlocking(client, timeout, com.commercetools.api.models.message.MessagePagedQueryResponse.class);
}
@Override
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.message.MessagePagedQueryResponse>> execute(
final ApiHttpClient client) {
return execute(client, com.commercetools.api.models.message.MessagePagedQueryResponse.class);
}
public String getProjectKey() {
return this.projectKey;
}
public List<String> getExpand() {
return this.getQueryParam("expand");
}
public List<String> getSort() {
return this.getQueryParam("sort");
}
public List<String> getLimit() {
return this.getQueryParam("limit");
}
public List<String> getOffset() {
return this.getQueryParam("offset");
}
public List<String> getWithTotal() {
return this.getQueryParam("withTotal");
}
public List<String> getWhere() {
return this.getQueryParam("where");
}
public void setProjectKey(final String projectKey) {
this.projectKey = projectKey;
}
/**
* set expand with the specified value
*/
public <TValue> ByProjectKeyMessagesGet withExpand(final TValue expand) {
return copy().withQueryParam("expand", expand);
}
/**
* add additional expand query parameter
*/
public <TValue> ByProjectKeyMessagesGet addExpand(final TValue expand) {
return copy().addQueryParam("expand", expand);
}
/**
* set expand with the specified value
*/
public ByProjectKeyMessagesGet withExpand(final Supplier<String> supplier) {
return copy().withQueryParam("expand", supplier.get());
}
/**
* add additional expand query parameter
*/
public ByProjectKeyMessagesGet addExpand(final Supplier<String> supplier) {
return copy().addQueryParam("expand", supplier.get());
}
/**
* set expand with the specified value
*/
public ByProjectKeyMessagesGet withExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("expand", op.apply(new StringBuilder()));
}
/**
* add additional expand query parameter
*/
public ByProjectKeyMessagesGet addExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("expand", op.apply(new StringBuilder()));
}
/**
* set expand with the specified values
*/
public <TValue> ByProjectKeyMessagesGet withExpand(final List<TValue> expand) {
return copy().withoutQueryParam("expand")
.addQueryParams(
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
}
/**
* add additional expand query parameters
*/
public <TValue> ByProjectKeyMessagesGet addExpand(final List<TValue> expand) {
return copy().addQueryParams(
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
}
/**
* set sort with the specified value
*/
public <TValue> ByProjectKeyMessagesGet withSort(final TValue sort) {
return copy().withQueryParam("sort", sort);
}
/**
* add additional sort query parameter
*/
public <TValue> ByProjectKeyMessagesGet addSort(final TValue sort) {
return copy().addQueryParam("sort", sort);
}
/**
* set sort with the specified value
*/
public ByProjectKeyMessagesGet withSort(final Supplier<String> supplier) {
return copy().withQueryParam("sort", supplier.get());
}
/**
* add additional sort query parameter
*/
public ByProjectKeyMessagesGet addSort(final Supplier<String> supplier) {
return copy().addQueryParam("sort", supplier.get());
}
/**
* set sort with the specified value
*/
public ByProjectKeyMessagesGet withSort(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("sort", op.apply(new StringBuilder()));
}
/**
* add additional sort query parameter
*/
public ByProjectKeyMessagesGet addSort(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("sort", op.apply(new StringBuilder()));
}
/**
* set sort with the specified values
*/
public <TValue> ByProjectKeyMessagesGet withSort(final List<TValue> sort) {
return copy().withoutQueryParam("sort")
.addQueryParams(
sort.stream().map(s -> new ParamEntry<>("sort", s.toString())).collect(Collectors.toList()));
}
/**
* add additional sort query parameters
*/
public <TValue> ByProjectKeyMessagesGet addSort(final List<TValue> sort) {
return copy().addQueryParams(
sort.stream().map(s -> new ParamEntry<>("sort", s.toString())).collect(Collectors.toList()));
}
/**
* set limit with the specified value
*/
public <TValue> ByProjectKeyMessagesGet withLimit(final TValue limit) {
return copy().withQueryParam("limit", limit);
}
/**
* add additional limit query parameter
*/
public <TValue> ByProjectKeyMessagesGet addLimit(final TValue limit) {
return copy().addQueryParam("limit", limit);
}
/**
* set limit with the specified value
*/
public ByProjectKeyMessagesGet withLimit(final Supplier<Integer> supplier) {
return copy().withQueryParam("limit", supplier.get());
}
/**
* add additional limit query parameter
*/
public ByProjectKeyMessagesGet addLimit(final Supplier<Integer> supplier) {
return copy().addQueryParam("limit", supplier.get());
}
/**
* set limit with the specified value
*/
public ByProjectKeyMessagesGet withLimit(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("limit", op.apply(new StringBuilder()));
}
/**
* add additional limit query parameter
*/
public ByProjectKeyMessagesGet addLimit(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("limit", op.apply(new StringBuilder()));
}
/**
* set limit with the specified values
*/
public <TValue> ByProjectKeyMessagesGet withLimit(final List<TValue> limit) {
return copy().withoutQueryParam("limit")
.addQueryParams(
limit.stream().map(s -> new ParamEntry<>("limit", s.toString())).collect(Collectors.toList()));
}
/**
* add additional limit query parameters
*/
public <TValue> ByProjectKeyMessagesGet addLimit(final List<TValue> limit) {
return copy().addQueryParams(
limit.stream().map(s -> new ParamEntry<>("limit", s.toString())).collect(Collectors.toList()));
}
/**
* set offset with the specified value
*/
public <TValue> ByProjectKeyMessagesGet withOffset(final TValue offset) {
return copy().withQueryParam("offset", offset);
}
/**
* add additional offset query parameter
*/
public <TValue> ByProjectKeyMessagesGet addOffset(final TValue offset) {
return copy().addQueryParam("offset", offset);
}
/**
* set offset with the specified value
*/
public ByProjectKeyMessagesGet withOffset(final Supplier<Integer> supplier) {
return copy().withQueryParam("offset", supplier.get());
}
/**
* add additional offset query parameter
*/
public ByProjectKeyMessagesGet addOffset(final Supplier<Integer> supplier) {
return copy().addQueryParam("offset", supplier.get());
}
/**
* set offset with the specified value
*/
public ByProjectKeyMessagesGet withOffset(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("offset", op.apply(new StringBuilder()));
}
/**
* add additional offset query parameter
*/
public ByProjectKeyMessagesGet addOffset(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("offset", op.apply(new StringBuilder()));
}
/**
* set offset with the specified values
*/
public <TValue> ByProjectKeyMessagesGet withOffset(final List<TValue> offset) {
return copy().withoutQueryParam("offset")
.addQueryParams(
offset.stream().map(s -> new ParamEntry<>("offset", s.toString())).collect(Collectors.toList()));
}
/**
* add additional offset query parameters
*/
public <TValue> ByProjectKeyMessagesGet addOffset(final List<TValue> offset) {
return copy().addQueryParams(
offset.stream().map(s -> new ParamEntry<>("offset", s.toString())).collect(Collectors.toList()));
}
/**
* set withTotal with the specified value
*/
public <TValue> ByProjectKeyMessagesGet withWithTotal(final TValue withTotal) {
return copy().withQueryParam("withTotal", withTotal);
}
/**
* add additional withTotal query parameter
*/
public <TValue> ByProjectKeyMessagesGet addWithTotal(final TValue withTotal) {
return copy().addQueryParam("withTotal", withTotal);
}
/**
* set withTotal with the specified value
*/
public ByProjectKeyMessagesGet withWithTotal(final Supplier<Boolean> supplier) {
return copy().withQueryParam("withTotal", supplier.get());
}
/**
* add additional withTotal query parameter
*/
public ByProjectKeyMessagesGet addWithTotal(final Supplier<Boolean> supplier) {
return copy().addQueryParam("withTotal", supplier.get());
}
/**
* set withTotal with the specified value
*/
public ByProjectKeyMessagesGet withWithTotal(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("withTotal", op.apply(new StringBuilder()));
}
/**
* add additional withTotal query parameter
*/
public ByProjectKeyMessagesGet addWithTotal(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("withTotal", op.apply(new StringBuilder()));
}
/**
* set withTotal with the specified values
*/
public <TValue> ByProjectKeyMessagesGet withWithTotal(final List<TValue> withTotal) {
return copy().withoutQueryParam("withTotal")
.addQueryParams(withTotal.stream()
.map(s -> new ParamEntry<>("withTotal", s.toString()))
.collect(Collectors.toList()));
}
/**
* add additional withTotal query parameters
*/
public <TValue> ByProjectKeyMessagesGet addWithTotal(final List<TValue> withTotal) {
return copy().addQueryParams(
withTotal.stream().map(s -> new ParamEntry<>("withTotal", s.toString())).collect(Collectors.toList()));
}
/**
* set where with the specified value
*/
public <TValue> ByProjectKeyMessagesGet withWhere(final TValue where) {
return copy().withQueryParam("where", where);
}
/**
* add additional where query parameter
*/
public <TValue> ByProjectKeyMessagesGet addWhere(final TValue where) {
return copy().addQueryParam("where", where);
}
/**
* set where with the specified value
*/
public ByProjectKeyMessagesGet withWhere(final Supplier<String> supplier) {
return copy().withQueryParam("where", supplier.get());
}
/**
* add additional where query parameter
*/
public ByProjectKeyMessagesGet addWhere(final Supplier<String> supplier) {
return copy().addQueryParam("where", supplier.get());
}
/**
* set where with the specified value
*/
public ByProjectKeyMessagesGet withWhere(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("where", op.apply(new StringBuilder()));
}
/**
* add additional where query parameter
*/
public ByProjectKeyMessagesGet addWhere(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("where", op.apply(new StringBuilder()));
}
/**
* set where with the specified values
*/
public <TValue> ByProjectKeyMessagesGet withWhere(final List<TValue> where) {
return copy().withoutQueryParam("where")
.addQueryParams(
where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList()));
}
/**
* add additional where query parameters
*/
public <TValue> ByProjectKeyMessagesGet addWhere(final List<TValue> where) {
return copy().addQueryParams(
where.stream().map(s -> new ParamEntry<>("where", s.toString())).collect(Collectors.toList()));
}
/**
* set predicateVar with the specificied value
*/
public <TValue> ByProjectKeyMessagesGet withPredicateVar(final String varName, final TValue predicateVar) {
return copy().withQueryParam(String.format("var.%s", varName), predicateVar);
}
/**
* add additional predicateVar query parameter
*/
public <TValue> ByProjectKeyMessagesGet addPredicateVar(final String varName, final TValue predicateVar) {
return copy().addQueryParam(String.format("var.%s", varName), predicateVar);
}
/**
* set predicateVar with the specificied values
*/
public <TValue> ByProjectKeyMessagesGet withPredicateVar(final String varName, final List<TValue> predicateVar) {
final String placeholderName = String.format("var.%s", varName);
return copy().withoutQueryParam(placeholderName)
.addQueryParams(predicateVar.stream()
.map(s -> new ParamEntry<>(placeholderName, s.toString()))
.collect(Collectors.toList()));
}
/**
* add additional predicateVar query parameters
*/
public <TValue> ByProjectKeyMessagesGet addPredicateVar(final String varName, final List<TValue> predicateVar) {
final String placeholderName = String.format("var.%s", varName);
return copy().addQueryParams(predicateVar.stream()
.map(s -> new ParamEntry<>(placeholderName, s.toString()))
.collect(Collectors.toList()));
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ByProjectKeyMessagesGet that = (ByProjectKeyMessagesGet) o;
return new EqualsBuilder().append(projectKey, that.projectKey).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(projectKey).toHashCode();
}
@Override
protected ByProjectKeyMessagesGet copy() {
return new ByProjectKeyMessagesGet(this);
}
}