-
Notifications
You must be signed in to change notification settings - Fork 81
/
Operation.java
381 lines (335 loc) · 11.6 KB
/
Operation.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
/**
* Copyright (c) 2017 Contributors to the Eclipse Foundation
* Copyright 2017 SmartBear Software
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.eclipse.microprofile.openapi.models;
import java.util.List;
import java.util.Map;
import org.eclipse.microprofile.openapi.models.callbacks.Callback;
import org.eclipse.microprofile.openapi.models.parameters.Parameter;
import org.eclipse.microprofile.openapi.models.parameters.RequestBody;
import org.eclipse.microprofile.openapi.models.responses.APIResponses;
import org.eclipse.microprofile.openapi.models.security.SecurityRequirement;
import org.eclipse.microprofile.openapi.models.servers.Server;
/**
* Operation
* <p>
* Describes a single API operation on a path.
* <p>
*
* @see <a href= "https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#operationObject">OpenAPI Specification Operation
* Object</a>
*/
public interface Operation extends Constructible, Extensible<Operation> {
/**
* Returns the tags property from an Operation instance.
*
* @return a list of the operation's tags
**/
List<String> getTags();
/**
* Sets this Operation's tags property to the given tags.
*
* @param tags a list of tags for API documentation control
**/
void setTags(List<String> tags);
/**
* Sets this Operation's tags property to the given tags.
*
* @param tags a list of tags for API documentation control
* @return the current Operation object
**/
default Operation tags(List<String> tags) {
setTags(tags);
return this;
}
/**
* Adds the given tag to this Operation's list of tags.
*
* @param tag a tag for API documentation control
* @return the current Operation object
**/
Operation addTag(String tag);
/**
* Returns the summary property from an Operation instance.
*
* @return a short summary of what the operation does
**/
String getSummary();
/**
* Sets this Operation's summary property to the given string.
*
* @param summary a short summary of what the operation does
**/
void setSummary(String summary);
/**
* Sets this Operation's summary property to the given string.
*
* @param summary a short summary of what the operation does
* @return the current Operation object
**/
default Operation summary(String summary) {
setSummary(summary);
return this;
}
/**
* Returns the description property from an Operation instance.
*
* @return a verbose explanation of the operation behavior
**/
String getDescription();
/**
* Sets this Operation's description property to the given string.
*
* @param description a verbose explanation of the operation behavior
**/
void setDescription(String description);
/**
* Sets this Operation's description property to the given string.
*
* @param description a verbose explanation of the operation behavior
* @return the current Operation object
**/
default Operation description(String description) {
setDescription(description);
return this;
}
/**
* Returns the externalDocs property from an Operation instance.
*
* @return additional external documentation for this operation
**/
ExternalDocumentation getExternalDocs();
/**
* Sets this Operation's externalDocs property to the given object.
*
* @param externalDocs additional external documentation for this operation
**/
void setExternalDocs(ExternalDocumentation externalDocs);
/**
* Sets this Operation's externalDocs property to the given object.
*
* @param externalDocs additional external documentation for this operation
* @return the current Operation object
**/
default Operation externalDocs(ExternalDocumentation externalDocs) {
setExternalDocs(externalDocs);
return this;
}
/**
* Returns the operationId property from an Operation instance.
*
* @return unique string used to identify the operation
**/
String getOperationId();
/**
* Sets this Operation's operationId property to the given string.
*
* @param operationId unique string used to identify the operation
**/
void setOperationId(String operationId);
/**
* Sets this Operation's operationId property to the given string.
*
* @param operationId unique string used to identify the operation
* @return the current Operation object
**/
default Operation operationId(String operationId) {
setOperationId(operationId);
return this;
}
/**
* Returns the parameters property from an Operation instance.
*
* @return a list of parameters that are applicable for this operation
**/
List<Parameter> getParameters();
/**
* Sets this Operation's parameters property to the given parameter list.
*
* @param parameters a list of parameters that are applicable for this operation
**/
void setParameters(List<Parameter> parameters);
/**
* Sets this Operation's parameters property to the given parameter list.
*
* @param parameters a list of parameters that are applicable for this operation
* @return the current Operation object
**/
default Operation parameters(List<Parameter> parameters) {
setParameters(parameters);
return this;
}
/**
* Adds the given parameter item to this Operation's list of parameters.
*
* @param parameter a parameter that is applicable for this operation
* @return the current Operation object
**/
Operation addParameter(Parameter parameter);
/**
* Returns the requestBody property from an Operation instance.
*
* @return the request body applicable for this operation
**/
RequestBody getRequestBody();
/**
* Sets this Operation's requestBody property to the given object.
*
* @param requestBody the request body applicable for this operation
**/
void setRequestBody(RequestBody requestBody);
/**
* Sets this Operation's requestBody property to the given object.
*
* @param requestBody the request body applicable for this operation
* @return the current Operation object
**/
default Operation requestBody(RequestBody requestBody) {
setRequestBody(requestBody);
return this;
}
/**
* Returns the responses property from an Operation instance.
*
* @return collection of possible responses from executing this operation
**/
APIResponses getResponses();
/**
* Sets this Operation's responses property to the given responses.
*
* @param responses collection of possible responses from executing this operation
**/
void setResponses(APIResponses responses);
/**
* Sets this Operation's responses property to the given responses.
*
* @param responses collection of possible responses from executing this operation
* @return the current Operation object
**/
default Operation responses(APIResponses responses) {
setResponses(responses);
return this;
}
/**
* Returns the callbacks property from an Operation instance.
*
* @return map of possible out-of-band callbacks related to the operation
**/
Map<String, Callback> getCallbacks();
/**
* Sets this Operation's callbacks property to the given map.
*
* @param callbacks map of possible out-of-band callbacks related to the operation. The key value must be the correct format for this field.
**/
void setCallbacks(Map<String, Callback> callbacks);
/**
* Sets this Operation's callbacks property to the given map.
*
* @param callbacks map of possible out-of-band callbacks related to the operation. The key value must be the correct format for this field.
* @return the current Operation object
**/
default Operation callbacks(Map<String, Callback> callbacks) {
setCallbacks(callbacks);
return this;
}
/**
* Adds the given callback item to this Operation's list of callbacks.
*
* @param callback a callback that is applicable for this operation
* @return the current Operation object
**/
Operation addCallback(Callback callback);
/**
* Returns the deprecated property from an Operation instance.
*
* @return declaration whether this operation is deprecated
**/
Boolean getDeprecated();
/**
* Sets this Operation's deprecated property to the given value.
*
* @param deprecated declaration whether this operation is deprecated
**/
void setDeprecated(Boolean deprecated);
/**
* Sets this Operation's deprecated property to the given value.
*
* @param deprecated declaration whether this operation is deprecated
* @return the current Operation object
**/
default Operation deprecated(Boolean deprecated) {
setDeprecated(deprecated);
return this;
}
/**
* Returns the security property from an Operation instance.
*
* @return a list of which security mechanisms can be used for this operation
**/
List<SecurityRequirement> getSecurity();
/**
* Sets this Operation's security property to the given list.
*
* @param security list of which security mechanisms can be used for this operation
**/
void setSecurity(List<SecurityRequirement> security);
/**
* Sets this Operation's security property to the given list.
*
* @param security list of which security mechanisms can be used for this operation
* @return the current Operation object
**/
default Operation security(List<SecurityRequirement> security) {
setSecurity(security);
return this;
}
/**
* Adds the given security requirement item to this Operation's list of security mechanisms.
*
* @param securityRequirement security mechanism which can be used for this operation
* @return the current Operation object
**/
Operation addSecurityRequirement(SecurityRequirement securityRequirement);
/**
* Returns the servers property from an Operation instance.
*
* @return a list of servers to service this operation
**/
List<Server> getServers();
/**
* Sets this Operation's servers property to the given list.
*
* @param servers list of servers to service this operation
**/
void setServers(List<Server> servers);
/**
* Sets this Operation's servers property to the given list.
*
* @param servers list of servers to service this operation
* @return the current Operation object
**/
default Operation servers(List<Server> servers) {
setServers(servers);
return this;
}
/**
* Adds the given server to this Operation's list of servers.
*
* @param server server which can service this operation
* @return the current Operation object
**/
Operation addServer(Server server);
}