@RemoteResource(path="/petstore") public interface PetStore
Modifier and Type | Method and Description |
---|---|
Ok |
createUsers(User[] users)
Bulk creates users.
|
Ok |
deleteOrder(long orderId)
Deletes an order from the database.
|
Ok |
deletePet(String apiKey,
long petId)
Deletes the specified pet.
|
Ok |
deleteUser(String username)
Deletes a user from the database.
|
Collection<Pet> |
findPetsByStatus(PetStatus[] status)
Find all pets with the matching statuses.
|
Collection<Pet> |
findPetsByTags(String[] tags)
Deprecated.
|
Order |
getOrder(long orderId)
Returns an order from the database.
|
Collection<Order> |
getOrders()
Returns all orders in the database.
|
Pet |
getPet(long petId)
Returns a pet from the database.
|
Collection<Pet> |
getPets()
Returns all pets in the database.
|
Map<PetStatus,Integer> |
getStoreInventory()
Returns an inventory of pet statuses and counts.
|
User |
getUser(String username)
Returns a user from the database.
|
Collection<User> |
getUsers()
Returns all users in the database.
|
Ok |
login(String username,
String password,
Value<Integer> rateLimit,
Value<ExpiresAfter> expiresAfter,
RestRequest req,
RestResponse res)
User login.
|
Ok |
logout()
User logout.
|
long |
placeOrder(long petId,
String username)
Adds an order to the database.
|
long |
postPet(CreatePet pet)
Adds a pet to the database.
|
Ok |
postUser(User user)
Adds a new user to the database.
|
Ok |
updatePet(UpdatePet pet)
Updates a pet in the database.
|
Ok |
updateUser(String username,
User user)
Updates a user in the database.
|
@RemoteMethod(method="GET", path="/pet") Collection<Pet> getPets() throws NotAcceptable
NotAcceptable
- Unsupported @RemoteMethod(path="/pet/{petId}") Pet getPet(@Path(name="petId",description="ID of pet to return",example="123") long petId) throws IdNotFound, NotAcceptable
petId
- The ID of the pet to retrieve.IdNotFound
- Pet was not found.NotAcceptable
- Unsupported @RemoteMethod long postPet(@Body(description="Pet object to add to the store") CreatePet pet) throws IdConflict, NotAcceptable, UnsupportedMediaType
pet
- The pet data to add to the database.Ok
if successful.IdConflict
- ID already in use.NotAcceptable
- Unsupported UnsupportedMediaType
- Unsupported @RemoteMethod(method="PUT", path="/pet/{petId}") Ok updatePet(@Body(description="Pet object that needs to be added to the store") UpdatePet pet) throws IdNotFound, NotAcceptable, UnsupportedMediaType
pet
- The pet data to add to the database.Ok
if successful.IdNotFound
- ID not found.NotAcceptable
- Unsupported UnsupportedMediaType
- Unsupported @RemoteMethod(method="GET", path="/pet/findByStatus") Collection<Pet> findPetsByStatus(@Query(name="status",description="Status values that need to be considered for filter.",required=true,type="array",collectionFormat="csv",items=@Items(type="string",_enum="AVAILABLE,PENDING,SOLD",_default="AVAILABLE"),example="AVALIABLE,PENDING") PetStatus[] status) throws NotAcceptable
status
- The statuses to match against.NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/pet/findByTags") @Deprecated Collection<Pet> findPetsByTags(@Query(name="tags",description="Tags to filter by",required=true,example="[\'tag1\',\'tag2\']") String[] tags) throws InvalidTag, NotAcceptable
tags
- The tags to match against.InvalidTag
- Invalid tag was specified.NotAcceptable
- Unsupported @RemoteMethod(method="DELETE", path="/pet/{petId}") Ok deletePet(@Header(name="api_key",description="Security API key",required=true,example="foobar") String apiKey, @Path(name="petId",description="Pet id to delete",example="123") long petId) throws IdNotFound, NotAcceptable
apiKey
- Security key.petId
- ID of pet to delete.Ok
if successful.IdNotFound
- Pet not found.NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/store/order") Collection<Order> getOrders() throws NotAcceptable
NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/store/order/{orderId}") Order getOrder(@Path(name="orderId",description="ID of order to fetch",maximum="1000",minimum="1",example="123") long orderId) throws InvalidId, IdNotFound, NotAcceptable
orderId
- The ID of the order to retreieve.InvalidId
- ID was invalid.IdNotFound
- Order was not found.NotAcceptable
- Unsupported @RemoteMethod(method="POST", path="/store/order") long placeOrder(@FormData(name="petId",description="Pet ID") long petId, @FormData(name="username",description="The username of the user creating the order") String username) throws IdConflict, NotAcceptable, UnsupportedMediaType
petId
- Id of pet to order.username
- The username of the user placing the order.IdConflict
- ID was already in use.NotAcceptable
- Unsupported UnsupportedMediaType
- Unsupported @RemoteMethod(method="DELETE", path="/store/order/{orderId}") Ok deleteOrder(@Path(name="orderId",description="ID of the order that needs to be deleted",minimum="1",example="5") long orderId) throws InvalidId, IdNotFound, NotAcceptable
orderId
- The order ID.Ok
if successful.InvalidId
- ID not valid.IdNotFound
- Order not found.NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/store/inventory") Map<PetStatus,Integer> getStoreInventory() throws NotAcceptable
NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/user") Collection<User> getUsers() throws NotAcceptable
NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/user/{username}") User getUser(@Path(name="username",description="The name that needs to be fetched. Use user1 for testing.") String username) throws InvalidUsername, IdNotFound, NotAcceptable
username
- The username.InvalidUsername
- Invalid username.IdNotFound
- username not found.NotAcceptable
- Unsupported @RemoteMethod Ok postUser(@Body(description="Created user object") User user) throws InvalidUsername, IdConflict, NotAcceptable, UnsupportedMediaType
user
- The user to add to the database.Ok
if successful.InvalidUsername
- Username was invalid.IdConflict
- Username already in use.NotAcceptable
- Unsupported UnsupportedMediaType
- Unsupported @RemoteMethod(method="POST", path="/user/createWithArray") Ok createUsers(@Body(description="List of user objects") User[] users) throws InvalidUsername, IdConflict, NotAcceptable, UnsupportedMediaType
users
- The users to add to the database.Ok
if successful.InvalidUsername
- Username was invalid.IdConflict
- Username already in use.NotAcceptable
- Unsupported UnsupportedMediaType
- Unsupported @RemoteMethod(method="PUT", path="/user/{username}") Ok updateUser(@Path(name="username",description="Name that need to be updated") String username, @Body(description="Updated user object") User user) throws InvalidUsername, IdNotFound, NotAcceptable, UnsupportedMediaType
username
- The username.user
- The updated information.Ok
if successful.InvalidUsername
- Username was invalid.IdNotFound
- User was not found.NotAcceptable
- Unsupported UnsupportedMediaType
- Unsupported @RemoteMethod(method="DELETE", path="/user/{username}") Ok deleteUser(@Path(name="username",description="The name that needs to be deleted") String username) throws InvalidUsername, IdNotFound, NotAcceptable
username
- The username.Ok
if successful.InvalidUsername
- Username was not valid.IdNotFound
- User was not found.NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/user/login") Ok login(@Query(name="username",description="The username for login.",required=true,example="myuser") String username, @Query(name="password",description="The password for login in clear text.",required=true,example="abc123") String password, @ResponseHeader(name="X-Rate-Limit",type="integer",format="int32",description="Calls per hour allowed by the user.",example="123") Value<Integer> rateLimit, Value<ExpiresAfter> expiresAfter, RestRequest req, RestResponse res) throws InvalidLogin, NotAcceptable
username
- The username for login.password
- The password for login in clear text.rateLimit
- Calls per hour allowed by the user.expiresAfter
- The req
- The servlet request.res
- The servlet response.Ok
if successful.InvalidLogin
- Login was unsuccessful.NotAcceptable
- Unsupported @RemoteMethod(method="GET", path="/user/logout") Ok logout() throws NotAcceptable
Ok
if successful.NotAcceptable
- Unsupported Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.