[python] Add ability to get allowed values (#4138)

* Add function to get list of allowed values

* [python] Add function to get list of allowed values

* Remove temporary variable

* Remove static method and use a variable

* Remove classname
This commit is contained in:
Arun
2019-10-24 14:58:29 +05:30
committed by William Cheng
parent 84c6a7c1e7
commit 652b0f5bf6
8 changed files with 18 additions and 0 deletions

View File

@@ -27,6 +27,10 @@ class {{classname}}(object):
{{/-last}}
{{/enumVars}}{{/allowableValues}}
{{#allowableValues}}
allowable_values = [{{#enumVars}}{{name}}{{^-last}}, {{/-last}}{{/enumVars}}] # noqa: E501
{{/allowableValues}}
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class EnumClass(object):
_EFG = "-efg"
_XYZ_ = "(xyz)"
allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class OuterEnum(object):
APPROVED = "approved"
DELIVERED = "delivered"
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class EnumClass(object):
_EFG = "-efg"
_XYZ_ = "(xyz)"
allowable_values = [_ABC, _EFG, _XYZ_] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class OuterEnum(object):
APPROVED = "approved"
DELIVERED = "delivered"
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class OuterEnumDefaultValue(object):
APPROVED = "approved"
DELIVERED = "delivered"
allowable_values = [PLACED, APPROVED, DELIVERED] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class OuterEnumInteger(object):
_1 = "1"
_2 = "2"
allowable_values = [_0, _1, _2] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name

View File

@@ -32,6 +32,8 @@ class OuterEnumIntegerDefaultValue(object):
_1 = "1"
_2 = "2"
allowable_values = [_0, _1, _2] # noqa: E501
"""
Attributes:
openapi_types (dict): The key is attribute name