Ejemplo n.º 1
0
@Path("/store")
@io.swagger.annotations.Api(description = "the store API")
public class StoreApi {
  private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();

  @DELETE
  @Path("/order/{orderId}")
  @Produces({"application/xml", "application/json"})
  @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",
      })
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 400,
            message = "Invalid ID supplied",
            response = void.class),
        @io.swagger.annotations.ApiResponse(
            code = 404,
            message = "Order not found",
            response = void.class)
      })
  public Response deleteOrder(
      @ApiParam(value = "ID of the order that needs to be deleted", required = true)
          @PathParam("orderId")
          String orderId,
      @Context SecurityContext securityContext)
      throws NotFoundException {
    return delegate.deleteOrder(orderId, securityContext);
  }

  @GET
  @Path("/inventory")
  @Produces({"application/json"})
  @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 = {@io.swagger.annotations.Authorization(value = "api_key")},
      tags = {
        "store",
      })
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 200,
            message = "successful operation",
            response = Integer.class,
            responseContainer = "Map")
      })
  public Response getInventory(@Context SecurityContext securityContext) throws NotFoundException {
    return delegate.getInventory(securityContext);
  }

  @GET
  @Path("/order/{orderId}")
  @Produces({"application/xml", "application/json"})
  @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",
      })
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 200,
            message = "successful operation",
            response = Order.class),
        @io.swagger.annotations.ApiResponse(
            code = 400,
            message = "Invalid ID supplied",
            response = Order.class),
        @io.swagger.annotations.ApiResponse(
            code = 404,
            message = "Order not found",
            response = Order.class)
      })
  public Response getOrderById(
      @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathParam("orderId")
          Long orderId,
      @Context SecurityContext securityContext)
      throws NotFoundException {
    return delegate.getOrderById(orderId, securityContext);
  }

  @POST
  @Path("/order")
  @Produces({"application/xml", "application/json"})
  @io.swagger.annotations.ApiOperation(
      value = "Place an order for a pet",
      notes = "",
      response = Order.class,
      tags = {
        "store",
      })
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 200,
            message = "successful operation",
            response = Order.class),
        @io.swagger.annotations.ApiResponse(
            code = 400,
            message = "Invalid Order",
            response = Order.class)
      })
  public Response placeOrder(
      @ApiParam(value = "order placed for purchasing the pet", required = true) Order body,
      @Context SecurityContext securityContext)
      throws NotFoundException {
    return delegate.placeOrder(body, securityContext);
  }
}
Ejemplo n.º 2
0
@Path("/store")
@io.swagger.annotations.Api(value = "/store", description = "the store API")
@javax.annotation.Generated(
    value = "class io.swagger.codegen.languages.JaxRSServerCodegen",
    date = "2015-08-23T23:29:16.812-07:00")
public class StoreApi {

  private final StoreApiService delegate = StoreApiServiceFactory.getStoreApi();

  @GET
  @Path("/inventory")
  @Produces({"application/json", "application/xml"})
  @io.swagger.annotations.ApiOperation(
      value = "Returns pet inventories by status",
      notes = "Returns a map of status codes to quantities",
      response = Integer.class,
      responseContainer = "Map")
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 200,
            message = "successful operation",
            response = Integer.class,
            responseContainer = "Map")
      })
  public Response getInventory() throws NotFoundException {
    return delegate.getInventory();
  }

  @POST
  @Path("/order")
  @Produces({"application/json", "application/xml"})
  @io.swagger.annotations.ApiOperation(
      value = "Place an order for a pet",
      notes = "",
      response = Order.class)
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 200,
            message = "successful operation",
            response = Order.class),
        @io.swagger.annotations.ApiResponse(
            code = 400,
            message = "Invalid Order",
            response = Order.class)
      })
  public Response placeOrder(@ApiParam(value = "order placed for purchasing the pet") Order body)
      throws NotFoundException {
    return delegate.placeOrder(body);
  }

  @GET
  @Path("/order/{orderId}")
  @Produces({"application/json", "application/xml"})
  @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)
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 404,
            message = "Order not found",
            response = Order.class),
        @io.swagger.annotations.ApiResponse(
            code = 200,
            message = "successful operation",
            response = Order.class),
        @io.swagger.annotations.ApiResponse(
            code = 400,
            message = "Invalid ID supplied",
            response = Order.class)
      })
  public Response getOrderById(
      @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathParam("orderId")
          String orderId)
      throws NotFoundException {
    return delegate.getOrderById(orderId);
  }

  @DELETE
  @Path("/order/{orderId}")
  @Produces({"application/json", "application/xml"})
  @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)
  @io.swagger.annotations.ApiResponses(
      value = {
        @io.swagger.annotations.ApiResponse(
            code = 404,
            message = "Order not found",
            response = Void.class),
        @io.swagger.annotations.ApiResponse(
            code = 400,
            message = "Invalid ID supplied",
            response = Void.class)
      })
  public Response deleteOrder(
      @ApiParam(value = "ID of the order that needs to be deleted", required = true)
          @PathParam("orderId")
          String orderId)
      throws NotFoundException {
    return delegate.deleteOrder(orderId);
  }
}