-
Notifications
You must be signed in to change notification settings - Fork 15
/
ByProjectKeyInventoryKeyByKeyDelete.java
245 lines (206 loc) · 8.29 KB
/
ByProjectKeyInventoryKeyByKeyDelete.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
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>Produces the InventoryEntryDeleted Message.</p>
*
* <hr>
* <div class=code-example>
* <pre><code class='java'>{@code
* CompletableFuture<ApiHttpResponse<com.commercetools.api.models.inventory.InventoryEntry>> result = apiRoot
* .withProjectKey("{projectKey}")
* .inventory()
* .withKey("{key}")
* .delete()
* .withVersion(version)
* .execute()
* }</code></pre>
* </div>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class ByProjectKeyInventoryKeyByKeyDelete
extends ApiMethod<ByProjectKeyInventoryKeyByKeyDelete, com.commercetools.api.models.inventory.InventoryEntry>
implements com.commercetools.api.client.VersionedTrait<ByProjectKeyInventoryKeyByKeyDelete>,
com.commercetools.api.client.ConflictingTrait<ByProjectKeyInventoryKeyByKeyDelete>,
com.commercetools.api.client.ExpandableTrait<ByProjectKeyInventoryKeyByKeyDelete>,
com.commercetools.api.client.ErrorableTrait<ByProjectKeyInventoryKeyByKeyDelete>,
com.commercetools.api.client.Deprecatable200Trait<ByProjectKeyInventoryKeyByKeyDelete> {
private String projectKey;
private String key;
public ByProjectKeyInventoryKeyByKeyDelete(final ApiHttpClient apiHttpClient, String projectKey, String key) {
super(apiHttpClient);
this.projectKey = projectKey;
this.key = key;
}
public ByProjectKeyInventoryKeyByKeyDelete(ByProjectKeyInventoryKeyByKeyDelete t) {
super(t);
this.projectKey = t.projectKey;
this.key = t.key;
}
@Override
protected ApiHttpRequest buildHttpRequest() {
List<String> params = new ArrayList<>(getQueryParamUriStrings());
String httpRequestPath = String.format("/%s/inventory/key=%s", this.projectKey, this.key);
if (!params.isEmpty()) {
httpRequestPath += "?" + String.join("&", params);
}
return new ApiHttpRequest(ApiHttpMethod.DELETE, URI.create(httpRequestPath), getHeaders(), null);
}
@Override
public ApiHttpResponse<com.commercetools.api.models.inventory.InventoryEntry> executeBlocking(
final ApiHttpClient client, final Duration timeout) {
return executeBlocking(client, timeout, com.commercetools.api.models.inventory.InventoryEntry.class);
}
@Override
public CompletableFuture<ApiHttpResponse<com.commercetools.api.models.inventory.InventoryEntry>> execute(
final ApiHttpClient client) {
return execute(client, com.commercetools.api.models.inventory.InventoryEntry.class);
}
public String getProjectKey() {
return this.projectKey;
}
public String getKey() {
return this.key;
}
public List<String> getVersion() {
return this.getQueryParam("version");
}
public List<String> getExpand() {
return this.getQueryParam("expand");
}
public void setProjectKey(final String projectKey) {
this.projectKey = projectKey;
}
public void setKey(final String key) {
this.key = key;
}
/**
* set version with the specified value
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete withVersion(final TValue version) {
return copy().withQueryParam("version", version);
}
/**
* add additional version query parameter
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete addVersion(final TValue version) {
return copy().addQueryParam("version", version);
}
/**
* set version with the specified value
*/
public ByProjectKeyInventoryKeyByKeyDelete withVersion(final Supplier<Long> supplier) {
return copy().withQueryParam("version", supplier.get());
}
/**
* add additional version query parameter
*/
public ByProjectKeyInventoryKeyByKeyDelete addVersion(final Supplier<Long> supplier) {
return copy().addQueryParam("version", supplier.get());
}
/**
* set version with the specified value
*/
public ByProjectKeyInventoryKeyByKeyDelete withVersion(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("version", op.apply(new StringBuilder()));
}
/**
* add additional version query parameter
*/
public ByProjectKeyInventoryKeyByKeyDelete addVersion(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("version", op.apply(new StringBuilder()));
}
/**
* set version with the specified values
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete withVersion(final List<TValue> version) {
return copy().withoutQueryParam("version")
.addQueryParams(
version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList()));
}
/**
* add additional version query parameters
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete addVersion(final List<TValue> version) {
return copy().addQueryParams(
version.stream().map(s -> new ParamEntry<>("version", s.toString())).collect(Collectors.toList()));
}
/**
* set expand with the specified value
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete withExpand(final TValue expand) {
return copy().withQueryParam("expand", expand);
}
/**
* add additional expand query parameter
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete addExpand(final TValue expand) {
return copy().addQueryParam("expand", expand);
}
/**
* set expand with the specified value
*/
public ByProjectKeyInventoryKeyByKeyDelete withExpand(final Supplier<String> supplier) {
return copy().withQueryParam("expand", supplier.get());
}
/**
* add additional expand query parameter
*/
public ByProjectKeyInventoryKeyByKeyDelete addExpand(final Supplier<String> supplier) {
return copy().addQueryParam("expand", supplier.get());
}
/**
* set expand with the specified value
*/
public ByProjectKeyInventoryKeyByKeyDelete withExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().withQueryParam("expand", op.apply(new StringBuilder()));
}
/**
* add additional expand query parameter
*/
public ByProjectKeyInventoryKeyByKeyDelete addExpand(final Function<StringBuilder, StringBuilder> op) {
return copy().addQueryParam("expand", op.apply(new StringBuilder()));
}
/**
* set expand with the specified values
*/
public <TValue> ByProjectKeyInventoryKeyByKeyDelete 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> ByProjectKeyInventoryKeyByKeyDelete 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;
ByProjectKeyInventoryKeyByKeyDelete that = (ByProjectKeyInventoryKeyByKeyDelete) o;
return new EqualsBuilder().append(projectKey, that.projectKey).append(key, that.key).isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(projectKey).append(key).toHashCode();
}
@Override
protected ByProjectKeyInventoryKeyByKeyDelete copy() {
return new ByProjectKeyInventoryKeyByKeyDelete(this);
}
}