diff --git a/modules/swagger-codegen/src/main/resources/perl/README.mustache b/modules/swagger-codegen/src/main/resources/perl/README.mustache index d3214289e63..eaecc78e02a 100644 --- a/modules/swagger-codegen/src/main/resources/perl/README.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/README.mustache @@ -231,3 +231,25 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{moduleName}}::Object::{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} +# DOCUMENTATION FOR AUTHORIATION +{{^authMethods}} All endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}}## {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorizatoin URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}}-- {{{scope}}}: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + + diff --git a/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache b/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache index 4920ad15d43..f7792b836b9 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api_doc.mustache @@ -32,8 +32,9 @@ if ($@) { ``` ### Parameters +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} {{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} {{/allParams}} @@ -41,17 +42,15 @@ Name | Type | Description | Notes {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} -### HTTP headers +### Authorization + +{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^-last}}, {{/-last}}{{/authMethods}} + +### HTTP reuqest headers - **Content-Type**: {{#consumes}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - **Accept**: {{#produces}}{{mediaType}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} -### Authentication scheme - -{{^authMethods}}No authentiation required{{/authMethods}}{{#authMethods}}{{name}}{{/authMethods}} - - - {{/operation}} diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 3a10c7a5652..dde8025c4b3 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -8,7 +8,7 @@ WWW::SwaggerClient::Role - a Moose role for the Swagger Petstore Automatically generated by the Perl Swagger Codegen project: -- Build date: 2016-03-08T16:48:08.361+08:00 +- Build date: 2016-03-08T19:21:31.731+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen - Codegen version: @@ -224,41 +224,84 @@ All URIs are relative to *http://petstore.swagger.io/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user -*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system -*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name -*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user -*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user -*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet *PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store +*PetApi* | [**add_pet_using_byte_array**](docs/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 +*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet *PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status *PetApi* | [**find_pets_by_tags**](docs/PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags *PetApi* | [**get_pet_by_id**](docs/PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image *PetApi* | [**get_pet_by_id_in_object**](docs/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' *PetApi* | [**pet_pet_idtesting_byte_arraytrue_get**](docs/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' -*PetApi* | [**add_pet_using_byte_array**](docs/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 +*PetApi* | [**update_pet**](docs/PetApi.md#update_pet) | **PUT** /pet | Update an existing pet +*PetApi* | [**update_pet_with_form**](docs/PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**upload_file**](docs/PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image +*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID *StoreApi* | [**find_orders_by_status**](docs/StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status *StoreApi* | [**get_inventory**](docs/StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status *StoreApi* | [**get_inventory_in_object**](docs/StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' -*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet *StoreApi* | [**get_order_by_id**](docs/StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID -*StoreApi* | [**delete_order**](docs/StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +*StoreApi* | [**place_order**](docs/StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet +*UserApi* | [**create_user**](docs/UserApi.md#create_user) | **POST** /user | Create user +*UserApi* | [**create_users_with_array_input**](docs/UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**create_users_with_list_input**](docs/UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +*UserApi* | [**delete_user**](docs/UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +*UserApi* | [**get_user_by_name**](docs/UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name +*UserApi* | [**login_user**](docs/UserApi.md#login_user) | **GET** /user/login | Logs user into the system +*UserApi* | [**logout_user**](docs/UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session +*UserApi* | [**update_user**](docs/UserApi.md#update_user) | **PUT** /user/{username} | Updated user # DOCUMENTATION FOR MODELS - - [WWW::SwaggerClient::Object::User](docs/User.md) - [WWW::SwaggerClient::Object::Category](docs/Category.md) - - [WWW::SwaggerClient::Object::Pet](docs/Pet.md) - - [WWW::SwaggerClient::Object::Tag](docs/Tag.md) + - [WWW::SwaggerClient::Object::InlineResponse200](docs/InlineResponse200.md) - [WWW::SwaggerClient::Object::ModelReturn](docs/ModelReturn.md) - [WWW::SwaggerClient::Object::Order](docs/Order.md) + - [WWW::SwaggerClient::Object::Pet](docs/Pet.md) - [WWW::SwaggerClient::Object::SpecialModelName](docs/SpecialModelName.md) - - [WWW::SwaggerClient::Object::InlineResponse200](docs/InlineResponse200.md) + - [WWW::SwaggerClient::Object::Tag](docs/Tag.md) + - [WWW::SwaggerClient::Object::User](docs/User.md) + + +# DOCUMENTATION FOR AUTHORIATION + +## test_api_key_header + +- **Type**: API key +- **API key parameter name**: test_api_key_header +- **Location**: HTTP header + +## api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +## test_api_client_secret + +- **Type**: API key +- **API key parameter name**: x-test_api_client_secret +- **Location**: HTTP header + +## test_api_client_id + +- **Type**: API key +- **API key parameter name**: x-test_api_client_id +- **Location**: HTTP header + +## test_api_key_query + +- **Type**: API key +- **API key parameter name**: test_api_key_query +- **Location**: URL query string + +## petstore_auth + +- **Type**: OAuth +- **Flow**: implicit +- **Authorizatoin URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: +-- write:pets: modify pets in your account +-- read:pets: read your pets + diff --git a/samples/client/petstore/perl/docs/PetApi.md b/samples/client/petstore/perl/docs/PetApi.md index 677b4d390e8..bb16b1809b7 100644 --- a/samples/client/petstore/perl/docs/PetApi.md +++ b/samples/client/petstore/perl/docs/PetApi.md @@ -4,59 +4,17 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet [**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 -[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet -[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image [**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' -[**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 - - -# **update_pet** -> update_pet(body => $body) - -Update an existing pet - - - -### Example -```perl -my $api = WWW::SwaggerClient::PetApi->new(); -my $body = WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store - -eval { - $api->update_pet(body => $body); -}; -if ($@) { - warn "Exception when calling update_pet: $@\n"; -} -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] - -### Return type - -void (empty response body) - -### HTTP headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/json, application/xml - -### Authentication scheme - -petstore_auth - - - +[**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 # **add_pet** @@ -80,6 +38,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] @@ -88,16 +47,98 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers - **Content-Type**: application/json, application/xml - **Accept**: application/json, application/xml -### Authentication scheme - -petstore_auth +# **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 +my $api = WWW::SwaggerClient::PetApi->new(); +my $body = WWW::SwaggerClient::Object::string->new(); # [string] Pet object in the form of byte array + +eval { + $api->add_pet_using_byte_array(body => $body); +}; +if ($@) { + warn "Exception when calling 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 reuqest headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/json, application/xml + + + +# **delete_pet** +> delete_pet(pet_id => $pet_id, api_key => $api_key) + +Deletes a pet + + + +### Example +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] Pet id to delete +my $api_key = 'api_key_example'; # [string] + +eval { + $api->delete_pet(pet_id => $pet_id, api_key => $api_key); +}; +if ($@) { + warn "Exception when calling delete_pet: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **pet_id** | **int**| Pet id to delete | + **api_key** | **string**| | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml @@ -122,6 +163,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | [**ARRAY[string]**](string.md)| Status values that need to be considered for query | [optional] [default to available] @@ -130,17 +172,15 @@ Name | Type | Description | Notes [**ARRAY[Pet]**](Pet.md) -### HTTP headers +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -petstore_auth - - - # **find_pets_by_tags** @@ -164,6 +204,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **tags** | [**ARRAY[string]**](string.md)| Tags to filter by | [optional] @@ -172,17 +213,15 @@ Name | Type | Description | Notes [**ARRAY[Pet]**](Pet.md) -### HTTP headers +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -petstore_auth - - - # **get_pet_by_id** @@ -206,6 +245,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet that needs to be fetched | @@ -214,16 +254,137 @@ Name | Type | Description | Notes [**Pet**](Pet.md) -### HTTP headers +### Authorization + +[api_key](../README.md#api_key), [petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -api_keypetstore_auth +# **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 +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->get_pet_by_id_in_object(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling 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 reuqest headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + + + +# **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 +my $api = WWW::SwaggerClient::PetApi->new(); +my $pet_id = 789; # [int] ID of pet that needs to be fetched + +eval { + my $result = $api->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id); +}; +if ($@) { + warn "Exception when calling 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 reuqest headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + + + +# **update_pet** +> update_pet(body => $body) + +Update an existing pet + + + +### Example +```perl +my $api = WWW::SwaggerClient::PetApi->new(); +my $body = WWW::SwaggerClient::Object::Pet->new(); # [Pet] Pet object that needs to be added to the store + +eval { + $api->update_pet(body => $body); +}; +if ($@) { + warn "Exception when calling update_pet: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | [optional] + +### Return type + +void (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers + + - **Content-Type**: application/json, application/xml + - **Accept**: application/json, application/xml @@ -250,6 +411,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **string**| ID of pet that needs to be updated | @@ -260,61 +422,15 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json, application/xml -### Authentication scheme - -petstore_auth - - - - - -# **delete_pet** -> delete_pet(pet_id => $pet_id, api_key => $api_key) - -Deletes a pet - - - -### Example -```perl -my $api = WWW::SwaggerClient::PetApi->new(); -my $pet_id = 789; # [int] Pet id to delete -my $api_key = 'api_key_example'; # [string] - -eval { - $api->delete_pet(pet_id => $pet_id, api_key => $api_key); -}; -if ($@) { - warn "Exception when calling delete_pet: $@\n"; -} -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **pet_id** | **int**| Pet id to delete | - **api_key** | **string**| | [optional] - -### Return type - -void (empty response body) - -### HTTP headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -### Authentication scheme - -petstore_auth - - - # **upload_file** @@ -340,6 +456,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pet_id** | **int**| ID of pet to update | @@ -350,142 +467,14 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP reuqest headers - **Content-Type**: multipart/form-data - **Accept**: application/json, application/xml -### Authentication scheme - -petstore_auth - - - - - -# **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 -my $api = WWW::SwaggerClient::PetApi->new(); -my $pet_id = 789; # [int] ID of pet that needs to be fetched - -eval { - my $result = $api->get_pet_by_id_in_object(pet_id => $pet_id); -}; -if ($@) { - warn "Exception when calling 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) - -### HTTP headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -### Authentication scheme - -api_keypetstore_auth - - - - - -# **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 -my $api = WWW::SwaggerClient::PetApi->new(); -my $pet_id = 789; # [int] ID of pet that needs to be fetched - -eval { - my $result = $api->pet_pet_idtesting_byte_arraytrue_get(pet_id => $pet_id); -}; -if ($@) { - warn "Exception when calling 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** - -### HTTP headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -### Authentication scheme - -api_keypetstore_auth - - - - - -# **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 -my $api = WWW::SwaggerClient::PetApi->new(); -my $body = WWW::SwaggerClient::Object::string->new(); # [string] Pet object in the form of byte array - -eval { - $api->add_pet_using_byte_array(body => $body); -}; -if ($@) { - warn "Exception when calling 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) - -### HTTP headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/json, application/xml - -### Authentication scheme - -petstore_auth - - - diff --git a/samples/client/petstore/perl/docs/StoreApi.md b/samples/client/petstore/perl/docs/StoreApi.md index fb004bce30f..b93896b770c 100644 --- a/samples/client/petstore/perl/docs/StoreApi.md +++ b/samples/client/petstore/perl/docs/StoreApi.md @@ -4,12 +4,53 @@ All URIs are relative to *http://petstore.swagger.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID [**find_orders_by_status**](StoreApi.md#find_orders_by_status) | **GET** /store/findByStatus | Finds orders by status [**get_inventory**](StoreApi.md#get_inventory) | **GET** /store/inventory | Returns pet inventories by status [**get_inventory_in_object**](StoreApi.md#get_inventory_in_object) | **GET** /store/inventory?response=arbitrary_object | Fake endpoint to test arbitrary object return by 'Get inventory' -[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet [**get_order_by_id**](StoreApi.md#get_order_by_id) | **GET** /store/order/{orderId} | Find purchase order by ID -[**delete_order**](StoreApi.md#delete_order) | **DELETE** /store/order/{orderId} | Delete purchase order by ID +[**place_order**](StoreApi.md#place_order) | **POST** /store/order | Place an order for a pet + + +# **delete_order** +> delete_order(order_id => $order_id) + +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Example +```perl +my $api = WWW::SwaggerClient::StoreApi->new(); +my $order_id = 'order_id_example'; # [string] ID of the order that needs to be deleted + +eval { + $api->delete_order(order_id => $order_id); +}; +if ($@) { + warn "Exception when calling delete_order: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **string**| ID of the order that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP reuqest headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + # **find_orders_by_status** @@ -33,6 +74,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **status** | **string**| Status value that needs to be considered for query | [optional] [default to placed] @@ -41,17 +83,15 @@ Name | Type | Description | Notes [**ARRAY[Order]**](Order.md) -### HTTP headers +### Authorization + +[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -test_api_client_idtest_api_client_secret - - - # **get_inventory** @@ -74,24 +114,21 @@ if ($@) { ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +This endpoint does not need any parameter. ### Return type **HASH[string,int]** -### HTTP headers +### Authorization + +[api_key](../README.md#api_key) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -api_key - - - # **get_inventory_in_object** @@ -114,66 +151,21 @@ if ($@) { ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +This endpoint does not need any parameter. ### Return type **object** -### HTTP headers +### Authorization + +[api_key](../README.md#api_key) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -api_key - - - - - -# **place_order** -> Order place_order(body => $body) - -Place an order for a pet - - - -### Example -```perl -my $api = WWW::SwaggerClient::StoreApi->new(); -my $body = WWW::SwaggerClient::Object::Order->new(); # [Order] order placed for purchasing the pet - -eval { - my $result = $api->place_order(body => $body); -}; -if ($@) { - warn "Exception when calling place_order: $@\n"; -} -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] - -### Return type - -[**Order**](Order.md) - -### HTTP headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -### Authentication scheme - -test_api_client_idtest_api_client_secret - - - # **get_order_by_id** @@ -197,6 +189,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **order_id** | **string**| ID of pet that needs to be fetched | @@ -205,58 +198,55 @@ Name | Type | Description | Notes [**Order**](Order.md) -### HTTP headers +### Authorization + +[test_api_key_header](../README.md#test_api_key_header), [test_api_key_query](../README.md#test_api_key_query) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -test_api_key_headertest_api_key_query +# **place_order** +> Order place_order(body => $body) + +Place an order for a pet -# **delete_order** -> delete_order(order_id => $order_id) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - ### Example ```perl my $api = WWW::SwaggerClient::StoreApi->new(); -my $order_id = 'order_id_example'; # [string] ID of the order that needs to be deleted +my $body = WWW::SwaggerClient::Object::Order->new(); # [Order] order placed for purchasing the pet eval { - $api->delete_order(order_id => $order_id); + my $result = $api->place_order(body => $body); }; if ($@) { - warn "Exception when calling delete_order: $@\n"; + warn "Exception when calling place_order: $@\n"; } ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **order_id** | **string**| ID of the order that needs to be deleted | + **body** | [**Order**](Order.md)| order placed for purchasing the pet | [optional] ### Return type -void (empty response body) +[**Order**](Order.md) -### HTTP headers +### Authorization + +[test_api_client_id](../README.md#test_api_client_id), [test_api_client_secret](../README.md#test_api_client_secret) + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required - - - diff --git a/samples/client/petstore/perl/docs/UserApi.md b/samples/client/petstore/perl/docs/UserApi.md index e60e51cfb2d..dc2981a1cd0 100644 --- a/samples/client/petstore/perl/docs/UserApi.md +++ b/samples/client/petstore/perl/docs/UserApi.md @@ -7,11 +7,11 @@ Method | HTTP request | Description [**create_user**](UserApi.md#create_user) | **POST** /user | Create user [**create_users_with_array_input**](UserApi.md#create_users_with_array_input) | **POST** /user/createWithArray | Creates list of users with given input array [**create_users_with_list_input**](UserApi.md#create_users_with_list_input) | **POST** /user/createWithList | Creates list of users with given input array +[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user +[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name [**login_user**](UserApi.md#login_user) | **GET** /user/login | Logs user into the system [**logout_user**](UserApi.md#logout_user) | **GET** /user/logout | Logs out current logged in user session -[**get_user_by_name**](UserApi.md#get_user_by_name) | **GET** /user/{username} | Get user by user name [**update_user**](UserApi.md#update_user) | **PUT** /user/{username} | Updated user -[**delete_user**](UserApi.md#delete_user) | **DELETE** /user/{username} | Delete user # **create_user** @@ -35,6 +35,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**User**](User.md)| Created user object | [optional] @@ -43,17 +44,15 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +No authorization required + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required - - - # **create_users_with_array_input** @@ -77,6 +76,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**ARRAY[User]**](User.md)| List of user object | [optional] @@ -85,17 +85,15 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +No authorization required + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required - - - # **create_users_with_list_input** @@ -119,6 +117,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **body** | [**ARRAY[User]**](User.md)| List of user object | [optional] @@ -127,16 +126,96 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +No authorization required + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required +# **delete_user** +> delete_user(username => $username) + +Delete user + +This can only be done by the logged in user. + +### Example +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $username = 'username_example'; # [string] The name that needs to be deleted + +eval { + $api->delete_user(username => $username); +}; +if ($@) { + warn "Exception when calling delete_user: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be deleted | + +### Return type + +void (empty response body) + +### Authorization + +No authorization required + +### HTTP reuqest headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml + + + +# **get_user_by_name** +> User get_user_by_name(username => $username) + +Get user by user name + + + +### Example +```perl +my $api = WWW::SwaggerClient::UserApi->new(); +my $username = 'username_example'; # [string] The name that needs to be fetched. Use user1 for testing. + +eval { + my $result = $api->get_user_by_name(username => $username); +}; +if ($@) { + warn "Exception when calling get_user_by_name: $@\n"; +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP reuqest headers + + - **Content-Type**: Not defined + - **Accept**: application/json, application/xml @@ -162,6 +241,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| The user name for login | [optional] @@ -171,17 +251,15 @@ Name | Type | Description | Notes **string** -### HTTP headers +### Authorization + +No authorization required + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required - - - # **logout_user** @@ -204,66 +282,21 @@ if ($@) { ``` ### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- +This endpoint does not need any parameter. ### Return type void (empty response body) -### HTTP headers +### Authorization + +No authorization required + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required - - - - - -# **get_user_by_name** -> User get_user_by_name(username => $username) - -Get user by user name - - - -### Example -```perl -my $api = WWW::SwaggerClient::UserApi->new(); -my $username = 'username_example'; # [string] The name that needs to be fetched. Use user1 for testing. - -eval { - my $result = $api->get_user_by_name(username => $username); -}; -if ($@) { - warn "Exception when calling get_user_by_name: $@\n"; -} -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### HTTP headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -### Authentication scheme - -No authentiation required - - - # **update_user** @@ -288,6 +321,7 @@ if ($@) { ``` ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **string**| name that need to be deleted | @@ -297,58 +331,14 @@ Name | Type | Description | Notes void (empty response body) -### HTTP headers +### Authorization + +No authorization required + +### HTTP reuqest headers - **Content-Type**: Not defined - **Accept**: application/json, application/xml -### Authentication scheme - -No authentiation required - - - - - -# **delete_user** -> delete_user(username => $username) - -Delete user - -This can only be done by the logged in user. - -### Example -```perl -my $api = WWW::SwaggerClient::UserApi->new(); -my $username = 'username_example'; # [string] The name that needs to be deleted - -eval { - $api->delete_user(username => $username); -}; -if ($@) { - warn "Exception when calling delete_user: $@\n"; -} -``` - -### Parameters -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **string**| The name that needs to be deleted | - -### Return type - -void (empty response body) - -### HTTP headers - - - **Content-Type**: Not defined - - **Accept**: application/json, application/xml - -### Authentication scheme - -No authentiation required - - - diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index ae57afa1ead..dabb35c4db6 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -51,71 +51,6 @@ sub new { } -# -# update_pet -# -# Update an existing pet -# -# @param Pet $body Pet object that needs to be added to the store (optional) -{ - my $params = { - 'body' => { - data_type => 'Pet', - description => 'Pet object that needs to be added to the store', - required => '0', - }, - }; - __PACKAGE__->method_documentation->{ update_pet } = { - summary => 'Update an existing pet', - params => $params, - returns => undef, - }; -} -# @return void -# -sub update_pet { - my ($self, %args) = @_; - - - - # parse inputs - my $_resource_path = '/pet'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'PUT'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); - - - - - - my $_body_data; - # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; - } - - # authentication setting, if any - my $auth_settings = [qw(petstore_auth )]; - - # make the API Call - - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; - -} - # # add_pet # @@ -181,6 +116,152 @@ sub add_pet { } +# +# add_pet_using_byte_array +# +# Fake endpoint to test byte array in body parameter for adding a new pet to the store +# +# @param string $body Pet object in the form of byte array (optional) +{ + my $params = { + 'body' => { + data_type => 'string', + description => 'Pet object in the form of byte array', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ add_pet_using_byte_array } = { + summary => 'Fake endpoint to test byte array in body parameter for adding a new pet to the store', + params => $params, + returns => undef, + }; +} +# @return void +# +sub add_pet_using_byte_array { + my ($self, %args) = @_; + + + + # parse inputs + my $_resource_path = '/pet?testing_byte_array=true'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); + + + + + + my $_body_data; + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } + + # authentication setting, if any + my $auth_settings = [qw(petstore_auth )]; + + # make the API Call + + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + +} + +# +# delete_pet +# +# Deletes a pet +# +# @param int $pet_id Pet id to delete (required) +# @param string $api_key (optional) +{ + my $params = { + 'pet_id' => { + data_type => 'int', + description => 'Pet id to delete', + required => '1', + }, + 'api_key' => { + data_type => 'string', + description => '', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ delete_pet } = { + summary => 'Deletes a pet', + params => $params, + returns => undef, + }; +} +# @return void +# +sub delete_pet { + my ($self, %args) = @_; + + + # verify the required parameter 'pet_id' is set + unless (exists $args{'pet_id'}) { + croak("Missing the required parameter 'pet_id' when calling delete_pet"); + } + + + # parse inputs + my $_resource_path = '/pet/{petId}'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'DELETE'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + + # header params + if ( exists $args{'api_key'}) { + $header_params->{'api_key'} = $self->{api_client}->to_header_value($args{'api_key'}); + } + # path params + if ( exists $args{'pet_id'}) { + my $_base_variable = "{" . "petId" . "}"; + my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'}); + $_resource_path =~ s/$_base_variable/$_base_value/g; + } + + my $_body_data; + + + # authentication setting, if any + my $auth_settings = [qw(petstore_auth )]; + + # make the API Call + + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + +} + # # find_pets_by_status # @@ -392,276 +473,6 @@ sub get_pet_by_id { } -# -# update_pet_with_form -# -# Updates a pet in the store with form data -# -# @param string $pet_id ID of pet that needs to be updated (required) -# @param string $name Updated name of the pet (optional) -# @param string $status Updated status of the pet (optional) -{ - my $params = { - 'pet_id' => { - data_type => 'string', - description => 'ID of pet that needs to be updated', - required => '1', - }, - 'name' => { - data_type => 'string', - description => 'Updated name of the pet', - required => '0', - }, - 'status' => { - data_type => 'string', - description => 'Updated status of the pet', - required => '0', - }, - }; - __PACKAGE__->method_documentation->{ update_pet_with_form } = { - summary => 'Updates a pet in the store with form data', - params => $params, - returns => undef, - }; -} -# @return void -# -sub update_pet_with_form { - my ($self, %args) = @_; - - - # verify the required parameter 'pet_id' is set - unless (exists $args{'pet_id'}) { - croak("Missing the required parameter 'pet_id' when calling update_pet_with_form"); - } - - - # parse inputs - my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'POST'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded'); - - - - # path params - if ( exists $args{'pet_id'}) { - my $_base_variable = "{" . "petId" . "}"; - my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'}); - $_resource_path =~ s/$_base_variable/$_base_value/g; - } - # form params - if ( exists $args{'name'} ) { - - $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'}); - - }# form params - if ( exists $args{'status'} ) { - - $form_params->{'status'} = $self->{api_client}->to_form_value($args{'status'}); - - } - my $_body_data; - - - # authentication setting, if any - my $auth_settings = [qw(petstore_auth )]; - - # make the API Call - - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; - -} - -# -# delete_pet -# -# Deletes a pet -# -# @param int $pet_id Pet id to delete (required) -# @param string $api_key (optional) -{ - my $params = { - 'pet_id' => { - data_type => 'int', - description => 'Pet id to delete', - required => '1', - }, - 'api_key' => { - data_type => 'string', - description => '', - required => '0', - }, - }; - __PACKAGE__->method_documentation->{ delete_pet } = { - summary => 'Deletes a pet', - params => $params, - returns => undef, - }; -} -# @return void -# -sub delete_pet { - my ($self, %args) = @_; - - - # verify the required parameter 'pet_id' is set - unless (exists $args{'pet_id'}) { - croak("Missing the required parameter 'pet_id' when calling delete_pet"); - } - - - # parse inputs - my $_resource_path = '/pet/{petId}'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'DELETE'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - # header params - if ( exists $args{'api_key'}) { - $header_params->{'api_key'} = $self->{api_client}->to_header_value($args{'api_key'}); - } - # path params - if ( exists $args{'pet_id'}) { - my $_base_variable = "{" . "petId" . "}"; - my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'}); - $_resource_path =~ s/$_base_variable/$_base_value/g; - } - - my $_body_data; - - - # authentication setting, if any - my $auth_settings = [qw(petstore_auth )]; - - # make the API Call - - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; - -} - -# -# upload_file -# -# uploads an image -# -# @param int $pet_id ID of pet to update (required) -# @param string $additional_metadata Additional data to pass to server (optional) -# @param File $file file to upload (optional) -{ - my $params = { - 'pet_id' => { - data_type => 'int', - description => 'ID of pet to update', - required => '1', - }, - 'additional_metadata' => { - data_type => 'string', - description => 'Additional data to pass to server', - required => '0', - }, - 'file' => { - data_type => 'File', - description => 'file to upload', - required => '0', - }, - }; - __PACKAGE__->method_documentation->{ upload_file } = { - summary => 'uploads an image', - params => $params, - returns => undef, - }; -} -# @return void -# -sub upload_file { - my ($self, %args) = @_; - - - # verify the required parameter 'pet_id' is set - unless (exists $args{'pet_id'}) { - croak("Missing the required parameter 'pet_id' when calling upload_file"); - } - - - # parse inputs - my $_resource_path = '/pet/{petId}/uploadImage'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'POST'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data'); - - - - # path params - if ( exists $args{'pet_id'}) { - my $_base_variable = "{" . "petId" . "}"; - my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'}); - $_resource_path =~ s/$_base_variable/$_base_value/g; - } - # form params - if ( exists $args{'additional_metadata'} ) { - - $form_params->{'additionalMetadata'} = $self->{api_client}->to_form_value($args{'additional_metadata'}); - - }# form params - if ( exists $args{'file'} ) { - $form_params->{'file'} = [] unless defined $form_params->{'file'}; - push @{$form_params->{'file'}}, $args{'file'}; - - - } - my $_body_data; - - - # authentication setting, if any - my $auth_settings = [qw(petstore_auth )]; - - # make the API Call - - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; - -} - # # get_pet_by_id_in_object # @@ -813,37 +624,37 @@ sub pet_pet_idtesting_byte_arraytrue_get { } # -# add_pet_using_byte_array +# update_pet # -# Fake endpoint to test byte array in body parameter for adding a new pet to the store +# Update an existing pet # -# @param string $body Pet object in the form of byte array (optional) +# @param Pet $body Pet object that needs to be added to the store (optional) { my $params = { 'body' => { - data_type => 'string', - description => 'Pet object in the form of byte array', + data_type => 'Pet', + description => 'Pet object that needs to be added to the store', required => '0', }, }; - __PACKAGE__->method_documentation->{ add_pet_using_byte_array } = { - summary => 'Fake endpoint to test byte array in body parameter for adding a new pet to the store', + __PACKAGE__->method_documentation->{ update_pet } = { + summary => 'Update an existing pet', params => $params, returns => undef, }; } # @return void # -sub add_pet_using_byte_array { +sub update_pet { my ($self, %args) = @_; # parse inputs - my $_resource_path = '/pet?testing_byte_array=true'; + my $_resource_path = '/pet'; $_resource_path =~ s/{format}/json/; # default format to json - my $_method = 'POST'; + my $_method = 'PUT'; my $query_params = {}; my $header_params = {}; my $form_params = {}; @@ -877,5 +688,194 @@ sub add_pet_using_byte_array { } +# +# update_pet_with_form +# +# Updates a pet in the store with form data +# +# @param string $pet_id ID of pet that needs to be updated (required) +# @param string $name Updated name of the pet (optional) +# @param string $status Updated status of the pet (optional) +{ + my $params = { + 'pet_id' => { + data_type => 'string', + description => 'ID of pet that needs to be updated', + required => '1', + }, + 'name' => { + data_type => 'string', + description => 'Updated name of the pet', + required => '0', + }, + 'status' => { + data_type => 'string', + description => 'Updated status of the pet', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ update_pet_with_form } = { + summary => 'Updates a pet in the store with form data', + params => $params, + returns => undef, + }; +} +# @return void +# +sub update_pet_with_form { + my ($self, %args) = @_; + + + # verify the required parameter 'pet_id' is set + unless (exists $args{'pet_id'}) { + croak("Missing the required parameter 'pet_id' when calling update_pet_with_form"); + } + + + # parse inputs + my $_resource_path = '/pet/{petId}'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded'); + + + + # path params + if ( exists $args{'pet_id'}) { + my $_base_variable = "{" . "petId" . "}"; + my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'}); + $_resource_path =~ s/$_base_variable/$_base_value/g; + } + # form params + if ( exists $args{'name'} ) { + + $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'}); + + }# form params + if ( exists $args{'status'} ) { + + $form_params->{'status'} = $self->{api_client}->to_form_value($args{'status'}); + + } + my $_body_data; + + + # authentication setting, if any + my $auth_settings = [qw(petstore_auth )]; + + # make the API Call + + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + +} + +# +# upload_file +# +# uploads an image +# +# @param int $pet_id ID of pet to update (required) +# @param string $additional_metadata Additional data to pass to server (optional) +# @param File $file file to upload (optional) +{ + my $params = { + 'pet_id' => { + data_type => 'int', + description => 'ID of pet to update', + required => '1', + }, + 'additional_metadata' => { + data_type => 'string', + description => 'Additional data to pass to server', + required => '0', + }, + 'file' => { + data_type => 'File', + description => 'file to upload', + required => '0', + }, + }; + __PACKAGE__->method_documentation->{ upload_file } = { + summary => 'uploads an image', + params => $params, + returns => undef, + }; +} +# @return void +# +sub upload_file { + my ($self, %args) = @_; + + + # verify the required parameter 'pet_id' is set + unless (exists $args{'pet_id'}) { + croak("Missing the required parameter 'pet_id' when calling upload_file"); + } + + + # parse inputs + my $_resource_path = '/pet/{petId}/uploadImage'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'POST'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('multipart/form-data'); + + + + # path params + if ( exists $args{'pet_id'}) { + my $_base_variable = "{" . "petId" . "}"; + my $_base_value = $self->{api_client}->to_path_value($args{'pet_id'}); + $_resource_path =~ s/$_base_variable/$_base_value/g; + } + # form params + if ( exists $args{'additional_metadata'} ) { + + $form_params->{'additionalMetadata'} = $self->{api_client}->to_form_value($args{'additional_metadata'}); + + }# form params + if ( exists $args{'file'} ) { + $form_params->{'file'} = [] unless defined $form_params->{'file'}; + push @{$form_params->{'file'}}, $args{'file'}; + + + } + my $_body_data; + + + # authentication setting, if any + my $auth_settings = [qw(petstore_auth )]; + + # make the API Call + + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + +} + 1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm index d0e21454fc3..cbd9501744c 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Role.pm @@ -37,7 +37,7 @@ has version_info => ( is => 'ro', default => sub { { app_name => 'Swagger Petstore', app_version => '1.0.0', - generated_date => '2016-03-08T16:48:08.361+08:00', + generated_date => '2016-03-08T19:21:31.731+08:00', generator_class => 'class io.swagger.codegen.languages.PerlClientCodegen', } }, documentation => 'Information about the application version and the codegen codebase version' @@ -103,7 +103,7 @@ Automatically generated by the Perl Swagger Codegen project: =over 4 -=item Build date: 2016-03-08T16:48:08.361+08:00 +=item Build date: 2016-03-08T19:21:31.731+08:00 =item Build package: class io.swagger.codegen.languages.PerlClientCodegen diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm index fe001897754..68a102c1174 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -51,6 +51,78 @@ sub new { } +# +# delete_order +# +# Delete purchase order by ID +# +# @param string $order_id ID of the order that needs to be deleted (required) +{ + my $params = { + 'order_id' => { + data_type => 'string', + description => 'ID of the order that needs to be deleted', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ delete_order } = { + summary => 'Delete purchase order by ID', + params => $params, + returns => undef, + }; +} +# @return void +# +sub delete_order { + my ($self, %args) = @_; + + + # verify the required parameter 'order_id' is set + unless (exists $args{'order_id'}) { + croak("Missing the required parameter 'order_id' when calling delete_order"); + } + + + # parse inputs + my $_resource_path = '/store/order/{orderId}'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'DELETE'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + + + # path params + if ( exists $args{'order_id'}) { + my $_base_variable = "{" . "orderId" . "}"; + my $_base_value = $self->{api_client}->to_path_value($args{'order_id'}); + $_resource_path =~ s/$_base_variable/$_base_value/g; + } + + my $_body_data; + + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + +} + # # find_orders_by_status # @@ -237,74 +309,6 @@ sub get_inventory_in_object { } -# -# place_order -# -# Place an order for a pet -# -# @param Order $body order placed for purchasing the pet (optional) -{ - my $params = { - 'body' => { - data_type => 'Order', - description => 'order placed for purchasing the pet', - required => '0', - }, - }; - __PACKAGE__->method_documentation->{ place_order } = { - summary => 'Place an order for a pet', - params => $params, - returns => 'Order', - }; -} -# @return Order -# -sub place_order { - my ($self, %args) = @_; - - - - # parse inputs - my $_resource_path = '/store/order'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'POST'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - - - my $_body_data; - # body params - if ( exists $args{'body'}) { - $_body_data = $args{'body'}; - } - - # authentication setting, if any - my $auth_settings = [qw(test_api_client_id test_api_client_secret )]; - - # make the API Call - my $response = $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - if (!$response) { - return; - } - my $_response_object = $self->{api_client}->deserialize('Order', $response); - return $_response_object; - -} - # # get_order_by_id # @@ -381,42 +385,37 @@ sub get_order_by_id { } # -# delete_order +# place_order # -# Delete purchase order by ID +# Place an order for a pet # -# @param string $order_id ID of the order that needs to be deleted (required) +# @param Order $body order placed for purchasing the pet (optional) { my $params = { - 'order_id' => { - data_type => 'string', - description => 'ID of the order that needs to be deleted', - required => '1', + 'body' => { + data_type => 'Order', + description => 'order placed for purchasing the pet', + required => '0', }, }; - __PACKAGE__->method_documentation->{ delete_order } = { - summary => 'Delete purchase order by ID', + __PACKAGE__->method_documentation->{ place_order } = { + summary => 'Place an order for a pet', params => $params, - returns => undef, + returns => 'Order', }; } -# @return void +# @return Order # -sub delete_order { +sub place_order { my ($self, %args) = @_; - # verify the required parameter 'order_id' is set - unless (exists $args{'order_id'}) { - croak("Missing the required parameter 'order_id' when calling delete_order"); - } - # parse inputs - my $_resource_path = '/store/order/{orderId}'; + my $_resource_path = '/store/order'; $_resource_path =~ s/{format}/json/; # default format to json - my $_method = 'DELETE'; + my $_method = 'POST'; my $query_params = {}; my $header_params = {}; my $form_params = {}; @@ -430,25 +429,26 @@ sub delete_order { - # path params - if ( exists $args{'order_id'}) { - my $_base_variable = "{" . "orderId" . "}"; - my $_base_value = $self->{api_client}->to_path_value($args{'order_id'}); - $_resource_path =~ s/$_base_variable/$_base_value/g; - } + my $_body_data; - + # body params + if ( exists $args{'body'}) { + $_body_data = $args{'body'}; + } # authentication setting, if any - my $auth_settings = [qw()]; + my $auth_settings = [qw(test_api_client_id test_api_client_secret )]; # make the API Call - - $self->{api_client}->call_api($_resource_path, $_method, + my $response = $self->{api_client}->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); - return; + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('Order', $response); + return $_response_object; } diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm index 5e983e1aa7c..87fbacfebb7 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm @@ -246,6 +246,153 @@ sub create_users_with_list_input { } +# +# delete_user +# +# Delete user +# +# @param string $username The name that needs to be deleted (required) +{ + my $params = { + 'username' => { + data_type => 'string', + description => 'The name that needs to be deleted', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ delete_user } = { + summary => 'Delete user', + params => $params, + returns => undef, + }; +} +# @return void +# +sub delete_user { + my ($self, %args) = @_; + + + # verify the required parameter 'username' is set + unless (exists $args{'username'}) { + croak("Missing the required parameter 'username' when calling delete_user"); + } + + + # parse inputs + my $_resource_path = '/user/{username}'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'DELETE'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + + + # path params + if ( exists $args{'username'}) { + my $_base_variable = "{" . "username" . "}"; + my $_base_value = $self->{api_client}->to_path_value($args{'username'}); + $_resource_path =~ s/$_base_variable/$_base_value/g; + } + + my $_body_data; + + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + + $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + return; + +} + +# +# get_user_by_name +# +# Get user by user name +# +# @param string $username The name that needs to be fetched. Use user1 for testing. (required) +{ + my $params = { + 'username' => { + data_type => 'string', + description => 'The name that needs to be fetched. Use user1 for testing.', + required => '1', + }, + }; + __PACKAGE__->method_documentation->{ get_user_by_name } = { + summary => 'Get user by user name', + params => $params, + returns => 'User', + }; +} +# @return User +# +sub get_user_by_name { + my ($self, %args) = @_; + + + # verify the required parameter 'username' is set + unless (exists $args{'username'}) { + croak("Missing the required parameter 'username' when calling get_user_by_name"); + } + + + # parse inputs + my $_resource_path = '/user/{username}'; + $_resource_path =~ s/{format}/json/; # default format to json + + my $_method = 'GET'; + my $query_params = {}; + my $header_params = {}; + my $form_params = {}; + + # 'Accept' and 'Content-Type' header + my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); + if ($_header_accept) { + $header_params->{'Accept'} = $_header_accept; + } + $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); + + + + # path params + if ( exists $args{'username'}) { + my $_base_variable = "{" . "username" . "}"; + my $_base_value = $self->{api_client}->to_path_value($args{'username'}); + $_resource_path =~ s/$_base_variable/$_base_value/g; + } + + my $_body_data; + + + # authentication setting, if any + my $auth_settings = [qw()]; + + # make the API Call + my $response = $self->{api_client}->call_api($_resource_path, $_method, + $query_params, $form_params, + $header_params, $_body_data, $auth_settings); + if (!$response) { + return; + } + my $_response_object = $self->{api_client}->deserialize('User', $response); + return $_response_object; + +} + # # login_user # @@ -379,81 +526,6 @@ sub logout_user { } -# -# get_user_by_name -# -# Get user by user name -# -# @param string $username The name that needs to be fetched. Use user1 for testing. (required) -{ - my $params = { - 'username' => { - data_type => 'string', - description => 'The name that needs to be fetched. Use user1 for testing.', - required => '1', - }, - }; - __PACKAGE__->method_documentation->{ get_user_by_name } = { - summary => 'Get user by user name', - params => $params, - returns => 'User', - }; -} -# @return User -# -sub get_user_by_name { - my ($self, %args) = @_; - - - # verify the required parameter 'username' is set - unless (exists $args{'username'}) { - croak("Missing the required parameter 'username' when calling get_user_by_name"); - } - - - # parse inputs - my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'GET'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - # path params - if ( exists $args{'username'}) { - my $_base_variable = "{" . "username" . "}"; - my $_base_value = $self->{api_client}->to_path_value($args{'username'}); - $_resource_path =~ s/$_base_variable/$_base_value/g; - } - - my $_body_data; - - - # authentication setting, if any - my $auth_settings = [qw()]; - - # make the API Call - my $response = $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - if (!$response) { - return; - } - my $_response_object = $self->{api_client}->deserialize('User', $response); - return $_response_object; - -} - # # update_user # @@ -535,77 +607,5 @@ sub update_user { } -# -# delete_user -# -# Delete user -# -# @param string $username The name that needs to be deleted (required) -{ - my $params = { - 'username' => { - data_type => 'string', - description => 'The name that needs to be deleted', - required => '1', - }, - }; - __PACKAGE__->method_documentation->{ delete_user } = { - summary => 'Delete user', - params => $params, - returns => undef, - }; -} -# @return void -# -sub delete_user { - my ($self, %args) = @_; - - - # verify the required parameter 'username' is set - unless (exists $args{'username'}) { - croak("Missing the required parameter 'username' when calling delete_user"); - } - - - # parse inputs - my $_resource_path = '/user/{username}'; - $_resource_path =~ s/{format}/json/; # default format to json - - my $_method = 'DELETE'; - my $query_params = {}; - my $header_params = {}; - my $form_params = {}; - - # 'Accept' and 'Content-Type' header - my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/xml'); - if ($_header_accept) { - $header_params->{'Accept'} = $_header_accept; - } - $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - # path params - if ( exists $args{'username'}) { - my $_base_variable = "{" . "username" . "}"; - my $_base_value = $self->{api_client}->to_path_value($args{'username'}); - $_resource_path =~ s/$_base_variable/$_base_value/g; - } - - my $_body_data; - - - # authentication setting, if any - my $auth_settings = [qw()]; - - # make the API Call - - $self->{api_client}->call_api($_resource_path, $_method, - $query_params, $form_params, - $header_params, $_body_data, $auth_settings); - return; - -} - 1; diff --git a/samples/client/petstore/perl/t/PetApiTest.t b/samples/client/petstore/perl/t/PetApiTest.t index ec4723812a9..91f87e56f24 100644 --- a/samples/client/petstore/perl/t/PetApiTest.t +++ b/samples/client/petstore/perl/t/PetApiTest.t @@ -29,14 +29,6 @@ use_ok('WWW::SwaggerClient::PetApi'); my $api = WWW::SwaggerClient::PetApi->new(); isa_ok($api, 'WWW::SwaggerClient::PetApi'); -# -# update_pet test -# -{ - my $body = undef; # replace NULL with a proper value - my $result = $api->update_pet(body => $body); -} - # # add_pet test # @@ -45,6 +37,23 @@ isa_ok($api, 'WWW::SwaggerClient::PetApi'); my $result = $api->add_pet(body => $body); } +# +# add_pet_using_byte_array test +# +{ + my $body = undef; # replace NULL with a proper value + my $result = $api->add_pet_using_byte_array(body => $body); +} + +# +# delete_pet test +# +{ + my $pet_id = undef; # replace NULL with a proper value + my $api_key = undef; # replace NULL with a proper value + my $result = $api->delete_pet(pet_id => $pet_id, api_key => $api_key); +} + # # find_pets_by_status test # @@ -69,35 +78,6 @@ isa_ok($api, 'WWW::SwaggerClient::PetApi'); my $result = $api->get_pet_by_id(pet_id => $pet_id); } -# -# update_pet_with_form test -# -{ - my $pet_id = undef; # replace NULL with a proper value - my $name = undef; # replace NULL with a proper value - my $status = undef; # replace NULL with a proper value - my $result = $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); -} - -# -# delete_pet test -# -{ - my $pet_id = undef; # replace NULL with a proper value - my $api_key = undef; # replace NULL with a proper value - my $result = $api->delete_pet(pet_id => $pet_id, api_key => $api_key); -} - -# -# upload_file test -# -{ - my $pet_id = undef; # replace NULL with a proper value - my $additional_metadata = undef; # replace NULL with a proper value - my $file = undef; # replace NULL with a proper value - my $result = $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); -} - # # get_pet_by_id_in_object test # @@ -115,11 +95,31 @@ isa_ok($api, 'WWW::SwaggerClient::PetApi'); } # -# add_pet_using_byte_array test +# update_pet test # { my $body = undef; # replace NULL with a proper value - my $result = $api->add_pet_using_byte_array(body => $body); + my $result = $api->update_pet(body => $body); +} + +# +# update_pet_with_form test +# +{ + my $pet_id = undef; # replace NULL with a proper value + my $name = undef; # replace NULL with a proper value + my $status = undef; # replace NULL with a proper value + my $result = $api->update_pet_with_form(pet_id => $pet_id, name => $name, status => $status); +} + +# +# upload_file test +# +{ + my $pet_id = undef; # replace NULL with a proper value + my $additional_metadata = undef; # replace NULL with a proper value + my $file = undef; # replace NULL with a proper value + my $result = $api->upload_file(pet_id => $pet_id, additional_metadata => $additional_metadata, file => $file); } diff --git a/samples/client/petstore/perl/t/StoreApiTest.t b/samples/client/petstore/perl/t/StoreApiTest.t index 3772914c7aa..a9bc3b3a4f3 100644 --- a/samples/client/petstore/perl/t/StoreApiTest.t +++ b/samples/client/petstore/perl/t/StoreApiTest.t @@ -29,6 +29,14 @@ use_ok('WWW::SwaggerClient::StoreApi'); my $api = WWW::SwaggerClient::StoreApi->new(); isa_ok($api, 'WWW::SwaggerClient::StoreApi'); +# +# delete_order test +# +{ + my $order_id = undef; # replace NULL with a proper value + my $result = $api->delete_order(order_id => $order_id); +} + # # find_orders_by_status test # @@ -51,14 +59,6 @@ isa_ok($api, 'WWW::SwaggerClient::StoreApi'); my $result = $api->get_inventory_in_object(); } -# -# place_order test -# -{ - my $body = undef; # replace NULL with a proper value - my $result = $api->place_order(body => $body); -} - # # get_order_by_id test # @@ -68,11 +68,11 @@ isa_ok($api, 'WWW::SwaggerClient::StoreApi'); } # -# delete_order test +# place_order test # { - my $order_id = undef; # replace NULL with a proper value - my $result = $api->delete_order(order_id => $order_id); + my $body = undef; # replace NULL with a proper value + my $result = $api->place_order(body => $body); } diff --git a/samples/client/petstore/perl/t/UserApiTest.t b/samples/client/petstore/perl/t/UserApiTest.t index e0bf708ca48..108484ed120 100644 --- a/samples/client/petstore/perl/t/UserApiTest.t +++ b/samples/client/petstore/perl/t/UserApiTest.t @@ -53,6 +53,22 @@ isa_ok($api, 'WWW::SwaggerClient::UserApi'); my $result = $api->create_users_with_list_input(body => $body); } +# +# delete_user test +# +{ + my $username = undef; # replace NULL with a proper value + my $result = $api->delete_user(username => $username); +} + +# +# get_user_by_name test +# +{ + my $username = undef; # replace NULL with a proper value + my $result = $api->get_user_by_name(username => $username); +} + # # login_user test # @@ -69,14 +85,6 @@ isa_ok($api, 'WWW::SwaggerClient::UserApi'); my $result = $api->logout_user(); } -# -# get_user_by_name test -# -{ - my $username = undef; # replace NULL with a proper value - my $result = $api->get_user_by_name(username => $username); -} - # # update_user test # @@ -86,13 +94,5 @@ isa_ok($api, 'WWW::SwaggerClient::UserApi'); my $result = $api->update_user(username => $username, body => $body); } -# -# delete_user test -# -{ - my $username = undef; # replace NULL with a proper value - my $result = $api->delete_user(username => $username); -} - 1;