mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-07-04 14:40:53 +00:00
Remove outdated files in perl petstore cilents (#17668)
* remove outdated files in perl cilents * update samples
This commit is contained in:
parent
227c8602f7
commit
df0e13f0c6
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesArray
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesArray;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesInteger
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesInteger;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesNumber
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesNumber;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesObject
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesObject;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AdditionalPropertiesString
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AdditionalPropertiesString;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::Adult
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::Adult;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**duplicated_optional** | **int** | | [optional]
|
|
||||||
**duplicated_required** | **int** | |
|
|
||||||
**children** | [**ARRAY[Child]**](Child.md) | | [optional]
|
|
||||||
**adult_required** | **boolean** | | [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)
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::AnimalFarm
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::AnimalFarm;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::BigCat
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::BigCat;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**kind** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::Body4
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::Body4;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**param** | **string** | field1 |
|
|
||||||
**param2** | **string** | field2 |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::Child
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::Child;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**age** | **int** | | [optional]
|
|
||||||
**first_name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::DeprecatedObject
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::DeprecatedObject;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::Human
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::Human;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**___type** | **string** | | [optional]
|
|
||||||
**body** | **string** | |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineObject
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineObject;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**name** | **string** | Updated name of the pet | [optional]
|
|
||||||
**status** | **string** | Updated status of the pet | [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)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineObject1
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineObject1;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**additional_metadata** | **string** | Additional data to pass to server | [optional]
|
|
||||||
**file** | **string** | file to upload | [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)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineObject2
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineObject2;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**enum_form_string_array** | **ARRAY[string]** | Form parameter enum test (string array) | [optional]
|
|
||||||
**enum_form_string** | **string** | Form parameter enum test (string) | [optional] [default to '-efg']
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineObject3
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineObject3;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**integer** | **int** | None | [optional]
|
|
||||||
**int32** | **int** | None | [optional]
|
|
||||||
**int64** | **int** | None | [optional]
|
|
||||||
**number** | **double** | None |
|
|
||||||
**float** | **double** | None | [optional]
|
|
||||||
**double** | **double** | None |
|
|
||||||
**string** | **string** | None | [optional]
|
|
||||||
**pattern_without_delimiter** | **string** | None |
|
|
||||||
**byte** | **string** | None |
|
|
||||||
**binary** | **string** | None | [optional]
|
|
||||||
**date** | **DateTime** | None | [optional]
|
|
||||||
**date_time** | **DateTime** | None | [optional]
|
|
||||||
**password** | **string** | None | [optional]
|
|
||||||
**callback** | **string** | None | [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)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineObject4
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineObject4;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**param** | **string** | field1 |
|
|
||||||
**param2** | **string** | field2 |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineObject5
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineObject5;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**additional_metadata** | **string** | Additional data to pass to server | [optional]
|
|
||||||
**required_file** | **string** | file to upload |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineResponse200
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineResponse200;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**tags** | [**ARRAY[Tag]**](Tag.md) | | [optional]
|
|
||||||
**id** | **int** | |
|
|
||||||
**category** | **object** | | [optional]
|
|
||||||
**status** | **string** | pet status in the store | [optional]
|
|
||||||
**name** | **string** | | [optional]
|
|
||||||
**photo_urls** | **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)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::InlineResponseDefault
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::InlineResponseDefault;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**string** | [**Foo**](Foo.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)
|
|
||||||
|
|
||||||
|
|
@ -1,13 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::ObjectReturn
|
|
||||||
|
|
||||||
## Import the module
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::ObjectReturn;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**return** | **int** | | [optional]
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::OuterBoolean
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::OuterBoolean;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::OuterNumber
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::OuterNumber;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::OuterString
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::OuterString;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::Person
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::Person;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**___type** | **string** | | [optional]
|
|
||||||
**last_name** | **string** | | [optional]
|
|
||||||
**first_name** | **string** | | [optional]
|
|
||||||
**duplicated_optional** | **string** | | [optional]
|
|
||||||
**duplicated_required** | **string** | |
|
|
||||||
**person_required** | **DateTime** | |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::SpecialModelName_
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::SpecialModelName_;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**__special[property/name]** | **int** | | [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)
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::StringBooleanMap
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::StringBooleanMap;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::TypeHolderDefault
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::TypeHolderDefault;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**string_item** | **string** | | [default to 'what']
|
|
||||||
**number_item** | **double** | |
|
|
||||||
**integer_item** | **int** | |
|
|
||||||
**bool_item** | **boolean** | | [default to true]
|
|
||||||
**array_item** | **ARRAY[int]** | |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::TypeHolderExample
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::TypeHolderExample;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**string_item** | **string** | |
|
|
||||||
**number_item** | **double** | |
|
|
||||||
**float_item** | **double** | |
|
|
||||||
**integer_item** | **int** | |
|
|
||||||
**bool_item** | **boolean** | |
|
|
||||||
**array_item** | **ARRAY[int]** | |
|
|
||||||
|
|
||||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
||||||
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
# WWW::OpenAPIClient::Object::XmlItem
|
|
||||||
|
|
||||||
## Load the model package
|
|
||||||
```perl
|
|
||||||
use WWW::OpenAPIClient::Object::XmlItem;
|
|
||||||
```
|
|
||||||
|
|
||||||
## Properties
|
|
||||||
Name | Type | Description | Notes
|
|
||||||
------------ | ------------- | ------------- | -------------
|
|
||||||
**attribute_string** | **string** | | [optional]
|
|
||||||
**attribute_number** | **double** | | [optional]
|
|
||||||
**attribute_integer** | **int** | | [optional]
|
|
||||||
**attribute_boolean** | **boolean** | | [optional]
|
|
||||||
**wrapped_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**name_string** | **string** | | [optional]
|
|
||||||
**name_number** | **double** | | [optional]
|
|
||||||
**name_integer** | **int** | | [optional]
|
|
||||||
**name_boolean** | **boolean** | | [optional]
|
|
||||||
**name_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**name_wrapped_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**prefix_string** | **string** | | [optional]
|
|
||||||
**prefix_number** | **double** | | [optional]
|
|
||||||
**prefix_integer** | **int** | | [optional]
|
|
||||||
**prefix_boolean** | **boolean** | | [optional]
|
|
||||||
**prefix_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**prefix_wrapped_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**namespace_string** | **string** | | [optional]
|
|
||||||
**namespace_number** | **double** | | [optional]
|
|
||||||
**namespace_integer** | **int** | | [optional]
|
|
||||||
**namespace_boolean** | **boolean** | | [optional]
|
|
||||||
**namespace_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**namespace_wrapped_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**prefix_ns_string** | **string** | | [optional]
|
|
||||||
**prefix_ns_number** | **double** | | [optional]
|
|
||||||
**prefix_ns_integer** | **int** | | [optional]
|
|
||||||
**prefix_ns_boolean** | **boolean** | | [optional]
|
|
||||||
**prefix_ns_array** | **ARRAY[int]** | | [optional]
|
|
||||||
**prefix_ns_wrapped_array** | **ARRAY[int]** | | [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)
|
|
||||||
|
|
||||||
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesAnyType;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesAnyType',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesArray;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesArray',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesBoolean;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesBoolean',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesInteger;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesInteger',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesNumber;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesNumber',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesObject;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesObject',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AdditionalPropertiesString;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'AdditionalPropertiesString',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,231 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::Adult;
|
|
||||||
|
|
||||||
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 WWW::OpenAPIClient::Object::Child;
|
|
||||||
use WWW::OpenAPIClient::Object::Human;
|
|
||||||
use WWW::OpenAPIClient::Object::Person;
|
|
||||||
|
|
||||||
use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Person", "WWW::OpenAPIClient::Object::Human");
|
|
||||||
|
|
||||||
#
|
|
||||||
#A representation of an adult
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize parent object Person
|
|
||||||
$self->WWW::OpenAPIClient::Object::Person::init(%args);
|
|
||||||
|
|
||||||
# initialize parent object Human
|
|
||||||
$self->WWW::OpenAPIClient::Object::Human::init(%args);
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
# call Person to_hash and then combine hash
|
|
||||||
$_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Person::to_hash };
|
|
||||||
|
|
||||||
# call Human to_hash and then combine hash
|
|
||||||
$_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Human::to_hash };
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# combine parent (Person) TO_JSON
|
|
||||||
$_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Person::TO_JSON };
|
|
||||||
|
|
||||||
# combine parent (Human) TO_JSON
|
|
||||||
$_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Human::TO_JSON };
|
|
||||||
|
|
||||||
return $_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
# from Perl hashref
|
|
||||||
sub from_hash {
|
|
||||||
my ($self, $hash) = @_;
|
|
||||||
|
|
||||||
# loop through attributes and use openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# call parent (Person) from_hash
|
|
||||||
$self->WWW::OpenAPIClient::Object::Person::from_hash($hash);
|
|
||||||
|
|
||||||
# call parent (Human) from_hash
|
|
||||||
$self->WWW::OpenAPIClient::Object::Human::from_hash($hash);
|
|
||||||
|
|
||||||
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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => 'A representation of an adult',
|
|
||||||
class => 'Adult',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'duplicated_optional' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'duplicated_optional',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'duplicated_required' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'duplicated_required',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'children' => {
|
|
||||||
datatype => 'ARRAY[Child]',
|
|
||||||
base_name => 'children',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'adult_required' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'adult_required',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'duplicated_optional' => 'int',
|
|
||||||
'duplicated_required' => 'int',
|
|
||||||
'children' => 'ARRAY[Child]',
|
|
||||||
'adult_required' => 'boolean'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'duplicated_optional' => 'duplicated_optional',
|
|
||||||
'duplicated_required' => 'duplicated_required',
|
|
||||||
'children' => 'children',
|
|
||||||
'adult_required' => 'adult_required'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,170 +0,0 @@
|
|||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::AnimalFarm;
|
|
||||||
|
|
||||||
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 WWW::OpenAPIClient::Object::Animal;
|
|
||||||
|
|
||||||
use base ( "Class::Accessor", "Class::Data::Inheritable" );
|
|
||||||
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata( 'attribute_map' => {} );
|
|
||||||
__PACKAGE__->mk_classdata( 'openapi_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 openapi_types to deserialize the data
|
|
||||||
while ( my ( $_key, $_type ) = each %{ $self->openapi_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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation(
|
|
||||||
{
|
|
||||||
description => '',
|
|
||||||
class => 'AnimalFarm',
|
|
||||||
required => [], # TODO
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation( {} );
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types(
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map(
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } );
|
|
||||||
|
|
||||||
1;
|
|
@ -1,198 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::BigCat;
|
|
||||||
|
|
||||||
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 WWW::OpenAPIClient::Object::BigCatAllOf;
|
|
||||||
use WWW::OpenAPIClient::Object::Cat;
|
|
||||||
|
|
||||||
use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Cat");
|
|
||||||
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize parent object Cat
|
|
||||||
$self->WWW::OpenAPIClient::Object::Cat::init(%args);
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
# call Cat to_hash and then combine hash
|
|
||||||
$_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Cat::to_hash };
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# combine parent (Cat) TO_JSON
|
|
||||||
$_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Cat::TO_JSON };
|
|
||||||
|
|
||||||
return $_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
# from Perl hashref
|
|
||||||
sub from_hash {
|
|
||||||
my ($self, $hash) = @_;
|
|
||||||
|
|
||||||
# loop through attributes and use openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# call parent (Cat) from_hash
|
|
||||||
$self->WWW::OpenAPIClient::Object::Cat::from_hash($hash);
|
|
||||||
|
|
||||||
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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'BigCat',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'kind' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'kind',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'kind' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'kind' => 'kind'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,199 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::Child;
|
|
||||||
|
|
||||||
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 WWW::OpenAPIClient::Object::Person;
|
|
||||||
|
|
||||||
use base ("Class::Accessor", "Class::Data::Inheritable", "WWW::OpenAPIClient::Object::Person");
|
|
||||||
|
|
||||||
#
|
|
||||||
#A representation of a child
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize parent object Person
|
|
||||||
$self->WWW::OpenAPIClient::Object::Person::init(%args);
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
# call Person to_hash and then combine hash
|
|
||||||
$_hash = { %$_hash, %$self->WWW::OpenAPIClient::Object::Person::to_hash };
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# combine parent (Person) TO_JSON
|
|
||||||
$_data = { %$_data, %$self->WWW::OpenAPIClient::Object::Person::TO_JSON };
|
|
||||||
|
|
||||||
return $_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
# from Perl hashref
|
|
||||||
sub from_hash {
|
|
||||||
my ($self, $hash) = @_;
|
|
||||||
|
|
||||||
# loop through attributes and use openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# call parent (Person) from_hash
|
|
||||||
$self->WWW::OpenAPIClient::Object::Person::from_hash($hash);
|
|
||||||
|
|
||||||
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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => 'A representation of a child',
|
|
||||||
class => 'Child',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'age' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'age',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'first_name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'firstName',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'age' => 'int',
|
|
||||||
'first_name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'age' => 'age',
|
|
||||||
'first_name' => 'firstName'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,242 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::DeprecatedObject;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# used by JSON for serialization
|
|
||||||
sub TO_JSON {
|
|
||||||
my $self = shift;
|
|
||||||
my $_data = {};
|
|
||||||
foreach my $_key (keys %{$self->attribute_map}) {
|
|
||||||
if (defined $self->{$_key}) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
my $_type = $self->openapi_types->{$_key};
|
|
||||||
my $_value = $self->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
$_data->{$_json_attribute} = [ map { $self->_to_json_primitives($_subclass, $_) } @$_value ];
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$_value}) {
|
|
||||||
$_hash{$_key} = $self->_to_json_primitives($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$_data->{$_json_attribute} = \%_hash;
|
|
||||||
} elsif ( grep( /^$_type$/, ('int', 'double', 'string', 'boolean', 'DATE', 'DATE_TIME'))) {
|
|
||||||
$_data->{$_json_attribute} = $self->_to_json_primitives($_type, $_value);
|
|
||||||
} else {
|
|
||||||
$_data->{$_json_attribute} = $_value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $_data;
|
|
||||||
}
|
|
||||||
|
|
||||||
# to_json non-array data
|
|
||||||
sub _to_json_primitives {
|
|
||||||
my ($self, $type, $data) = @_;
|
|
||||||
if ( grep( /^$type$/, ('int', 'double'))) {
|
|
||||||
# https://metacpan.org/pod/JSON#simple-scalars
|
|
||||||
# numify it, ensuring it will be dumped as a number
|
|
||||||
return undef unless defined $data;
|
|
||||||
return $data + 0;
|
|
||||||
} elsif ($type eq 'string') {
|
|
||||||
# https://metacpan.org/pod/JSON#simple-scalars
|
|
||||||
# stringified
|
|
||||||
return undef unless defined $data;
|
|
||||||
return $data . q();
|
|
||||||
} elsif ($type eq 'boolean') {
|
|
||||||
# https://metacpan.org/pod/JSON#JSON::true,-JSON::false,-JSON::null
|
|
||||||
return $data ? \1 : \0;
|
|
||||||
} elsif ($type eq 'DATE') {
|
|
||||||
return undef unless defined $data;
|
|
||||||
if (ref($data) eq 'DateTime') {
|
|
||||||
# https://metacpan.org/pod/DateTime#$dt-%3Eymd($optional_separator),-$dt-%3Emdy(...),-$dt-%3Edmy(...)
|
|
||||||
return $data->ymd;
|
|
||||||
}
|
|
||||||
return $data .q();
|
|
||||||
} elsif ($type eq 'DATE_TIME') {
|
|
||||||
return undef unless defined $data;
|
|
||||||
# the date-time notation as defined by RFC 3339, section 5.6, for example, 2017-07-21T17:32:28Z
|
|
||||||
if (ref($data) eq 'DateTime') {
|
|
||||||
# https://metacpan.org/pod/DateTime#$dt-%3Erfc3339
|
|
||||||
return $data->rfc3339;
|
|
||||||
}
|
|
||||||
return $data .q();
|
|
||||||
} else { # hash (model), In this case, the TO_JSON of the $data object is executed
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# from Perl hashref
|
|
||||||
sub from_hash {
|
|
||||||
my ($self, $hash) = @_;
|
|
||||||
|
|
||||||
# loop through attributes and use openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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 (grep( /^$type$/ , ('DATE_TIME', 'DATE'))) {
|
|
||||||
return DateTime->from_epoch(epoch => str2time($data));
|
|
||||||
} elsif ( grep( /^$type$/, ('int', 'double'))) {
|
|
||||||
return undef unless defined $data;
|
|
||||||
return $data + 0;
|
|
||||||
} elsif ($type eq 'string') {
|
|
||||||
return undef unless defined $data;
|
|
||||||
return $data . q();
|
|
||||||
} elsif ($type eq 'boolean') {
|
|
||||||
return !!$data;
|
|
||||||
} else { # hash(model)
|
|
||||||
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'DeprecatedObject',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,186 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::Human;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'Human',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'___type' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => '$_type',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'body' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'body',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'___type' => 'string',
|
|
||||||
'body' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'___type' => '$_type',
|
|
||||||
'body' => 'body'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,193 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineObject;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineObject',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name',
|
|
||||||
description => 'Updated name of the pet',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'status' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'status',
|
|
||||||
description => 'Updated status of the pet',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'name' => 'string',
|
|
||||||
'status' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'name' => 'name',
|
|
||||||
'status' => 'status'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,193 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineObject1;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineObject1',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'additional_metadata' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'additionalMetadata',
|
|
||||||
description => 'Additional data to pass to server',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'file' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'file',
|
|
||||||
description => 'file to upload',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'additional_metadata' => 'string',
|
|
||||||
'file' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'additional_metadata' => 'additionalMetadata',
|
|
||||||
'file' => 'file'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,193 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineObject2;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineObject2',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'enum_form_string_array' => {
|
|
||||||
datatype => 'ARRAY[string]',
|
|
||||||
base_name => 'enum_form_string_array',
|
|
||||||
description => 'Form parameter enum test (string array)',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'enum_form_string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'enum_form_string',
|
|
||||||
description => 'Form parameter enum test (string)',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'enum_form_string_array' => 'ARRAY[string]',
|
|
||||||
'enum_form_string' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'enum_form_string_array' => 'enum_form_string_array',
|
|
||||||
'enum_form_string' => 'enum_form_string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,301 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineObject3;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineObject3',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'integer' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'integer',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'int32' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'int32',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'int64' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'int64',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'number' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'number',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'float' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'float',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'double' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'double',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'string',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'pattern_without_delimiter' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'pattern_without_delimiter',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'byte' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'byte',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'binary' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'binary',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'date' => {
|
|
||||||
datatype => 'DateTime',
|
|
||||||
base_name => 'date',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'date_time' => {
|
|
||||||
datatype => 'DateTime',
|
|
||||||
base_name => 'dateTime',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'password' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'password',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'callback' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'callback',
|
|
||||||
description => 'None',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'integer' => 'int',
|
|
||||||
'int32' => 'int',
|
|
||||||
'int64' => 'int',
|
|
||||||
'number' => 'double',
|
|
||||||
'float' => 'double',
|
|
||||||
'double' => 'double',
|
|
||||||
'string' => 'string',
|
|
||||||
'pattern_without_delimiter' => 'string',
|
|
||||||
'byte' => 'string',
|
|
||||||
'binary' => 'string',
|
|
||||||
'date' => 'DateTime',
|
|
||||||
'date_time' => 'DateTime',
|
|
||||||
'password' => 'string',
|
|
||||||
'callback' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'integer' => 'integer',
|
|
||||||
'int32' => 'int32',
|
|
||||||
'int64' => 'int64',
|
|
||||||
'number' => 'number',
|
|
||||||
'float' => 'float',
|
|
||||||
'double' => 'double',
|
|
||||||
'string' => 'string',
|
|
||||||
'pattern_without_delimiter' => 'pattern_without_delimiter',
|
|
||||||
'byte' => 'byte',
|
|
||||||
'binary' => 'binary',
|
|
||||||
'date' => 'date',
|
|
||||||
'date_time' => 'dateTime',
|
|
||||||
'password' => 'password',
|
|
||||||
'callback' => 'callback'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,193 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineObject4;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineObject4',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'param' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'param',
|
|
||||||
description => 'field1',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'param2' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'param2',
|
|
||||||
description => 'field2',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'param' => 'string',
|
|
||||||
'param2' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'param' => 'param',
|
|
||||||
'param2' => 'param2'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,193 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineObject5;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineObject5',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'additional_metadata' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'additionalMetadata',
|
|
||||||
description => 'Additional data to pass to server',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'required_file' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'requiredFile',
|
|
||||||
description => 'file to upload',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'additional_metadata' => 'string',
|
|
||||||
'required_file' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'additional_metadata' => 'additionalMetadata',
|
|
||||||
'required_file' => 'requiredFile'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,184 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::InlineResponseDefault;
|
|
||||||
|
|
||||||
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 WWW::OpenAPIClient::Object::Foo;
|
|
||||||
|
|
||||||
use base ("Class::Accessor", "Class::Data::Inheritable");
|
|
||||||
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'InlineResponseDefault',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'string' => {
|
|
||||||
datatype => 'Foo',
|
|
||||||
base_name => 'string',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'string' => 'Foo'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'string' => 'string'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,222 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::Person;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'Person',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'___type' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => '$_type',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'last_name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'lastName',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'first_name' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'firstName',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'duplicated_optional' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'duplicated_optional',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'duplicated_required' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'duplicated_required',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'person_required' => {
|
|
||||||
datatype => 'DateTime',
|
|
||||||
base_name => 'person_required',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'___type' => 'string',
|
|
||||||
'last_name' => 'string',
|
|
||||||
'first_name' => 'string',
|
|
||||||
'duplicated_optional' => 'string',
|
|
||||||
'duplicated_required' => 'string',
|
|
||||||
'person_required' => 'DateTime'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'___type' => '$_type',
|
|
||||||
'last_name' => 'lastName',
|
|
||||||
'first_name' => 'firstName',
|
|
||||||
'duplicated_optional' => 'duplicated_optional',
|
|
||||||
'duplicated_required' => 'duplicated_required',
|
|
||||||
'person_required' => 'person_required'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,168 +0,0 @@
|
|||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::StringBooleanMap;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata( 'attribute_map' => {} );
|
|
||||||
__PACKAGE__->mk_classdata( 'openapi_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 openapi_types to deserialize the data
|
|
||||||
while ( my ( $_key, $_type ) = each %{ $self->openapi_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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation(
|
|
||||||
{
|
|
||||||
description => '',
|
|
||||||
class => 'StringBooleanMap',
|
|
||||||
required => [], # TODO
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation( {} );
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types(
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map(
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors( keys %{ __PACKAGE__->attribute_map } );
|
|
||||||
|
|
||||||
1;
|
|
@ -1,220 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::TypeHolderDefault;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'TypeHolderDefault',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'string_item' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'string_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'number_item' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'number_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'integer_item' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'integer_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'bool_item' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'bool_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'array_item' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'array_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'string_item' => 'string',
|
|
||||||
'number_item' => 'double',
|
|
||||||
'integer_item' => 'int',
|
|
||||||
'bool_item' => 'boolean',
|
|
||||||
'array_item' => 'ARRAY[int]'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'string_item' => 'string_item',
|
|
||||||
'number_item' => 'number_item',
|
|
||||||
'integer_item' => 'integer_item',
|
|
||||||
'bool_item' => 'bool_item',
|
|
||||||
'array_item' => 'array_item'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,229 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::TypeHolderExample;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'TypeHolderExample',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'string_item' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'string_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'number_item' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'number_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'float_item' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'float_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'integer_item' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'integer_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'bool_item' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'bool_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'array_item' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'array_item',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'string_item' => 'string',
|
|
||||||
'number_item' => 'double',
|
|
||||||
'float_item' => 'double',
|
|
||||||
'integer_item' => 'int',
|
|
||||||
'bool_item' => 'boolean',
|
|
||||||
'array_item' => 'ARRAY[int]'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'string_item' => 'string_item',
|
|
||||||
'number_item' => 'number_item',
|
|
||||||
'float_item' => 'float_item',
|
|
||||||
'integer_item' => 'integer_item',
|
|
||||||
'bool_item' => 'bool_item',
|
|
||||||
'array_item' => 'array_item'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
@ -1,436 +0,0 @@
|
|||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
package WWW::OpenAPIClient::Object::XmlItem;
|
|
||||||
|
|
||||||
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 OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
|
|
||||||
# REF: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
|
|
||||||
=begin comment
|
|
||||||
|
|
||||||
OpenAPI 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: \" \\
|
|
||||||
|
|
||||||
The version of the OpenAPI document: 1.0.0
|
|
||||||
|
|
||||||
Generated by: https://openapi-generator.tech
|
|
||||||
|
|
||||||
=end comment
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
|
||||||
#
|
|
||||||
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
||||||
# Do not edit the class manually.
|
|
||||||
# Ref: https://openapi-generator.tech
|
|
||||||
#
|
|
||||||
__PACKAGE__->mk_classdata('attribute_map' => {});
|
|
||||||
__PACKAGE__->mk_classdata('openapi_types' => {});
|
|
||||||
__PACKAGE__->mk_classdata('method_documentation' => {});
|
|
||||||
__PACKAGE__->mk_classdata('class_documentation' => {});
|
|
||||||
|
|
||||||
# new plain object
|
|
||||||
sub new {
|
|
||||||
my ($class, %args) = @_;
|
|
||||||
|
|
||||||
my $self = bless {}, $class;
|
|
||||||
|
|
||||||
$self->init(%args);
|
|
||||||
|
|
||||||
return $self;
|
|
||||||
}
|
|
||||||
|
|
||||||
# initialize the object
|
|
||||||
sub init
|
|
||||||
{
|
|
||||||
my ($self, %args) = @_;
|
|
||||||
|
|
||||||
foreach my $attribute (keys %{$self->attribute_map}) {
|
|
||||||
my $args_key = $self->attribute_map->{$attribute};
|
|
||||||
$self->$attribute( $args{ $args_key } );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# return perl hash
|
|
||||||
sub to_hash {
|
|
||||||
my $self = shift;
|
|
||||||
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
|
|
||||||
|
|
||||||
return $_hash;
|
|
||||||
}
|
|
||||||
|
|
||||||
# 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 openapi_types to deserialize the data
|
|
||||||
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
|
|
||||||
my $_json_attribute = $self->attribute_map->{$_key};
|
|
||||||
if ($_type =~ /^array\[(.+)\]$/i) { # array
|
|
||||||
my $_subclass = $1;
|
|
||||||
my @_array = ();
|
|
||||||
foreach my $_element (@{$hash->{$_json_attribute}}) {
|
|
||||||
push @_array, $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \@_array;
|
|
||||||
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
|
|
||||||
my $_subclass = $1;
|
|
||||||
my %_hash = ();
|
|
||||||
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
|
|
||||||
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
|
|
||||||
}
|
|
||||||
$self->{$_key} = \%_hash;
|
|
||||||
} 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::OpenAPIClient::Object::$type->new()";
|
|
||||||
return $_instance->from_hash($data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
__PACKAGE__->class_documentation({description => '',
|
|
||||||
class => 'XmlItem',
|
|
||||||
required => [], # TODO
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->method_documentation({
|
|
||||||
'attribute_string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'attribute_string',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'attribute_number' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'attribute_number',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'attribute_integer' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'attribute_integer',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'attribute_boolean' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'attribute_boolean',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'wrapped_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'wrapped_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'name_string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'name_string',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'name_number' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'name_number',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'name_integer' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'name_integer',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'name_boolean' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'name_boolean',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'name_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'name_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'name_wrapped_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'name_wrapped_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'prefix_string',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_number' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'prefix_number',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_integer' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'prefix_integer',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_boolean' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'prefix_boolean',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'prefix_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_wrapped_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'prefix_wrapped_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'namespace_string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'namespace_string',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'namespace_number' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'namespace_number',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'namespace_integer' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'namespace_integer',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'namespace_boolean' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'namespace_boolean',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'namespace_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'namespace_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'namespace_wrapped_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'namespace_wrapped_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_ns_string' => {
|
|
||||||
datatype => 'string',
|
|
||||||
base_name => 'prefix_ns_string',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_ns_number' => {
|
|
||||||
datatype => 'double',
|
|
||||||
base_name => 'prefix_ns_number',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_ns_integer' => {
|
|
||||||
datatype => 'int',
|
|
||||||
base_name => 'prefix_ns_integer',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_ns_boolean' => {
|
|
||||||
datatype => 'boolean',
|
|
||||||
base_name => 'prefix_ns_boolean',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_ns_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'prefix_ns_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
'prefix_ns_wrapped_array' => {
|
|
||||||
datatype => 'ARRAY[int]',
|
|
||||||
base_name => 'prefix_ns_wrapped_array',
|
|
||||||
description => '',
|
|
||||||
format => '',
|
|
||||||
read_only => '',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
__PACKAGE__->openapi_types( {
|
|
||||||
'attribute_string' => 'string',
|
|
||||||
'attribute_number' => 'double',
|
|
||||||
'attribute_integer' => 'int',
|
|
||||||
'attribute_boolean' => 'boolean',
|
|
||||||
'wrapped_array' => 'ARRAY[int]',
|
|
||||||
'name_string' => 'string',
|
|
||||||
'name_number' => 'double',
|
|
||||||
'name_integer' => 'int',
|
|
||||||
'name_boolean' => 'boolean',
|
|
||||||
'name_array' => 'ARRAY[int]',
|
|
||||||
'name_wrapped_array' => 'ARRAY[int]',
|
|
||||||
'prefix_string' => 'string',
|
|
||||||
'prefix_number' => 'double',
|
|
||||||
'prefix_integer' => 'int',
|
|
||||||
'prefix_boolean' => 'boolean',
|
|
||||||
'prefix_array' => 'ARRAY[int]',
|
|
||||||
'prefix_wrapped_array' => 'ARRAY[int]',
|
|
||||||
'namespace_string' => 'string',
|
|
||||||
'namespace_number' => 'double',
|
|
||||||
'namespace_integer' => 'int',
|
|
||||||
'namespace_boolean' => 'boolean',
|
|
||||||
'namespace_array' => 'ARRAY[int]',
|
|
||||||
'namespace_wrapped_array' => 'ARRAY[int]',
|
|
||||||
'prefix_ns_string' => 'string',
|
|
||||||
'prefix_ns_number' => 'double',
|
|
||||||
'prefix_ns_integer' => 'int',
|
|
||||||
'prefix_ns_boolean' => 'boolean',
|
|
||||||
'prefix_ns_array' => 'ARRAY[int]',
|
|
||||||
'prefix_ns_wrapped_array' => 'ARRAY[int]'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->attribute_map( {
|
|
||||||
'attribute_string' => 'attribute_string',
|
|
||||||
'attribute_number' => 'attribute_number',
|
|
||||||
'attribute_integer' => 'attribute_integer',
|
|
||||||
'attribute_boolean' => 'attribute_boolean',
|
|
||||||
'wrapped_array' => 'wrapped_array',
|
|
||||||
'name_string' => 'name_string',
|
|
||||||
'name_number' => 'name_number',
|
|
||||||
'name_integer' => 'name_integer',
|
|
||||||
'name_boolean' => 'name_boolean',
|
|
||||||
'name_array' => 'name_array',
|
|
||||||
'name_wrapped_array' => 'name_wrapped_array',
|
|
||||||
'prefix_string' => 'prefix_string',
|
|
||||||
'prefix_number' => 'prefix_number',
|
|
||||||
'prefix_integer' => 'prefix_integer',
|
|
||||||
'prefix_boolean' => 'prefix_boolean',
|
|
||||||
'prefix_array' => 'prefix_array',
|
|
||||||
'prefix_wrapped_array' => 'prefix_wrapped_array',
|
|
||||||
'namespace_string' => 'namespace_string',
|
|
||||||
'namespace_number' => 'namespace_number',
|
|
||||||
'namespace_integer' => 'namespace_integer',
|
|
||||||
'namespace_boolean' => 'namespace_boolean',
|
|
||||||
'namespace_array' => 'namespace_array',
|
|
||||||
'namespace_wrapped_array' => 'namespace_wrapped_array',
|
|
||||||
'prefix_ns_string' => 'prefix_ns_string',
|
|
||||||
'prefix_ns_number' => 'prefix_ns_number',
|
|
||||||
'prefix_ns_integer' => 'prefix_ns_integer',
|
|
||||||
'prefix_ns_boolean' => 'prefix_ns_boolean',
|
|
||||||
'prefix_ns_array' => 'prefix_ns_array',
|
|
||||||
'prefix_ns_wrapped_array' => 'prefix_ns_wrapped_array'
|
|
||||||
} );
|
|
||||||
|
|
||||||
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
|
|
||||||
|
|
||||||
|
|
||||||
1;
|
|
Loading…
x
Reference in New Issue
Block a user