|
1 |
| -package io.swagger.api; |
2 |
| - |
3 |
| -import io.swagger.model.*; |
4 |
| -import io.swagger.api.StoreApiService; |
5 |
| -import io.swagger.api.factories.StoreApiServiceFactory; |
6 |
| - |
7 |
| -import io.swagger.annotations.ApiParam; |
8 |
| - |
9 |
| -import java.util.Map; |
10 |
| -import io.swagger.model.Order; |
11 |
| - |
12 |
| -import java.util.List; |
13 |
| -import io.swagger.api.NotFoundException; |
14 |
| - |
15 |
| -import java.io.InputStream; |
16 |
| - |
17 |
| -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; |
18 |
| -import org.glassfish.jersey.media.multipart.FormDataParam; |
19 |
| - |
20 |
| -import javax.ws.rs.core.Context; |
21 |
| -import javax.ws.rs.core.Response; |
22 |
| -import javax.ws.rs.core.SecurityContext; |
23 |
| -import javax.ws.rs.*; |
24 |
| - |
25 |
| -@Path("/store") |
26 |
| - |
27 |
| - |
28 |
| -@io.swagger.annotations.Api(description = "the store API") |
29 |
| - |
30 |
| -public class StoreApi { |
31 |
| - private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); |
32 |
| - |
33 |
| - @DELETE |
34 |
| - @Path("/order/{orderId}") |
35 |
| - |
36 |
| - @Produces({ "application/xml", "application/json" }) |
37 |
| - @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) |
38 |
| - @io.swagger.annotations.ApiResponses(value = { |
39 |
| - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), |
40 |
| - |
41 |
| - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) |
42 |
| - public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId,@Context SecurityContext securityContext) |
43 |
| - throws NotFoundException { |
44 |
| - return delegate.deleteOrder(orderId,securityContext); |
45 |
| - } |
46 |
| - @GET |
47 |
| - @Path("/inventory") |
48 |
| - |
49 |
| - @Produces({ "application/json" }) |
50 |
| - @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { |
51 |
| - @io.swagger.annotations.Authorization(value = "api_key") |
52 |
| - }, tags={ "store", }) |
53 |
| - @io.swagger.annotations.ApiResponses(value = { |
54 |
| - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) |
55 |
| - public Response getInventory(@Context SecurityContext securityContext) |
56 |
| - throws NotFoundException { |
57 |
| - return delegate.getInventory(securityContext); |
58 |
| - } |
59 |
| - @GET |
60 |
| - @Path("/order/{orderId}") |
61 |
| - |
62 |
| - @Produces({ "application/xml", "application/json" }) |
63 |
| - @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) |
64 |
| - @io.swagger.annotations.ApiResponses(value = { |
65 |
| - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), |
66 |
| - |
67 |
| - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), |
68 |
| - |
69 |
| - @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) |
70 |
| - public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId,@Context SecurityContext securityContext) |
71 |
| - throws NotFoundException { |
72 |
| - return delegate.getOrderById(orderId,securityContext); |
73 |
| - } |
74 |
| - @POST |
75 |
| - @Path("/order") |
76 |
| - |
77 |
| - @Produces({ "application/xml", "application/json" }) |
78 |
| - @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) |
79 |
| - @io.swagger.annotations.ApiResponses(value = { |
80 |
| - @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), |
81 |
| - |
82 |
| - @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) |
83 |
| - public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body,@Context SecurityContext securityContext) |
84 |
| - throws NotFoundException { |
85 |
| - return delegate.placeOrder(body,securityContext); |
86 |
| - } |
87 |
| -} |
| 1 | +package io.swagger.api; |
| 2 | + |
| 3 | +import io.swagger.model.*; |
| 4 | +import io.swagger.api.StoreApiService; |
| 5 | +import io.swagger.api.factories.StoreApiServiceFactory; |
| 6 | + |
| 7 | +import io.swagger.annotations.ApiParam; |
| 8 | + |
| 9 | +import java.util.Map; |
| 10 | +import io.swagger.model.Order; |
| 11 | + |
| 12 | +import java.util.List; |
| 13 | +import io.swagger.api.NotFoundException; |
| 14 | + |
| 15 | +import java.io.InputStream; |
| 16 | + |
| 17 | +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; |
| 18 | +import org.glassfish.jersey.media.multipart.FormDataParam; |
| 19 | + |
| 20 | +import javax.ws.rs.core.Context; |
| 21 | +import javax.ws.rs.core.Response; |
| 22 | +import javax.ws.rs.core.SecurityContext; |
| 23 | +import javax.ws.rs.*; |
| 24 | + |
| 25 | +@Path("/store") |
| 26 | + |
| 27 | + |
| 28 | +@io.swagger.annotations.Api(description = "the store API") |
| 29 | + |
| 30 | +public class StoreApi { |
| 31 | + private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi(); |
| 32 | + |
| 33 | + @DELETE |
| 34 | + @Path("/order/{orderId}") |
| 35 | + |
| 36 | + @Produces({ "application/xml", "application/json" }) |
| 37 | + @io.swagger.annotations.ApiOperation(value = "Delete purchase order by ID", notes = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", response = void.class, tags={ "store", }) |
| 38 | + @io.swagger.annotations.ApiResponses(value = { |
| 39 | + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = void.class), |
| 40 | + |
| 41 | + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = void.class) }) |
| 42 | + public Response deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathParam("orderId") String orderId |
| 43 | +,@Context SecurityContext securityContext) |
| 44 | + throws NotFoundException { |
| 45 | + return delegate.deleteOrder(orderId,securityContext); |
| 46 | + } |
| 47 | + @GET |
| 48 | + @Path("/inventory") |
| 49 | + |
| 50 | + @Produces({ "application/json" }) |
| 51 | + @io.swagger.annotations.ApiOperation(value = "Returns pet inventories by status", notes = "Returns a map of status codes to quantities", response = Integer.class, responseContainer = "Map", authorizations = { |
| 52 | + @io.swagger.annotations.Authorization(value = "api_key") |
| 53 | + }, tags={ "store", }) |
| 54 | + @io.swagger.annotations.ApiResponses(value = { |
| 55 | + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Integer.class, responseContainer = "Map") }) |
| 56 | + public Response getInventory(@Context SecurityContext securityContext) |
| 57 | + throws NotFoundException { |
| 58 | + return delegate.getInventory(securityContext); |
| 59 | + } |
| 60 | + @GET |
| 61 | + @Path("/order/{orderId}") |
| 62 | + |
| 63 | + @Produces({ "application/xml", "application/json" }) |
| 64 | + @io.swagger.annotations.ApiOperation(value = "Find purchase order by ID", notes = "For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions", response = Order.class, tags={ "store", }) |
| 65 | + @io.swagger.annotations.ApiResponses(value = { |
| 66 | + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), |
| 67 | + |
| 68 | + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid ID supplied", response = Order.class), |
| 69 | + |
| 70 | + @io.swagger.annotations.ApiResponse(code = 404, message = "Order not found", response = Order.class) }) |
| 71 | + public Response getOrderById(@ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathParam("orderId") Long orderId |
| 72 | +,@Context SecurityContext securityContext) |
| 73 | + throws NotFoundException { |
| 74 | + return delegate.getOrderById(orderId,securityContext); |
| 75 | + } |
| 76 | + @POST |
| 77 | + @Path("/order") |
| 78 | + |
| 79 | + @Produces({ "application/xml", "application/json" }) |
| 80 | + @io.swagger.annotations.ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store", }) |
| 81 | + @io.swagger.annotations.ApiResponses(value = { |
| 82 | + @io.swagger.annotations.ApiResponse(code = 200, message = "successful operation", response = Order.class), |
| 83 | + |
| 84 | + @io.swagger.annotations.ApiResponse(code = 400, message = "Invalid Order", response = Order.class) }) |
| 85 | + public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true) Order body |
| 86 | +,@Context SecurityContext securityContext) |
| 87 | + throws NotFoundException { |
| 88 | + return delegate.placeOrder(body,securityContext); |
| 89 | + } |
| 90 | +} |
0 commit comments