diff --git a/modules/swagger-codegen/src/main/resources/perl/api.mustache b/modules/swagger-codegen/src/main/resources/perl/api.mustache index 7e0770f332f..d96a2302a8a 100644 --- a/modules/swagger-codegen/src/main/resources/perl/api.mustache +++ b/modules/swagger-codegen/src/main/resources/perl/api.mustache @@ -81,13 +81,15 @@ sub new { sub {{operationId}} { my ($self, %args) = @_; - {{#allParams}}{{#required}} + {{#allParams}} + {{#required}} # verify the required parameter '{{paramName}}' is set unless (exists $args{'{{paramName}}'}) { croak("Missing the required parameter '{{paramName}}' when calling {{operationId}}"); } - {{/required}}{{/allParams}} + {{/required}} + {{/allParams}} # parse inputs my $_resource_path = '{{path}}'; $_resource_path =~ s/{format}/json/; # default format to json @@ -104,54 +106,70 @@ sub {{operationId}} { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type({{#consumes}}'{{mediaType}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}); - {{#queryParams}}# query params + {{#queryParams}} + # query params if ( exists $args{'{{paramName}}'}) { $query_params->{'{{baseName}}'} = $self->{api_client}->to_query_value($args{'{{paramName}}'}); - }{{/queryParams}} - {{#headerParams}}# header params + } + + {{/queryParams}} + {{#headerParams}} + # header params if ( exists $args{'{{paramName}}'}) { $header_params->{'{{baseName}}'} = $self->{api_client}->to_header_value($args{'{{paramName}}'}); - }{{/headerParams}} - {{#pathParams}}# path params + } + + {{/headerParams}} + {{#pathParams}} + # path params if ( exists $args{'{{paramName}}'}) { my $_base_variable = "{" . "{{baseName}}" . "}"; my $_base_value = $self->{api_client}->to_path_value($args{'{{paramName}}'}); $_resource_path =~ s/$_base_variable/$_base_value/g; - }{{/pathParams}} - {{#formParams}}# form params + } + + {{/pathParams}} + {{#formParams}} + # form params if ( exists $args{'{{paramName}}'} ) { {{#isFile}}$form_params->{'{{baseName}}'} = [] unless defined $form_params->{'{{baseName}}'}; push @{$form_params->{'{{baseName}}'}}, $args{'{{paramName}}'}; {{/isFile}} {{^isFile}}$form_params->{'{{baseName}}'} = $self->{api_client}->to_form_value($args{'{{paramName}}'}); {{/isFile}} - }{{/formParams}} + } + + {{/formParams}} my $_body_data; - {{#bodyParams}}# body params + {{#bodyParams}} + # body params if ( exists $args{'{{paramName}}'}) { $_body_data = $args{'{{paramName}}'}; - }{{/bodyParams}} + } + {{/bodyParams}} # authentication setting, if any my $auth_settings = [qw({{#authMethods}}{{name}} {{/authMethods}})]; # make the API Call - {{#returnType}}my $response = $self->{api_client}->call_api($_resource_path, $_method, + {{#returnType}} + 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('{{returnType}}', $response); - return $_response_object;{{/returnType}} - {{^returnType}}$self->{api_client}->call_api($_resource_path, $_method, + return $_response_object; + {{/returnType}} + {{^returnType}} + $self->{api_client}->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); return; {{/returnType}} } {{/operation}} -{{newline}} {{/operations}} 1; diff --git a/samples/client/petstore/perl/README.md b/samples/client/petstore/perl/README.md index 209bb76bca1..18db67296f2 100644 --- a/samples/client/petstore/perl/README.md +++ b/samples/client/petstore/perl/README.md @@ -10,7 +10,7 @@ Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/ - API version: 1.0.0 - Package version: 1.0.0 -- Build date: 2016-04-11T20:30:20.696+08:00 +- Build date: 2016-04-12T12:54:53.924+08:00 - Build package: class io.swagger.codegen.languages.PerlClientCodegen ## A note on Moose diff --git a/samples/client/petstore/perl/docs/FormatTest.md b/samples/client/petstore/perl/docs/FormatTest.md index c99370c0040..60cd71ac61f 100644 --- a/samples/client/petstore/perl/docs/FormatTest.md +++ b/samples/client/petstore/perl/docs/FormatTest.md @@ -18,7 +18,8 @@ Name | Type | Description | Notes **byte** | **string** | | [optional] **binary** | **string** | | [optional] **date** | **DateTime** | | [optional] -**date_time** | **string** | | [optional] +**date_time** | **DateTime** | | [optional] +**password** | **string** | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm index 3bc403453c5..725c290b11d 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/Object/FormatTest.pm @@ -174,12 +174,19 @@ __PACKAGE__->method_documentation({ read_only => '', }, 'date_time' => { - datatype => 'string', + datatype => 'DateTime', base_name => 'dateTime', description => '', format => '', read_only => '', }, + 'password' => { + datatype => 'string', + base_name => 'password', + description => '', + format => '', + read_only => '', + }, }); __PACKAGE__->swagger_types( { @@ -193,7 +200,8 @@ __PACKAGE__->swagger_types( { 'byte' => 'string', 'binary' => 'string', 'date' => 'DateTime', - 'date_time' => 'string' + 'date_time' => 'DateTime', + 'password' => 'string' } ); __PACKAGE__->attribute_map( { @@ -207,7 +215,8 @@ __PACKAGE__->attribute_map( { 'byte' => 'byte', 'binary' => 'binary', 'date' => 'date', - 'date_time' => 'dateTime' + 'date_time' => 'dateTime', + 'password' => 'password' } ); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm index 9775dea4752..53222949718 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/PetApi.pm @@ -76,8 +76,6 @@ sub new { sub add_pet { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/pet'; $_resource_path =~ s/{format}/json/; # default format to json @@ -94,10 +92,6 @@ sub add_pet { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -108,7 +102,6 @@ sub add_pet { 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); @@ -140,8 +133,6 @@ sub add_pet { 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 @@ -158,10 +149,6 @@ sub add_pet_using_byte_array { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -172,7 +159,6 @@ sub add_pet_using_byte_array { 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); @@ -210,12 +196,10 @@ sub add_pet_using_byte_array { 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}'; @@ -233,26 +217,23 @@ sub delete_pet { } $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; - + 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); @@ -284,8 +265,6 @@ sub delete_pet { sub find_pets_by_status { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/pet/findByStatus'; $_resource_path =~ s/{format}/json/; # default format to json @@ -306,12 +285,8 @@ sub find_pets_by_status { if ( exists $args{'status'}) { $query_params->{'status'} = $self->{api_client}->to_query_value($args{'status'}); } - - - - my $_body_data; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(petstore_auth )]; @@ -324,7 +299,7 @@ sub find_pets_by_status { } my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response); return $_response_object; - } +} # # find_pets_by_tags @@ -351,8 +326,6 @@ sub find_pets_by_status { sub find_pets_by_tags { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/pet/findByTags'; $_resource_path =~ s/{format}/json/; # default format to json @@ -373,12 +346,8 @@ sub find_pets_by_tags { if ( exists $args{'tags'}) { $query_params->{'tags'} = $self->{api_client}->to_query_value($args{'tags'}); } - - - - my $_body_data; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(petstore_auth )]; @@ -391,7 +360,7 @@ sub find_pets_by_tags { } my $_response_object = $self->{api_client}->deserialize('ARRAY[Pet]', $response); return $_response_object; - } +} # # get_pet_by_id @@ -418,12 +387,10 @@ sub find_pets_by_tags { sub get_pet_by_id { 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 get_pet_by_id"); } - # parse inputs my $_resource_path = '/pet/{petId}'; @@ -441,18 +408,14 @@ sub get_pet_by_id { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - # 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; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(api_key petstore_auth )]; @@ -465,7 +428,7 @@ sub get_pet_by_id { } my $_response_object = $self->{api_client}->deserialize('Pet', $response); return $_response_object; - } +} # # get_pet_by_id_in_object @@ -492,12 +455,10 @@ sub get_pet_by_id { sub get_pet_by_id_in_object { 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 get_pet_by_id_in_object"); } - # parse inputs my $_resource_path = '/pet/{petId}?response=inline_arbitrary_object'; @@ -515,18 +476,14 @@ sub get_pet_by_id_in_object { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - # 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; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(api_key petstore_auth )]; @@ -539,7 +496,7 @@ sub get_pet_by_id_in_object { } my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response); return $_response_object; - } +} # # pet_pet_idtesting_byte_arraytrue_get @@ -566,12 +523,10 @@ sub get_pet_by_id_in_object { sub pet_pet_idtesting_byte_arraytrue_get { 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 pet_pet_idtesting_byte_arraytrue_get"); } - # parse inputs my $_resource_path = '/pet/{petId}?testing_byte_array=true'; @@ -589,18 +544,14 @@ sub pet_pet_idtesting_byte_arraytrue_get { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - # 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; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(api_key petstore_auth )]; @@ -613,7 +564,7 @@ sub pet_pet_idtesting_byte_arraytrue_get { } my $_response_object = $self->{api_client}->deserialize('string', $response); return $_response_object; - } +} # # update_pet @@ -640,8 +591,6 @@ sub pet_pet_idtesting_byte_arraytrue_get { sub update_pet { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/pet'; $_resource_path =~ s/{format}/json/; # default format to json @@ -658,10 +607,6 @@ sub update_pet { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', 'application/xml'); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -672,7 +617,6 @@ sub update_pet { 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); @@ -716,12 +660,10 @@ sub update_pet { 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}'; @@ -739,29 +681,28 @@ sub update_pet_with_form { } $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 + } + + # form params if ( exists $args{'status'} ) { $form_params->{'status'} = $self->{api_client}->to_form_value($args{'status'}); } - my $_body_data; - + 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); @@ -805,12 +746,10 @@ sub update_pet_with_form { 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'; @@ -828,35 +767,33 @@ sub upload_file { } $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 + } + + # form params if ( exists $args{'file'} ) { $form_params->{'file'} = [] unless defined $form_params->{'file'}; push @{$form_params->{'file'}}, $args{'file'}; } - my $_body_data; - + 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 b410576517c..77b2c79e112 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-04-11T20:30:20.696+08:00', + generated_date => '2016-04-12T12:54:53.924+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-04-11T20:30:20.696+08:00 +=item Build date: 2016-04-12T12:54:53.924+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 ddd01f75ac7..69b31f5e4ad 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/StoreApi.pm @@ -76,12 +76,10 @@ sub new { 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}'; @@ -99,23 +97,18 @@ sub delete_order { } $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; - + 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); @@ -147,8 +140,6 @@ sub delete_order { sub find_orders_by_status { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/store/findByStatus'; $_resource_path =~ s/{format}/json/; # default format to json @@ -169,12 +160,8 @@ sub find_orders_by_status { if ( exists $args{'status'}) { $query_params->{'status'} = $self->{api_client}->to_query_value($args{'status'}); } - - - - my $_body_data; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(test_api_client_id test_api_client_secret )]; @@ -187,7 +174,7 @@ sub find_orders_by_status { } my $_response_object = $self->{api_client}->deserialize('ARRAY[Order]', $response); return $_response_object; - } +} # # get_inventory @@ -208,8 +195,6 @@ sub find_orders_by_status { sub get_inventory { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/store/inventory'; $_resource_path =~ s/{format}/json/; # default format to json @@ -226,13 +211,7 @@ sub get_inventory { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - my $_body_data; - - # authentication setting, if any my $auth_settings = [qw(api_key )]; @@ -245,7 +224,7 @@ sub get_inventory { } my $_response_object = $self->{api_client}->deserialize('HASH[string,int]', $response); return $_response_object; - } +} # # get_inventory_in_object @@ -266,8 +245,6 @@ sub get_inventory { sub get_inventory_in_object { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/store/inventory?response=arbitrary_object'; $_resource_path =~ s/{format}/json/; # default format to json @@ -284,13 +261,7 @@ sub get_inventory_in_object { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - my $_body_data; - - # authentication setting, if any my $auth_settings = [qw(api_key )]; @@ -303,7 +274,7 @@ sub get_inventory_in_object { } my $_response_object = $self->{api_client}->deserialize('object', $response); return $_response_object; - } +} # # get_order_by_id @@ -330,12 +301,10 @@ sub get_inventory_in_object { sub get_order_by_id { 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 get_order_by_id"); } - # parse inputs my $_resource_path = '/store/order/{orderId}'; @@ -353,18 +322,14 @@ sub get_order_by_id { } $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; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(test_api_key_header test_api_key_query )]; @@ -377,7 +342,7 @@ sub get_order_by_id { } my $_response_object = $self->{api_client}->deserialize('Order', $response); return $_response_object; - } +} # # place_order @@ -404,8 +369,6 @@ sub get_order_by_id { sub place_order { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/store/order'; $_resource_path =~ s/{format}/json/; # default format to json @@ -422,10 +385,6 @@ sub place_order { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -444,7 +403,6 @@ sub place_order { } my $_response_object = $self->{api_client}->deserialize('Order', $response); return $_response_object; - } - +} 1; diff --git a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm index d0510f30e06..20e2a1644dc 100644 --- a/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm +++ b/samples/client/petstore/perl/lib/WWW/SwaggerClient/UserApi.pm @@ -76,8 +76,6 @@ sub new { sub create_user { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/user'; $_resource_path =~ s/{format}/json/; # default format to json @@ -94,10 +92,6 @@ sub create_user { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -108,7 +102,6 @@ sub create_user { 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); @@ -140,8 +133,6 @@ sub create_user { sub create_users_with_array_input { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/user/createWithArray'; $_resource_path =~ s/{format}/json/; # default format to json @@ -158,10 +149,6 @@ sub create_users_with_array_input { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -172,7 +159,6 @@ sub create_users_with_array_input { 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); @@ -204,8 +190,6 @@ sub create_users_with_array_input { sub create_users_with_list_input { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/user/createWithList'; $_resource_path =~ s/{format}/json/; # default format to json @@ -222,10 +206,6 @@ sub create_users_with_list_input { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - my $_body_data; # body params if ( exists $args{'body'}) { @@ -236,7 +216,6 @@ sub create_users_with_list_input { 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); @@ -268,12 +247,10 @@ sub create_users_with_list_input { 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}'; @@ -291,23 +268,18 @@ sub delete_user { } $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; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw(test_http_basic )]; # make the API Call - $self->{api_client}->call_api($_resource_path, $_method, $query_params, $form_params, $header_params, $_body_data, $auth_settings); @@ -339,12 +311,10 @@ sub delete_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}'; @@ -362,18 +332,14 @@ sub get_user_by_name { } $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; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw()]; @@ -386,7 +352,7 @@ sub get_user_by_name { } my $_response_object = $self->{api_client}->deserialize('User', $response); return $_response_object; - } +} # # login_user @@ -419,8 +385,6 @@ sub get_user_by_name { sub login_user { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/user/login'; $_resource_path =~ s/{format}/json/; # default format to json @@ -440,16 +404,14 @@ sub login_user { # query params if ( exists $args{'username'}) { $query_params->{'username'} = $self->{api_client}->to_query_value($args{'username'}); - }# query params + } + + # query params if ( exists $args{'password'}) { $query_params->{'password'} = $self->{api_client}->to_query_value($args{'password'}); } - - - - my $_body_data; - + my $_body_data; # authentication setting, if any my $auth_settings = [qw()]; @@ -462,7 +424,7 @@ sub login_user { } my $_response_object = $self->{api_client}->deserialize('string', $response); return $_response_object; - } +} # # logout_user @@ -483,8 +445,6 @@ sub login_user { sub logout_user { my ($self, %args) = @_; - - # parse inputs my $_resource_path = '/user/logout'; $_resource_path =~ s/{format}/json/; # default format to json @@ -501,18 +461,11 @@ sub logout_user { } $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type(); - - - - 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); @@ -550,12 +503,10 @@ sub logout_user { sub update_user { my ($self, %args) = @_; - # verify the required parameter 'username' is set unless (exists $args{'username'}) { croak("Missing the required parameter 'username' when calling update_user"); } - # parse inputs my $_resource_path = '/user/{username}'; @@ -573,15 +524,13 @@ sub update_user { } $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; # body params if ( exists $args{'body'}) { @@ -592,12 +541,10 @@ sub update_user { 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;