forked from loafle/openapi-generator-original
add auth setting to perl doc
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user