# SwagPetApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**addPet**](SwagPetApi.md#addPet) | **POST** /pet | Add a new pet to the store
[**deletePet**](SwagPetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
[**findPetsByStatus**](SwagPetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
[**findPetsByTags**](SwagPetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
[**getPetById**](SwagPetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
[**updatePet**](SwagPetApi.md#updatePet) | **PUT** /pet | Update an existing pet
[**updatePetWithForm**](SwagPetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**uploadFile**](SwagPetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
# **addPet**
> addPet(body)
Add a new pet to the store
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'body' => SwagPet.getExample()
};
try {
// cross your fingers
api.addPet(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SwagPet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **deletePet**
> deletePet(petId, apiKey)
Deletes a pet
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'petId' => 2147483648L,
'apiKey' => 'apiKey_example'
};
try {
// cross your fingers
api.deletePet(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| Pet id to delete |
**apiKey** | **String**| | [optional]
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **findPetsByStatus**
> List<SwagPet> findPetsByStatus(status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'status' => new List{'available'}
};
try {
// cross your fingers
List result = api.findPetsByStatus(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold]
### Return type
[**List<SwagPet>**](SwagPet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **findPetsByTags**
> List<SwagPet> findPetsByTags(tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'tags' => new List{'aeiou'}
};
try {
// cross your fingers
List result = api.findPetsByTags(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**List<String>**](String.md)| Tags to filter by |
### Return type
[**List<SwagPet>**](SwagPet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **getPetById**
> SwagPet getPetById(petId)
Find pet by ID
Returns a single pet
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure API key authorization: api_key
ApiKeyAuth api_key = (ApiKeyAuth) client.getAuthentication('api_key');
api_key.setApiKey('YOUR API KEY');
Map params = new Map{
'petId' => 2147483648L
};
try {
// cross your fingers
SwagPet result = api.getPetById(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to return |
### Return type
[**SwagPet**](SwagPet.md)
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **updatePet**
> updatePet(body)
Update an existing pet
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'body' => SwagPet.getExample()
};
try {
// cross your fingers
api.updatePet(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**SwagPet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
# **updatePetWithForm**
> updatePetWithForm(petId, name, status)
Updates a pet in the store with form data
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'petId' => 2147483648L,
'name' => 'name_example',
'status' => 'status_example'
};
try {
// cross your fingers
api.updatePetWithForm(params);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### 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
null (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json
# **uploadFile**
> SwagApiResponse uploadFile(petId, additionalMetadata, file)
uploads an image
### Example
```java
SwagPetApi api = new SwagPetApi();
SwagClient client = api.getClient();
// Configure OAuth2 access token for authorization: petstore_auth
Swagger.OAuth petstore_auth = (Swagger.OAuth) client.getAuthentication('petstore_auth');
petstore_auth.setAccessToken('YOUR ACCESS TOKEN');
Map params = new Map{
'petId' => 2147483648L,
'additionalMetadata' => 'additionalMetadata_example',
'file' => Blob.valueOf('Sample text file\nContents')
};
try {
// cross your fingers
SwagApiResponse result = api.uploadFile(params);
System.debug(result);
} catch (Swagger.ApiException e) {
// ...handle your exceptions
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **Long**| ID of pet to update |
**additionalMetadata** | **String**| Additional data to pass to server | [optional]
**file** | **Blob**| file to upload | [optional]
### Return type
[**SwagApiResponse**](SwagApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json