-
Notifications
You must be signed in to change notification settings - Fork 6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
574 additions
and
28 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
samples/client/petstore/python-asyncio/.swagger-codegen/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.3.0-SNAPSHOT | ||
2.4.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
138 changes: 138 additions & 0 deletions
138
samples/client/petstore/python-asyncio/petstore_api/models/model200_response.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Swagger Petstore | ||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: apiteam@swagger.io | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
||
|
||
import pprint | ||
import re # noqa: F401 | ||
|
||
import six | ||
|
||
|
||
class Model200Response(object): | ||
"""NOTE: This class is auto generated by the swagger code generator program. | ||
Do not edit the class manually. | ||
""" | ||
|
||
""" | ||
Attributes: | ||
swagger_types (dict): The key is attribute name | ||
and the value is attribute type. | ||
attribute_map (dict): The key is attribute name | ||
and the value is json key in definition. | ||
""" | ||
swagger_types = { | ||
'name': 'int', | ||
'_class': 'str' | ||
} | ||
|
||
attribute_map = { | ||
'name': 'name', | ||
'_class': 'class' | ||
} | ||
|
||
def __init__(self, name=None, _class=None): # noqa: E501 | ||
"""Model200Response - a model defined in Swagger""" # noqa: E501 | ||
|
||
self._name = None | ||
self.__class = None | ||
self.discriminator = None | ||
|
||
if name is not None: | ||
self.name = name | ||
if _class is not None: | ||
self._class = _class | ||
|
||
@property | ||
def name(self): | ||
"""Gets the name of this Model200Response. # noqa: E501 | ||
:return: The name of this Model200Response. # noqa: E501 | ||
:rtype: int | ||
""" | ||
return self._name | ||
|
||
@name.setter | ||
def name(self, name): | ||
"""Sets the name of this Model200Response. | ||
:param name: The name of this Model200Response. # noqa: E501 | ||
:type: int | ||
""" | ||
|
||
self._name = name | ||
|
||
@property | ||
def _class(self): | ||
"""Gets the _class of this Model200Response. # noqa: E501 | ||
:return: The _class of this Model200Response. # noqa: E501 | ||
:rtype: str | ||
""" | ||
return self.__class | ||
|
||
@_class.setter | ||
def _class(self, _class): | ||
"""Sets the _class of this Model200Response. | ||
:param _class: The _class of this Model200Response. # noqa: E501 | ||
:type: str | ||
""" | ||
|
||
self.__class = _class | ||
|
||
def to_dict(self): | ||
"""Returns the model properties as a dict""" | ||
result = {} | ||
|
||
for attr, _ in six.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 pprint.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""" | ||
if not isinstance(other, Model200Response): | ||
return False | ||
|
||
return self.__dict__ == other.__dict__ | ||
|
||
def __ne__(self, other): | ||
"""Returns true if both objects are not equal""" | ||
return not self == other |
40 changes: 40 additions & 0 deletions
40
samples/client/petstore/python-asyncio/test/test_model200_response.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# coding: utf-8 | ||
|
||
""" | ||
Swagger Petstore | ||
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: apiteam@swagger.io | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
||
|
||
from __future__ import absolute_import | ||
|
||
import unittest | ||
|
||
import petstore_api | ||
from petstore_api.models.model200_response import Model200Response # noqa: E501 | ||
from petstore_api.rest import ApiException | ||
|
||
|
||
class TestModel200Response(unittest.TestCase): | ||
"""Model200Response unit test stubs""" | ||
|
||
def setUp(self): | ||
pass | ||
|
||
def tearDown(self): | ||
pass | ||
|
||
def testModel200Response(self): | ||
"""Test Model200Response""" | ||
# FIXME: construct object with mandatory attributes with example values | ||
# model = petstore_api.models.model200_response.Model200Response() # noqa: E501 | ||
pass | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
2 changes: 1 addition & 1 deletion
2
samples/client/petstore/python-tornado/.swagger-codegen/VERSION
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.3.0-SNAPSHOT | ||
2.4.0-SNAPSHOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.