add apache 2.0 license to perl api client

This commit is contained in:
wing328
2016-06-10 22:43:56 +08:00
parent 5ea2e2f1a2
commit 7de95c52c1
67 changed files with 3562 additions and 417 deletions

View File

@@ -10,13 +10,10 @@ All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
@@ -51,7 +48,7 @@ if ($@) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -64,53 +61,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **add_pet_using_byte_array**
> add_pet_using_byte_array(body => $body)
Fake endpoint to test byte array in body parameter for adding a new pet to the store
### Example
```perl
use Data::Dumper;
# Configure OAuth2 access token for authorization: petstore_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $body = WWW::SwaggerClient::Object::string->new(); # string | Pet object in the form of byte array
eval {
$api_instance->add_pet_using_byte_array(body => $body);
};
if ($@) {
warn "Exception when calling PetApi->add_pet_using_byte_array: $@\n";
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | **string**| Pet object in the form of byte array | [optional]
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -158,7 +109,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -177,7 +128,7 @@ use Data::Dumper;
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $status = (); # ARRAY[string] | Status values that need to be considered for query
my $status = (); # ARRAY[string] | Status values that need to be considered for filter
eval {
my $result = $api_instance->find_pets_by_status(status => $status);
@@ -192,7 +143,7 @@ if ($@) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for query | [optional] [default to available]
**status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for filter |
### Return type
@@ -205,7 +156,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -214,7 +165,7 @@ Name | Type | Description | Notes
Finds Pets by tags
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```perl
@@ -239,7 +190,7 @@ if ($@) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**tags** | [**ARRAY[string]**](string.md)| Tags to filter by | [optional]
**tags** | [**ARRAY[string]**](string.md)| Tags to filter by |
### Return type
@@ -252,7 +203,7 @@ Name | Type | Description | Notes
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -261,7 +212,7 @@ Name | Type | Description | Notes
Find pet by ID
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
Returns a single pet
### Example
```perl
@@ -271,11 +222,9 @@ use Data::Dumper;
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
# Configure OAuth2 access token for authorization: petstore_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $pet_id = 789; # int | ID of pet that needs to be fetched
my $pet_id = 789; # int | ID of pet to return
eval {
my $result = $api_instance->get_pet_by_id(pet_id => $pet_id);
@@ -290,7 +239,7 @@ if ($@) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet that needs to be fetched |
**pet_id** | **int**| ID of pet to return |
### Return type
@@ -298,114 +247,12 @@ Name | Type | Description | Notes
### Authorization
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **get_pet_by_id_in_object**
> InlineResponse200 get_pet_by_id_in_object(pet_id => $pet_id)
Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
### Example
```perl
use Data::Dumper;
# Configure API key authorization: api_key
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
# Configure OAuth2 access token for authorization: petstore_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $pet_id = 789; # int | ID of pet that needs to be fetched
eval {
my $result = $api_instance->get_pet_by_id_in_object(pet_id => $pet_id);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PetApi->get_pet_by_id_in_object: $@\n";
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet that needs to be fetched |
### Return type
[**InlineResponse200**](InlineResponse200.md)
### Authorization
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **pet_pet_idtesting_byte_arraytrue_get**
> string pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id)
Fake endpoint to test byte array return by 'Find pet by ID'
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
### Example
```perl
use Data::Dumper;
# Configure API key authorization: api_key
$WWW::SwaggerClient::Configuration::api_key->{'api_key'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'api_key'} = "Bearer";
# Configure OAuth2 access token for authorization: petstore_auth
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $pet_id = 789; # int | ID of pet that needs to be fetched
eval {
my $result = $api_instance->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: $@\n";
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **int**| ID of pet that needs to be fetched |
### Return type
**string**
### Authorization
[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -438,7 +285,7 @@ if ($@) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional]
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -451,7 +298,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -470,7 +317,7 @@ use Data::Dumper;
$WWW::SwaggerClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';
my $api_instance = WWW::SwaggerClient::PetApi->new();
my $pet_id = 'pet_id_example'; # string | ID of pet that needs to be updated
my $pet_id = 789; # int | ID of pet that needs to be updated
my $name = 'name_example'; # string | Updated name of the pet
my $status = 'status_example'; # string | Updated status of the pet
@@ -486,7 +333,7 @@ if ($@) {
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**pet_id** | **string**| ID of pet that needs to be updated |
**pet_id** | **int**| ID of pet that needs to be updated |
**name** | **string**| Updated name of the pet | [optional]
**status** | **string**| Updated status of the pet | [optional]
@@ -501,12 +348,12 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json, application/xml
- **Accept**: application/xml, application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **upload_file**
> upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file)
> ApiResponse upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file)
uploads an image
@@ -525,7 +372,8 @@ my $additional_metadata = 'additional_metadata_example'; # string | Additional d
my $file = '/path/to/file.txt'; # File | file to upload
eval {
$api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file);
my $result = $api_instance->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file);
print Dumper($result);
};
if ($@) {
warn "Exception when calling PetApi->upload_file: $@\n";
@@ -542,7 +390,7 @@ Name | Type | Description | Notes
### Return type
void (empty response body)
[**ApiResponse**](ApiResponse.md)
### Authorization
@@ -551,7 +399,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json, application/xml
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)