=begin comment

Swagger Petstore

This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\

OpenAPI spec version: 1.0.0
Contact: apiteam@swagger.io
Generated by: https://github.com/swagger-api/swagger-codegen.git

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

=end comment

=cut

#
# NOTE: This class is auto generated by the swagger code generator program. 
# Do not edit the class manually.
# Ref: https://github.com/swagger-api/swagger-codegen
#
package WWW::SwaggerClient::FakeApi;

require 5.6.0;
use strict;
use warnings;
use utf8; 
use Exporter;
use Carp qw( croak );
use Log::Any qw($log);

use WWW::SwaggerClient::ApiClient;
use WWW::SwaggerClient::Configuration;

use base "Class::Data::Inheritable";

__PACKAGE__->mk_classdata('method_documentation' => {});

sub new {
    my $class   = shift;
    my (%self) = (
        'api_client' => WWW::SwaggerClient::ApiClient->instance,
        @_
    );

    #my $self = {
    #    #api_client => $options->{api_client}
    #    api_client => $default_api_client
    #}; 

    bless \%self, $class;

}


#
# test_code_inject__end
#
# To test code injection */ 
# 
# @param string $test code inject */ &#x3D;end To test code injection */  (optional)
{
    my $params = {
    'test code inject */ &#x3D;end' => {
        data_type => 'string',
        description => 'To test code injection */ ',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'test_code_inject__end' } = { 
    	summary => 'To test code injection */ ',
        params => $params,
        returns => undef,
        };
}
# @return void
#
sub test_code_inject__end {
    my ($self, %args) = @_;

    # parse inputs
    my $_resource_path = '/fake';
    $_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', '*/ end');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json', '*/ =end));(phpinfo(');

    # form params
    if ( exists $args{'test code inject */ &#x3D;end'} ) {
                $form_params->{'test code inject */ &#x3D;end'} = $self->{api_client}->to_form_value($args{'test code inject */ &#x3D;end'});
    }
    
    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;
}

