forked from loafle/openapi-generator-original
Add requirments.txt and tox.ini
This commit is contained in:
@@ -2,10 +2,13 @@ from __future__ import absolute_import
|
||||
|
||||
# import models into model package
|
||||
from .animal import Animal
|
||||
from .animal_farm import AnimalFarm
|
||||
from .api_response import ApiResponse
|
||||
from .cat import Cat
|
||||
from .category import Category
|
||||
from .dog import Dog
|
||||
from .enum_class import EnumClass
|
||||
from .enum_test import EnumTest
|
||||
from .format_test import FormatTest
|
||||
from .model_200_response import Model200Response
|
||||
from .model_return import ModelReturn
|
||||
|
||||
@@ -38,14 +38,17 @@ class Animal(object):
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
self.swagger_types = {
|
||||
'class_name': 'str'
|
||||
'class_name': 'str',
|
||||
'color': 'str'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'class_name': 'className'
|
||||
'class_name': 'className',
|
||||
'color': 'color'
|
||||
}
|
||||
|
||||
self._class_name = None
|
||||
self._color = 'red'
|
||||
|
||||
@property
|
||||
def class_name(self):
|
||||
@@ -70,6 +73,29 @@ class Animal(object):
|
||||
|
||||
self._class_name = class_name
|
||||
|
||||
@property
|
||||
def color(self):
|
||||
"""
|
||||
Gets the color of this Animal.
|
||||
|
||||
|
||||
:return: The color of this Animal.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._color
|
||||
|
||||
@color.setter
|
||||
def color(self, color):
|
||||
"""
|
||||
Sets the color of this Animal.
|
||||
|
||||
|
||||
:param color: The color of this Animal.
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._color = color
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns the model properties as a dict
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Copyright 2016 SmartBear Software
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Ref: https://github.com/swagger-api/swagger-codegen
|
||||
"""
|
||||
|
||||
from pprint import pformat
|
||||
from six import iteritems
|
||||
import re
|
||||
|
||||
|
||||
class AnimalFarm(object):
|
||||
"""
|
||||
NOTE: This class is auto generated by the swagger code generator program.
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
AnimalFarm - a model defined in Swagger
|
||||
|
||||
:param dict swaggerTypes: The key is attribute name
|
||||
and the value is attribute type.
|
||||
:param dict attributeMap: The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
self.swagger_types = {
|
||||
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
|
||||
}
|
||||
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns the model properties as a dict
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for attr, _ in iteritems(self.swagger_types):
|
||||
value = getattr(self, attr)
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else 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,
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""
|
||||
Returns the string representation of the model
|
||||
"""
|
||||
return pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
For `print` and `pprint`
|
||||
"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Returns true if both objects are equal
|
||||
"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""
|
||||
Returns true if both objects are not equal
|
||||
"""
|
||||
return not self == other
|
||||
|
||||
@@ -39,15 +39,18 @@ class Cat(object):
|
||||
"""
|
||||
self.swagger_types = {
|
||||
'class_name': 'str',
|
||||
'color': 'str',
|
||||
'declawed': 'bool'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'class_name': 'className',
|
||||
'color': 'color',
|
||||
'declawed': 'declawed'
|
||||
}
|
||||
|
||||
self._class_name = None
|
||||
self._color = 'red'
|
||||
self._declawed = None
|
||||
|
||||
@property
|
||||
@@ -73,6 +76,29 @@ class Cat(object):
|
||||
|
||||
self._class_name = class_name
|
||||
|
||||
@property
|
||||
def color(self):
|
||||
"""
|
||||
Gets the color of this Cat.
|
||||
|
||||
|
||||
:return: The color of this Cat.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._color
|
||||
|
||||
@color.setter
|
||||
def color(self, color):
|
||||
"""
|
||||
Sets the color of this Cat.
|
||||
|
||||
|
||||
:param color: The color of this Cat.
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._color = color
|
||||
|
||||
@property
|
||||
def declawed(self):
|
||||
"""
|
||||
|
||||
@@ -39,15 +39,18 @@ class Dog(object):
|
||||
"""
|
||||
self.swagger_types = {
|
||||
'class_name': 'str',
|
||||
'color': 'str',
|
||||
'breed': 'str'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'class_name': 'className',
|
||||
'color': 'color',
|
||||
'breed': 'breed'
|
||||
}
|
||||
|
||||
self._class_name = None
|
||||
self._color = 'red'
|
||||
self._breed = None
|
||||
|
||||
@property
|
||||
@@ -73,6 +76,29 @@ class Dog(object):
|
||||
|
||||
self._class_name = class_name
|
||||
|
||||
@property
|
||||
def color(self):
|
||||
"""
|
||||
Gets the color of this Dog.
|
||||
|
||||
|
||||
:return: The color of this Dog.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._color
|
||||
|
||||
@color.setter
|
||||
def color(self, color):
|
||||
"""
|
||||
Sets the color of this Dog.
|
||||
|
||||
|
||||
:param color: The color of this Dog.
|
||||
:type: str
|
||||
"""
|
||||
|
||||
self._color = color
|
||||
|
||||
@property
|
||||
def breed(self):
|
||||
"""
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Copyright 2016 SmartBear Software
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Ref: https://github.com/swagger-api/swagger-codegen
|
||||
"""
|
||||
|
||||
from pprint import pformat
|
||||
from six import iteritems
|
||||
import re
|
||||
|
||||
|
||||
class EnumClass(object):
|
||||
"""
|
||||
NOTE: This class is auto generated by the swagger code generator program.
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
EnumClass - a model defined in Swagger
|
||||
|
||||
:param dict swaggerTypes: The key is attribute name
|
||||
and the value is attribute type.
|
||||
:param dict attributeMap: The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
self.swagger_types = {
|
||||
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
|
||||
}
|
||||
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns the model properties as a dict
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for attr, _ in iteritems(self.swagger_types):
|
||||
value = getattr(self, attr)
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else 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,
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""
|
||||
Returns the string representation of the model
|
||||
"""
|
||||
return pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
For `print` and `pprint`
|
||||
"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Returns true if both objects are equal
|
||||
"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""
|
||||
Returns true if both objects are not equal
|
||||
"""
|
||||
return not self == other
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Copyright 2016 SmartBear Software
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
Ref: https://github.com/swagger-api/swagger-codegen
|
||||
"""
|
||||
|
||||
from pprint import pformat
|
||||
from six import iteritems
|
||||
import re
|
||||
|
||||
|
||||
class EnumTest(object):
|
||||
"""
|
||||
NOTE: This class is auto generated by the swagger code generator program.
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
def __init__(self):
|
||||
"""
|
||||
EnumTest - a model defined in Swagger
|
||||
|
||||
:param dict swaggerTypes: The key is attribute name
|
||||
and the value is attribute type.
|
||||
:param dict attributeMap: The key is attribute name
|
||||
and the value is json key in definition.
|
||||
"""
|
||||
self.swagger_types = {
|
||||
'enum_string': 'str',
|
||||
'enum_integer': 'int',
|
||||
'enum_number': 'float'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'enum_string': 'enum_string',
|
||||
'enum_integer': 'enum_integer',
|
||||
'enum_number': 'enum_number'
|
||||
}
|
||||
|
||||
self._enum_string = None
|
||||
self._enum_integer = None
|
||||
self._enum_number = None
|
||||
|
||||
@property
|
||||
def enum_string(self):
|
||||
"""
|
||||
Gets the enum_string of this EnumTest.
|
||||
|
||||
|
||||
:return: The enum_string of this EnumTest.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._enum_string
|
||||
|
||||
@enum_string.setter
|
||||
def enum_string(self, enum_string):
|
||||
"""
|
||||
Sets the enum_string of this EnumTest.
|
||||
|
||||
|
||||
:param enum_string: The enum_string of this EnumTest.
|
||||
:type: str
|
||||
"""
|
||||
allowed_values = ["UPPER", "lower"]
|
||||
if enum_string not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_string`, must be one of {0}"
|
||||
.format(allowed_values)
|
||||
)
|
||||
|
||||
self._enum_string = enum_string
|
||||
|
||||
@property
|
||||
def enum_integer(self):
|
||||
"""
|
||||
Gets the enum_integer of this EnumTest.
|
||||
|
||||
|
||||
:return: The enum_integer of this EnumTest.
|
||||
:rtype: int
|
||||
"""
|
||||
return self._enum_integer
|
||||
|
||||
@enum_integer.setter
|
||||
def enum_integer(self, enum_integer):
|
||||
"""
|
||||
Sets the enum_integer of this EnumTest.
|
||||
|
||||
|
||||
:param enum_integer: The enum_integer of this EnumTest.
|
||||
:type: int
|
||||
"""
|
||||
allowed_values = ["1", "-1"]
|
||||
if enum_integer not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_integer`, must be one of {0}"
|
||||
.format(allowed_values)
|
||||
)
|
||||
|
||||
self._enum_integer = enum_integer
|
||||
|
||||
@property
|
||||
def enum_number(self):
|
||||
"""
|
||||
Gets the enum_number of this EnumTest.
|
||||
|
||||
|
||||
:return: The enum_number of this EnumTest.
|
||||
:rtype: float
|
||||
"""
|
||||
return self._enum_number
|
||||
|
||||
@enum_number.setter
|
||||
def enum_number(self, enum_number):
|
||||
"""
|
||||
Sets the enum_number of this EnumTest.
|
||||
|
||||
|
||||
:param enum_number: The enum_number of this EnumTest.
|
||||
:type: float
|
||||
"""
|
||||
allowed_values = ["1.1", "-1.2"]
|
||||
if enum_number not in allowed_values:
|
||||
raise ValueError(
|
||||
"Invalid value for `enum_number`, must be one of {0}"
|
||||
.format(allowed_values)
|
||||
)
|
||||
|
||||
self._enum_number = enum_number
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns the model properties as a dict
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for attr, _ in iteritems(self.swagger_types):
|
||||
value = getattr(self, attr)
|
||||
if isinstance(value, list):
|
||||
result[attr] = list(map(
|
||||
lambda x: x.to_dict() if hasattr(x, "to_dict") else 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,
|
||||
value.items()
|
||||
))
|
||||
else:
|
||||
result[attr] = value
|
||||
|
||||
return result
|
||||
|
||||
def to_str(self):
|
||||
"""
|
||||
Returns the string representation of the model
|
||||
"""
|
||||
return pformat(self.to_dict())
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
For `print` and `pprint`
|
||||
"""
|
||||
return self.to_str()
|
||||
|
||||
def __eq__(self, other):
|
||||
"""
|
||||
Returns true if both objects are equal
|
||||
"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""
|
||||
Returns true if both objects are not equal
|
||||
"""
|
||||
return not self == other
|
||||
|
||||
@@ -40,18 +40,21 @@ class Name(object):
|
||||
self.swagger_types = {
|
||||
'name': 'int',
|
||||
'snake_case': 'int',
|
||||
'_property': 'str'
|
||||
'_property': 'str',
|
||||
'_123_number': 'int'
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'name': 'name',
|
||||
'snake_case': 'snake_case',
|
||||
'_property': 'property'
|
||||
'_property': 'property',
|
||||
'_123_number': '123Number'
|
||||
}
|
||||
|
||||
self._name = None
|
||||
self._snake_case = None
|
||||
self.__property = None
|
||||
self.__123_number = None
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
@@ -122,6 +125,29 @@ class Name(object):
|
||||
|
||||
self.__property = _property
|
||||
|
||||
@property
|
||||
def _123_number(self):
|
||||
"""
|
||||
Gets the _123_number of this Name.
|
||||
|
||||
|
||||
:return: The _123_number of this Name.
|
||||
:rtype: int
|
||||
"""
|
||||
return self.__123_number
|
||||
|
||||
@_123_number.setter
|
||||
def _123_number(self, _123_number):
|
||||
"""
|
||||
Sets the _123_number of this Name.
|
||||
|
||||
|
||||
:param _123_number: The _123_number of this Name.
|
||||
:type: int
|
||||
"""
|
||||
|
||||
self.__123_number = _123_number
|
||||
|
||||
def to_dict(self):
|
||||
"""
|
||||
Returns the model properties as a dict
|
||||
|
||||
Reference in New Issue
Block a user