mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 22:50:53 +00:00
add new perl petstore files
This commit is contained in:
parent
72d0cd7eb4
commit
598c21b06e
@ -0,0 +1,15 @@
|
|||||||
|
# WWW::SwaggerClient::Object::ArrayOfArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::ArrayOfArrayOfNumberOnly;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**array_array_number** | **ARRAY[ARRAY[Number]]** | | [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)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/perl/docs/ArrayOfNumberOnly.md
Normal file
15
samples/client/petstore/perl/docs/ArrayOfNumberOnly.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# WWW::SwaggerClient::Object::ArrayOfNumberOnly
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::ArrayOfNumberOnly;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**array_number** | [**ARRAY[Number]**](Number.md) | | [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)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/perl/docs/Client.md
Normal file
15
samples/client/petstore/perl/docs/Client.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# WWW::SwaggerClient::Object::Client
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::Client;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**client** | **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)
|
||||||
|
|
||||||
|
|
16
samples/client/petstore/perl/docs/EnumArrays.md
Normal file
16
samples/client/petstore/perl/docs/EnumArrays.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# WWW::SwaggerClient::Object::EnumArrays
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::EnumArrays;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**just_symbol** | **string** | | [optional]
|
||||||
|
**array_enum** | **ARRAY[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)
|
||||||
|
|
||||||
|
|
16
samples/client/petstore/perl/docs/HasOnlyReadOnly.md
Normal file
16
samples/client/petstore/perl/docs/HasOnlyReadOnly.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# WWW::SwaggerClient::Object::HasOnlyReadOnly
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::HasOnlyReadOnly;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**bar** | **string** | | [optional]
|
||||||
|
**foo** | **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)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/perl/docs/List.md
Normal file
15
samples/client/petstore/perl/docs/List.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# WWW::SwaggerClient::Object::List
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::List;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**_123_list** | **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)
|
||||||
|
|
||||||
|
|
16
samples/client/petstore/perl/docs/MapTest.md
Normal file
16
samples/client/petstore/perl/docs/MapTest.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# WWW::SwaggerClient::Object::MapTest
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::MapTest;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**map_map_of_string** | **HASH[string,HASH[string,string]]** | | [optional]
|
||||||
|
**map_of_enum_string** | **HASH[string,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)
|
||||||
|
|
||||||
|
|
15
samples/client/petstore/perl/docs/NumberOnly.md
Normal file
15
samples/client/petstore/perl/docs/NumberOnly.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# WWW::SwaggerClient::Object::NumberOnly
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```perl
|
||||||
|
use WWW::SwaggerClient::Object::NumberOnly;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**just_number** | [**Number**](Number.md) | | [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)
|
||||||
|
|
||||||
|
|
@ -0,0 +1,189 @@
|
|||||||
|
=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::Object::ArrayOfArrayOfNumberOnly;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'ArrayOfArrayOfNumberOnly',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'array_array_number' => {
|
||||||
|
datatype => 'ARRAY[ARRAY[Number]]',
|
||||||
|
base_name => 'ArrayArrayNumber',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'array_array_number' => 'ARRAY[ARRAY[Number]]'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'array_array_number' => 'ArrayArrayNumber'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,189 @@
|
|||||||
|
=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::Object::ArrayOfNumberOnly;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'ArrayOfNumberOnly',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'array_number' => {
|
||||||
|
datatype => 'ARRAY[Number]',
|
||||||
|
base_name => 'ArrayNumber',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'array_number' => 'ARRAY[Number]'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'array_number' => 'ArrayNumber'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,189 @@
|
|||||||
|
=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::Object::Client;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'Client',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'client' => {
|
||||||
|
datatype => 'string',
|
||||||
|
base_name => 'client',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'client' => 'string'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'client' => 'client'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,198 @@
|
|||||||
|
=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::Object::EnumArrays;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'EnumArrays',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'just_symbol' => {
|
||||||
|
datatype => 'string',
|
||||||
|
base_name => 'just_symbol',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
'array_enum' => {
|
||||||
|
datatype => 'ARRAY[string]',
|
||||||
|
base_name => 'array_enum',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'just_symbol' => 'string',
|
||||||
|
'array_enum' => 'ARRAY[string]'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'just_symbol' => 'just_symbol',
|
||||||
|
'array_enum' => 'array_enum'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,198 @@
|
|||||||
|
=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::Object::HasOnlyReadOnly;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'HasOnlyReadOnly',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'bar' => {
|
||||||
|
datatype => 'string',
|
||||||
|
base_name => 'bar',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
'foo' => {
|
||||||
|
datatype => 'string',
|
||||||
|
base_name => 'foo',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'bar' => 'string',
|
||||||
|
'foo' => 'string'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'bar' => 'bar',
|
||||||
|
'foo' => 'foo'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,189 @@
|
|||||||
|
=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::Object::List;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'List',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'_123_list' => {
|
||||||
|
datatype => 'string',
|
||||||
|
base_name => '123-list',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'_123_list' => 'string'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'_123_list' => '123-list'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,198 @@
|
|||||||
|
=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::Object::MapTest;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'MapTest',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'map_map_of_string' => {
|
||||||
|
datatype => 'HASH[string,HASH[string,string]]',
|
||||||
|
base_name => 'map_map_of_string',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
'map_of_enum_string' => {
|
||||||
|
datatype => 'HASH[string,string]',
|
||||||
|
base_name => 'map_of_enum_string',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'map_map_of_string' => 'HASH[string,HASH[string,string]]',
|
||||||
|
'map_of_enum_string' => 'HASH[string,string]'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'map_map_of_string' => 'map_map_of_string',
|
||||||
|
'map_of_enum_string' => 'map_of_enum_string'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,189 @@
|
|||||||
|
=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::Object::NumberOnly;
|
||||||
|
|
||||||
|
require 5.6.0;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
use utf8;
|
||||||
|
use JSON qw(decode_json);
|
||||||
|
use Data::Dumper;
|
||||||
|
use Module::Runtime qw(use_module);
|
||||||
|
use Log::Any qw($log);
|
||||||
|
use Date::Parse;
|
||||||
|
use DateTime;
|
||||||
|
|
||||||
|
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
#
|
||||||
|
|
||||||
|
=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__->mk_classdata('attribute_map' => {});
|
||||||
|
__PACKAGE__->mk_classdata('swagger_types' => {});
|
||||||
|
__PACKAGE__->mk_classdata('method_documentation' => {});
|
||||||
|
__PACKAGE__->mk_classdata('class_documentation' => {});
|
||||||
|
|
||||||
|
# new object
|
||||||
|
sub new {
|
||||||
|
my ($class, %args) = @_;
|
||||||
|
|
||||||
|
my $self = bless {}, $class;
|
||||||
|
|
||||||
|
foreach my $attribute (keys %{$class->attribute_map}) {
|
||||||
|
my $args_key = $class->attribute_map->{$attribute};
|
||||||
|
$self->$attribute( $args{ $args_key } );
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# return perl hash
|
||||||
|
sub to_hash {
|
||||||
|
return decode_json(JSON->new->convert_blessed->encode( shift ));
|
||||||
|
}
|
||||||
|
|
||||||
|
# used by JSON for serialization
|
||||||
|
sub TO_JSON {
|
||||||
|
my $self = shift;
|
||||||
|
my $_data = {};
|
||||||
|
foreach my $_key (keys %{$self->attribute_map}) {
|
||||||
|
if (defined $self->{$_key}) {
|
||||||
|
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
# from Perl hashref
|
||||||
|
sub from_hash {
|
||||||
|
my ($self, $hash) = @_;
|
||||||
|
|
||||||
|
# loop through attributes and use swagger_types to deserialize the data
|
||||||
|
while ( my ($_key, $_type) = each %{$self->swagger_types} ) {
|
||||||
|
my $_json_attribute = $self->attribute_map->{$_key};
|
||||||
|
if ($_type =~ /^array\[/i) { # array
|
||||||
|
my $_subclass = substr($_type, 6, -1);
|
||||||
|
my @_array = ();
|
||||||
|
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
||||||
|
push @_array, $self->_deserialize($_subclass, $_element);
|
||||||
|
}
|
||||||
|
$self->{$_key} = \@_array;
|
||||||
|
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
|
||||||
|
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
|
||||||
|
} else {
|
||||||
|
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $self;
|
||||||
|
}
|
||||||
|
|
||||||
|
# deserialize non-array data
|
||||||
|
sub _deserialize {
|
||||||
|
my ($self, $type, $data) = @_;
|
||||||
|
$log->debugf("deserializing %s with %s",Dumper($data), $type);
|
||||||
|
|
||||||
|
if ($type eq 'DateTime') {
|
||||||
|
return DateTime->from_epoch(epoch => str2time($data));
|
||||||
|
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
|
||||||
|
return $data;
|
||||||
|
} else { # hash(model)
|
||||||
|
my $_instance = eval "WWW::SwaggerClient::Object::$type->new()";
|
||||||
|
return $_instance->from_hash($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
__PACKAGE__->class_documentation({description => '',
|
||||||
|
class => 'NumberOnly',
|
||||||
|
required => [], # TODO
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->method_documentation({
|
||||||
|
'just_number' => {
|
||||||
|
datatype => 'Number',
|
||||||
|
base_name => 'JustNumber',
|
||||||
|
description => '',
|
||||||
|
format => '',
|
||||||
|
read_only => '',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
__PACKAGE__->swagger_types( {
|
||||||
|
'just_number' => 'Number'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->attribute_map( {
|
||||||
|
'just_number' => 'JustNumber'
|
||||||
|
} );
|
||||||
|
|
||||||
|
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
||||||
|
|
||||||
|
|
||||||
|
1;
|
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::ArrayOfArrayOfNumberOnly');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::ArrayOfArrayOfNumberOnly->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::ArrayOfArrayOfNumberOnly');
|
||||||
|
|
45
samples/client/petstore/perl/t/ArrayOfNumberOnlyTest.t
Normal file
45
samples/client/petstore/perl/t/ArrayOfNumberOnlyTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::ArrayOfNumberOnly');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::ArrayOfNumberOnly->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::ArrayOfNumberOnly');
|
||||||
|
|
45
samples/client/petstore/perl/t/ClientTest.t
Normal file
45
samples/client/petstore/perl/t/ClientTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::Client');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::Client->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::Client');
|
||||||
|
|
45
samples/client/petstore/perl/t/EnumArraysTest.t
Normal file
45
samples/client/petstore/perl/t/EnumArraysTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::EnumArrays');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::EnumArrays->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::EnumArrays');
|
||||||
|
|
45
samples/client/petstore/perl/t/HasOnlyReadOnlyTest.t
Normal file
45
samples/client/petstore/perl/t/HasOnlyReadOnlyTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::HasOnlyReadOnly');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::HasOnlyReadOnly->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::HasOnlyReadOnly');
|
||||||
|
|
45
samples/client/petstore/perl/t/ListTest.t
Normal file
45
samples/client/petstore/perl/t/ListTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::List');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::List->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::List');
|
||||||
|
|
45
samples/client/petstore/perl/t/MapTestTest.t
Normal file
45
samples/client/petstore/perl/t/MapTestTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::MapTest');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::MapTest->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::MapTest');
|
||||||
|
|
45
samples/client/petstore/perl/t/NumberOnlyTest.t
Normal file
45
samples/client/petstore/perl/t/NumberOnlyTest.t
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
=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 Codegen
|
||||||
|
# Please update the test cases below to test the model.
|
||||||
|
# Ref: https://github.com/swagger-api/swagger-codegen
|
||||||
|
#
|
||||||
|
use Test::More tests => 2;
|
||||||
|
use Test::Exception;
|
||||||
|
|
||||||
|
use lib 'lib';
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
|
use_ok('WWW::SwaggerClient::Object::NumberOnly');
|
||||||
|
|
||||||
|
my $instance = WWW::SwaggerClient::Object::NumberOnly->new();
|
||||||
|
|
||||||
|
isa_ok($instance, 'WWW::SwaggerClient::Object::NumberOnly');
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user