#
# test_endpoint_parameters
#
# Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 
# 
# @param Number $number None (required)
# @param double $double None (required)
# @param string $string None (required)
# @param string $byte None (required)
# @param int $integer None (optional)
# @param int $int32 None (optional)
# @param int $int64 None (optional)
# @param double $float None (optional)
# @param string $binary None (optional)
# @param DateTime $date None (optional)
# @param DateTime $date_time None (optional)
# @param string $password None (optional)
{
    my $params = {
    'number' => {
        data_type => 'Number',
        description => 'None',
        required => '1',
    },
    'double' => {
        data_type => 'double',
        description => 'None',
        required => '1',
    },
    'string' => {
        data_type => 'string',
        description => 'None',
        required => '1',
    },
    'byte' => {
        data_type => 'string',
        description => 'None',
        required => '1',
    },
    'integer' => {
        data_type => 'int',
        description => 'None',
        required => '0',
    },
    'int32' => {
        data_type => 'int',
        description => 'None',
        required => '0',
    },
    'int64' => {
        data_type => 'int',
        description => 'None',
        required => '0',
    },
    'float' => {
        data_type => 'double',
        description => 'None',
        required => '0',
    },
    'binary' => {
        data_type => 'string',
        description => 'None',
        required => '0',
    },
    'date' => {
        data_type => 'DateTime',
        description => 'None',
        required => '0',
    },
    'date_time' => {
        data_type => 'DateTime',
        description => 'None',
        required => '0',
    },
    'password' => {
        data_type => 'string',
        description => 'None',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'test_endpoint_parameters' } = { 
    	summary => 'Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ',
        params => $params,
        returns => undef,
        };
}
# @return void
#
sub test_endpoint_parameters {
    my ($self, %args) = @_;

    # verify the required parameter 'number' is set
    unless (exists $args{'number'}) {
      croak("Missing the required parameter 'number' when calling test_endpoint_parameters");
    }

    # verify the required parameter 'double' is set
    unless (exists $args{'double'}) {
      croak("Missing the required parameter 'double' when calling test_endpoint_parameters");
    }

    # verify the required parameter 'string' is set
    unless (exists $args{'string'}) {
      croak("Missing the required parameter 'string' when calling test_endpoint_parameters");
    }

    # verify the required parameter 'byte' is set
    unless (exists $args{'byte'}) {
      croak("Missing the required parameter 'byte' when calling test_endpoint_parameters");
    }

    # parse inputs
    my $_resource_path = '/fake';
    $_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/xml; charset=utf-8', 'application/json; charset=utf-8');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/xml; charset=utf-8', 'application/json; charset=utf-8');

    # form params
    if ( exists $args{'integer'} ) {
                $form_params->{'integer'} = $self->{api_client}->to_form_value($args{'integer'});
    }
    
    # form params
    if ( exists $args{'int32'} ) {
                $form_params->{'int32'} = $self->{api_client}->to_form_value($args{'int32'});
    }
    
    # form params
    if ( exists $args{'int64'} ) {
                $form_params->{'int64'} = $self->{api_client}->to_form_value($args{'int64'});
    }
    
    # form params
    if ( exists $args{'number'} ) {
                $form_params->{'number'} = $self->{api_client}->to_form_value($args{'number'});
    }
    
    # form params
    if ( exists $args{'float'} ) {
                $form_params->{'float'} = $self->{api_client}->to_form_value($args{'float'});
    }
    
    # form params
    if ( exists $args{'double'} ) {
                $form_params->{'double'} = $self->{api_client}->to_form_value($args{'double'});
    }
    
    # form params
    if ( exists $args{'string'} ) {
                $form_params->{'string'} = $self->{api_client}->to_form_value($args{'string'});
    }
    
    # form params
    if ( exists $args{'byte'} ) {
                $form_params->{'byte'} = $self->{api_client}->to_form_value($args{'byte'});
    }
    
    # form params
    if ( exists $args{'binary'} ) {
                $form_params->{'binary'} = $self->{api_client}->to_form_value($args{'binary'});
    }
    
    # form params
    if ( exists $args{'date'} ) {
                $form_params->{'date'} = $self->{api_client}->to_form_value($args{'date'});
    }
    
    # form params
    if ( exists $args{'date_time'} ) {
                $form_params->{'dateTime'} = $self->{api_client}->to_form_value($args{'date_time'});
    }
    
    # form params
    if ( exists $args{'password'} ) {
                $form_params->{'password'} = $self->{api_client}->to_form_value($args{'password'});
    }
    
    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;
}

#
# test_enum_query_parameters
#
# To test enum query parameters
# 
# @param string $enum_query_string Query parameter enum test (string) (optional, default to -efg)
# @param Number $enum_query_integer Query parameter enum test (double) (optional)
# @param double $enum_query_double Query parameter enum test (double) (optional)
{
    my $params = {
    'enum_query_string' => {
        data_type => 'string',
        description => 'Query parameter enum test (string)',
        required => '0',
    },
    'enum_query_integer' => {
        data_type => 'Number',
        description => 'Query parameter enum test (double)',
        required => '0',
    },
    'enum_query_double' => {
        data_type => 'double',
        description => 'Query parameter enum test (double)',
        required => '0',
    },
    };
    __PACKAGE__->method_documentation->{ 'test_enum_query_parameters' } = { 
    	summary => 'To test enum query parameters',
        params => $params,
        returns => undef,
        };
}
# @return void
#
sub test_enum_query_parameters {
    my ($self, %args) = @_;

    # parse inputs
    my $_resource_path = '/fake';
    $_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');
    if ($_header_accept) {
        $header_params->{'Accept'} = $_header_accept;
    }
    $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');

    # query params
    if ( exists $args{'enum_query_integer'}) {
        $query_params->{'enum_query_integer'} = $self->{api_client}->to_query_value($args{'enum_query_integer'});
    }

    # form params
    if ( exists $args{'enum_query_string'} ) {
                $form_params->{'enum_query_string'} = $self->{api_client}->to_form_value($args{'enum_query_string'});
    }
    
    # form params
    if ( exists $args{'enum_query_double'} ) {
                $form_params->{'enum_query_double'} = $self->{api_client}->to_form_value($args{'enum_query_double'});
    }
    
    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;
