|
18 | 18 | package org.eclipse.microprofile.openapi.models; |
19 | 19 |
|
20 | 20 | import java.util.List; |
| 21 | +import java.util.Map; |
21 | 22 |
|
22 | 23 | import org.eclipse.microprofile.openapi.models.info.Info; |
23 | 24 | import org.eclipse.microprofile.openapi.models.security.SecurityRequirement; |
@@ -275,6 +276,57 @@ default OpenAPI paths(Paths paths) { |
275 | 276 | return this; |
276 | 277 | } |
277 | 278 |
|
| 279 | + /** |
| 280 | + * Returns the webhooks property of this OpenAPI instance. |
| 281 | + * |
| 282 | + * @return a copy Map (potentially immutable) of named webhook definitions |
| 283 | + * @since 4.0 |
| 284 | + */ |
| 285 | + Map<String, PathItem> getWebhooks(); |
| 286 | + |
| 287 | + /** |
| 288 | + * Sets the webhooks property of this OpenAPI instance. |
| 289 | + * |
| 290 | + * @param webhooks |
| 291 | + * a map of named webhook definitions |
| 292 | + * @since 4.0 |
| 293 | + */ |
| 294 | + void setWebhooks(Map<String, PathItem> webhooks); |
| 295 | + |
| 296 | + /** |
| 297 | + * Sets the webhooks property of this OpenAPI instance. |
| 298 | + * |
| 299 | + * @param webhooks |
| 300 | + * a map of named webhook definitions |
| 301 | + * @return the current Schema instance |
| 302 | + * @since 4.0 |
| 303 | + */ |
| 304 | + default OpenAPI webhooks(Map<String, PathItem> webhooks) { |
| 305 | + setWebhooks(webhooks); |
| 306 | + return this; |
| 307 | + } |
| 308 | + |
| 309 | + /** |
| 310 | + * Adds a webhook definition. |
| 311 | + * |
| 312 | + * @param name |
| 313 | + * unique name of the webhook to add |
| 314 | + * @param webhook |
| 315 | + * webhook definition to add |
| 316 | + * @return the current Schema instance |
| 317 | + * @since 4.0 |
| 318 | + */ |
| 319 | + OpenAPI addWebhook(String name, PathItem webhook); |
| 320 | + |
| 321 | + /** |
| 322 | + * Removes a webhook definition. |
| 323 | + * |
| 324 | + * @param name |
| 325 | + * unique name of the webhook to remove |
| 326 | + * @since 4.0 |
| 327 | + */ |
| 328 | + void removeWebhook(String name); |
| 329 | + |
278 | 330 | /** |
279 | 331 | * Returns the components property from an OpenAPI instance. |
280 | 332 | * |
|
0 commit comments