7.8 KiB
PetApi
All URIs are relative to http://petstore.swagger.io:80/v2
Method | HTTP request | Description |
---|---|---|
addPet | POST /pet | Add a new pet to the store |
deletePet | DELETE /pet/{petId} | Deletes a pet |
findPetsByStatus | GET /pet/findByStatus | Finds Pets by status |
findPetsByTags | GET /pet/findByTags | Finds Pets by tags |
getPetById | GET /pet/{petId} | Find pet by ID |
updatePet | PUT /pet | Update an existing pet |
updatePetWithForm | POST /pet/{petId} | Updates a pet in the store with form data |
uploadFile | POST /pet/{petId}/uploadImage | uploads an image |
uploadFileWithRequiredFile | POST /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
addPet
void addPet(pet)
Add a new pet to the store
Parameters
Name | Type | Description | Notes |
---|---|---|---|
pet | Pet | Pet object that needs to be added to the store |
Return type
Authorization
HTTP request headers
- Content-Type: application/json, application/xml
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Successful operation | - |
405 | Invalid input | - |
deletePet
void deletePet(petId, apiKey)
Deletes a pet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long | Pet id to delete | |
apiKey | String | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Successful operation | - |
400 | Invalid pet value | - |
findPetsByStatus
List<Pet> findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
Parameters
Name | Type | Description | Notes |
---|---|---|---|
status | List<String> | Status values that need to be considered for filter | [enum: available, pending, sold] |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/xml, application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
400 | Invalid status value | - |
findPetsByTags
Set<Pet> findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Parameters
Name | Type | Description | Notes |
---|---|---|---|
tags | Set<String> | Tags to filter by |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/xml, application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
400 | Invalid tag value | - |
getPetById
Pet getPetById(petId)
Find pet by ID
Returns a single pet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long | ID of pet to return |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept: application/xml, application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
400 | Invalid ID supplied | - |
404 | Pet not found | - |
updatePet
void updatePet(pet)
Update an existing pet
Parameters
Name | Type | Description | Notes |
---|---|---|---|
pet | Pet | Pet object that needs to be added to the store |
Return type
Authorization
HTTP request headers
- Content-Type: application/json, application/xml
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Successful operation | - |
400 | Invalid ID supplied | - |
404 | Pet not found | - |
405 | Validation exception | - |
updatePetWithForm
void updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long | ID of pet that needs to be updated | |
name | String | Updated name of the pet | [optional] |
status | String | Updated status of the pet | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: application/x-www-form-urlencoded
- Accept: Not defined
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | Successful operation | - |
405 | Invalid input | - |
uploadFile
ModelApiResponse uploadFile(petId, additionalMetadata, _file)
uploads an image
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long | ID of pet to update | |
additionalMetadata | String | Additional data to pass to server | [optional] |
_file | File | file to upload | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |
uploadFileWithRequiredFile
ModelApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
uploads an image (required)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
petId | Long | ID of pet to update | |
requiredFile | File | file to upload | |
additionalMetadata | String | Additional data to pass to server | [optional] |
Return type
Authorization
HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | successful operation | - |