forked from loafle/openapi-generator-original
added serialize option in to_dict function in python generated model (#7555)
* added to_json_dict in python generated model * update to_dict * updated to_dict Co-authored-by: sunkaicheng <sunkaicheng@bigo.sg>
This commit is contained in:
parent
b3bc926b1d
commit
01d0b5d478
@ -2,9 +2,9 @@
|
||||
|
||||
{{>partial_header}}
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from {{packageName}}.configuration import Configuration
|
||||
@ -197,27 +197,35 @@ class {{classname}}(object):
|
||||
return self.discriminator_value_class_map.get(discriminator_value)
|
||||
|
||||
{{/discriminator}}
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesAnyType(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesArray(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesBoolean(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -333,27 +333,35 @@ class AdditionalPropertiesClass(object):
|
||||
|
||||
self._anytype_3 = anytype_3
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesInteger(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesNumber(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesObject(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesString(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -112,27 +112,35 @@ class Animal(object):
|
||||
discriminator_value = data[discriminator_key]
|
||||
return self.discriminator_value_class_map.get(discriminator_value)
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class ApiResponse(object):
|
||||
|
||||
self._message = message
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ArrayOfArrayOfNumberOnly(object):
|
||||
|
||||
self._array_array_number = array_array_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ArrayOfNumberOnly(object):
|
||||
|
||||
self._array_number = array_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class ArrayTest(object):
|
||||
|
||||
self._array_array_of_model = array_array_of_model
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -79,27 +79,35 @@ class BigCat(object):
|
||||
|
||||
self._kind = kind
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -79,27 +79,35 @@ class BigCatAllOf(object):
|
||||
|
||||
self._kind = kind
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -205,27 +205,35 @@ class Capitalization(object):
|
||||
|
||||
self._att_name = att_name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class Cat(object):
|
||||
|
||||
self._declawed = declawed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class CatAllOf(object):
|
||||
|
||||
self._declawed = declawed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -100,27 +100,35 @@ class Category(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ClassModel(object):
|
||||
|
||||
self.__class = _class
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class Client(object):
|
||||
|
||||
self._client = client
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class Dog(object):
|
||||
|
||||
self._breed = breed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class DogAllOf(object):
|
||||
|
||||
self._breed = breed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -113,27 +113,35 @@ class EnumArrays(object):
|
||||
|
||||
self._array_enum = array_enum
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -54,27 +54,35 @@ class EnumClass(object):
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
self.discriminator = None
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -202,27 +202,35 @@ class EnumTest(object):
|
||||
|
||||
self._outer_enum = outer_enum
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -75,27 +75,35 @@ class File(object):
|
||||
|
||||
self._source_uri = source_uri
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class FileSchemaTestClass(object):
|
||||
|
||||
self._files = files
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -457,27 +457,35 @@ class FormatTest(object):
|
||||
|
||||
self._big_decimal = big_decimal
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class HasOnlyReadOnly(object):
|
||||
|
||||
self._foo = foo
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class List(object):
|
||||
|
||||
self.__123_list = _123_list
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -159,27 +159,35 @@ class MapTest(object):
|
||||
|
||||
self._indirect_map = indirect_map
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
||||
|
||||
self._map = map
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class Model200Response(object):
|
||||
|
||||
self.__class = _class
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ModelReturn(object):
|
||||
|
||||
self.__return = _return
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -152,27 +152,35 @@ class Name(object):
|
||||
|
||||
self.__123_number = _123_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class NumberOnly(object):
|
||||
|
||||
self._just_number = just_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -211,27 +211,35 @@ class Order(object):
|
||||
|
||||
self._complete = complete
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class OuterComposite(object):
|
||||
|
||||
self._my_boolean = my_boolean
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -54,27 +54,35 @@ class OuterEnum(object):
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
self.discriminator = None
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -213,27 +213,35 @@ class Pet(object):
|
||||
|
||||
self._status = status
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class ReadOnlyFirst(object):
|
||||
|
||||
self._baz = baz
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class SpecialModelName(object):
|
||||
|
||||
self._special_property_name = special_property_name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class Tag(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -182,27 +182,35 @@ class TypeHolderDefault(object):
|
||||
|
||||
self._array_item = array_item
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -209,27 +209,35 @@ class TypeHolderExample(object):
|
||||
|
||||
self._array_item = array_item
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -257,27 +257,35 @@ class User(object):
|
||||
|
||||
self._user_status = user_status
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -801,27 +801,35 @@ class XmlItem(object):
|
||||
|
||||
self._prefix_ns_wrapped_array = prefix_ns_wrapped_array
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesAnyType(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesArray(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesBoolean(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -333,27 +333,35 @@ class AdditionalPropertiesClass(object):
|
||||
|
||||
self._anytype_3 = anytype_3
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesInteger(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesNumber(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesObject(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesString(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -112,27 +112,35 @@ class Animal(object):
|
||||
discriminator_value = data[discriminator_key]
|
||||
return self.discriminator_value_class_map.get(discriminator_value)
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class ApiResponse(object):
|
||||
|
||||
self._message = message
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ArrayOfArrayOfNumberOnly(object):
|
||||
|
||||
self._array_array_number = array_array_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ArrayOfNumberOnly(object):
|
||||
|
||||
self._array_number = array_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class ArrayTest(object):
|
||||
|
||||
self._array_array_of_model = array_array_of_model
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -79,27 +79,35 @@ class BigCat(object):
|
||||
|
||||
self._kind = kind
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -79,27 +79,35 @@ class BigCatAllOf(object):
|
||||
|
||||
self._kind = kind
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -205,27 +205,35 @@ class Capitalization(object):
|
||||
|
||||
self._att_name = att_name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class Cat(object):
|
||||
|
||||
self._declawed = declawed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class CatAllOf(object):
|
||||
|
||||
self._declawed = declawed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -100,27 +100,35 @@ class Category(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ClassModel(object):
|
||||
|
||||
self.__class = _class
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class Client(object):
|
||||
|
||||
self._client = client
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class Dog(object):
|
||||
|
||||
self._breed = breed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class DogAllOf(object):
|
||||
|
||||
self._breed = breed
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -113,27 +113,35 @@ class EnumArrays(object):
|
||||
|
||||
self._array_enum = array_enum
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -54,27 +54,35 @@ class EnumClass(object):
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
self.discriminator = None
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -202,27 +202,35 @@ class EnumTest(object):
|
||||
|
||||
self._outer_enum = outer_enum
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -75,27 +75,35 @@ class File(object):
|
||||
|
||||
self._source_uri = source_uri
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class FileSchemaTestClass(object):
|
||||
|
||||
self._files = files
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -457,27 +457,35 @@ class FormatTest(object):
|
||||
|
||||
self._big_decimal = big_decimal
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class HasOnlyReadOnly(object):
|
||||
|
||||
self._foo = foo
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class List(object):
|
||||
|
||||
self.__123_list = _123_list
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -159,27 +159,35 @@ class MapTest(object):
|
||||
|
||||
self._indirect_map = indirect_map
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class MixedPropertiesAndAdditionalPropertiesClass(object):
|
||||
|
||||
self._map = map
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class Model200Response(object):
|
||||
|
||||
self.__class = _class
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class ModelReturn(object):
|
||||
|
||||
self.__return = _return
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -152,27 +152,35 @@ class Name(object):
|
||||
|
||||
self.__123_number = _123_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class NumberOnly(object):
|
||||
|
||||
self._just_number = just_number
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -211,27 +211,35 @@ class Order(object):
|
||||
|
||||
self._complete = complete
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -125,27 +125,35 @@ class OuterComposite(object):
|
||||
|
||||
self._my_boolean = my_boolean
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -54,27 +54,35 @@ class OuterEnum(object):
|
||||
self.local_vars_configuration = local_vars_configuration
|
||||
self.discriminator = None
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -213,27 +213,35 @@ class Pet(object):
|
||||
|
||||
self._status = status
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class ReadOnlyFirst(object):
|
||||
|
||||
self._baz = baz
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class SpecialModelName(object):
|
||||
|
||||
self._special_property_name = special_property_name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -99,27 +99,35 @@ class Tag(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -182,27 +182,35 @@ class TypeHolderDefault(object):
|
||||
|
||||
self._array_item = array_item
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -209,27 +209,35 @@ class TypeHolderExample(object):
|
||||
|
||||
self._array_item = array_item
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -257,27 +257,35 @@ class User(object):
|
||||
|
||||
self._user_status = user_status
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -801,27 +801,35 @@ class XmlItem(object):
|
||||
|
||||
self._prefix_ns_wrapped_array = prefix_ns_wrapped_array
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesAnyType(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesArray(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
@ -10,9 +10,9 @@
|
||||
"""
|
||||
|
||||
|
||||
import inspect
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
|
||||
import six
|
||||
|
||||
from petstore_api.configuration import Configuration
|
||||
@ -73,27 +73,35 @@ class AdditionalPropertiesBoolean(object):
|
||||
|
||||
self._name = name
|
||||
|
||||
def to_dict(self):
|
||||
def to_dict(self, serialize=False):
|
||||
"""Returns the model properties as a dict"""
|
||||
result = {}
|
||||
|
||||
def convert(x):
|
||||
if hasattr(x, "to_dict"):
|
||||
args = inspect.getargspec(x.to_dict).args
|
||||
if len(args) == 1:
|
||||
return x.to_dict()
|
||||
else:
|
||||
return x.to_dict(serialize)
|
||||
else:
|
||||
return x
|
||||
|
||||
for attr, _ in six.iteritems(self.openapi_types):
|
||||
value = getattr(self, attr)
|
||||
attr = self.attribute_map.get(attr, attr) if serialize else attr
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else x,
|
||||
lambda x: convert(x),
|
||||
value
|
||||
))
|
||||
elif hasattr(value, "to_dict"):
|
||||
result[attr] = value.to_dict()
|
||||
elif isinstance(value, dict):
|
||||
result[attr] = dict(map(
|
||||
lambda item: (item[0], item[1].to_dict())
|
||||
if hasattr(item[1], "to_dict") else item,
|
||||
lambda item: (item[0], convert(item[1])),
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
result[attr] = convert(value)
|
||||
|
||||
return result
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user