-
Notifications
You must be signed in to change notification settings - Fork 15
/
ByProjectKeyMessagesByIDGet.java
179 lines (149 loc) · 5.73 KB
/
ByProjectKeyMessagesByIDGet.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
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.Message>> result = apiRoot
* .withProjectKey("{projectKey}")
* .messages()
* .withId("{ID}")
* .get()
* .execute()
* }</code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ByProjectKeyMessagesByIDGet
extends ApiMethod<ByProjectKeyMessagesByIDGet, com.commercetools.api.models.message.Message>
implements com.commercetools.api.client.ExpandableTrait<ByProjectKeyMessagesByIDGet>,
com.commercetools.api.client.ErrorableTrait<ByProjectKeyMessagesByIDGet>,
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyMessagesByIDGet> {
private String projectKey;
private String ID;
public ByProjectKeyMessagesByIDGet(final ApiHttpClient apiHttpClient, String projectKey, String ID) {
super(apiHttpClient);
this.projectKey = projectKey;
this.ID = ID;
}
public ByProjectKeyMessagesByIDGet(ByProjectKeyMessagesByIDGet t) {
super(t);
this.projectKey = t.projectKey;
this.ID = t.ID;
}
@Override
protected ApiHttpRequest buildHttpRequest() {
List<String> params = new ArrayList<>(getQueryParamUriStrings());
String httpRequestPath = String.format("/%s/messages/%s", this.projectKey, this.ID);
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.Message> executeBlocking(final ApiHttpClient client,
final Duration timeout) {
return executeBlocking(client, timeout, com.commercetools.api.models.message.Message.class);
}
@Override
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.message.Message>> execute(
final ApiHttpClient client) {
return execute(client, com.commercetools.api.models.message.Message.class);
}
public String getProjectKey() {
return this.projectKey;
}
public String getID() {
return this.ID;
}
public List<String> getExpand() {
return this.getQueryParam("expand");
}
public void setProjectKey(final String projectKey) {
this.projectKey = projectKey;
}
public void setID(final String ID) {
this.ID = ID;
}
/**
* set expand with the specified value
*/
public <TValue> ByProjectKeyMessagesByIDGet withExpand(final TValue expand) {
return copy().withQueryParam("expand", expand);
}
/**
* add additional expand query parameter
*/
public <TValue> ByProjectKeyMessagesByIDGet addExpand(final TValue expand) {
return copy().addQueryParam("expand", expand);
}
/**
* set expand with the specified value
*/
public ByProjectKeyMessagesByIDGet withExpand(final Supplier<String> supplier) {
return copy().withQueryParam("expand", supplier.get());
}
/**
* add additional expand query parameter
*/
public ByProjectKeyMessagesByIDGet addExpand(final Supplier<String> supplier) {
return copy().addQueryParam("expand", supplier.get());
}
/**
* set expand with the specified value
*/
public ByProjectKeyMessagesByIDGet withExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("expand", op.apply(new StringBuilder()));
}
/**
* add additional expand query parameter
*/
public ByProjectKeyMessagesByIDGet addExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("expand", op.apply(new StringBuilder()));
}
/**
* set expand with the specified values
*/
public <TValue> ByProjectKeyMessagesByIDGet 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> ByProjectKeyMessagesByIDGet addExpand(final List<TValue> expand) {
return copy().addQueryParams(
expand.stream().map(s -> new ParamEntry<>("expand", s.toString())).collect(Collectors.toList()));
}
@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
ByProjectKeyMessagesByIDGet that = (ByProjectKeyMessagesByIDGet) o;
return new EqualsBuilder().append(projectKey, that.projectKey).append(ID, that.ID).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(projectKey).append(ID).toHashCode();
}
@Override
protected ByProjectKeyMessagesByIDGet copy() {
return new ByProjectKeyMessagesByIDGet(this);
}
}