forked from loafle/openapi-generator-original
Merge pull request #1039 from geekerzp/python-desciption
[Python] Fix issue in python client
This commit is contained in:
commit
55be0330e3
@ -47,16 +47,30 @@ class {{classname}}(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
self._{{name}} = None{{#description}} # {{description}}{{/description}}
|
self._{{name}} = None
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
|
||||||
{{#vars}}
|
{{#vars}}
|
||||||
@property
|
@property
|
||||||
def {{name}}(self):
|
def {{name}}(self):
|
||||||
|
"""
|
||||||
|
Gets the {{name}} of this {{classname}}.
|
||||||
|
{{#description}} {{{description}}}{{/description}}
|
||||||
|
|
||||||
|
:return: The {{name}} of this {{classname}}.
|
||||||
|
:rtype: {{datatype}}
|
||||||
|
"""
|
||||||
return self._{{name}}
|
return self._{{name}}
|
||||||
|
|
||||||
@{{name}}.setter
|
@{{name}}.setter
|
||||||
def {{name}}(self, {{name}}):
|
def {{name}}(self, {{name}}):
|
||||||
|
"""
|
||||||
|
Sets the {{name}} of this {{classname}}.
|
||||||
|
{{#description}} {{{description}}}{{/description}}
|
||||||
|
|
||||||
|
:param {{name}}: The {{name}} of this {{classname}}.
|
||||||
|
:type: {{datatype}}
|
||||||
|
"""
|
||||||
{{#isEnum}}allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
|
{{#isEnum}}allowed_values = [{{#allowableValues}}{{#values}}"{{{this}}}"{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}]
|
||||||
if {{name}} not in allowed_values:
|
if {{name}} not in allowed_values:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
@ -49,18 +49,46 @@ class Category(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
"""
|
||||||
|
Gets the id of this Category.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The id of this Category.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(self, id):
|
def id(self, id):
|
||||||
|
"""
|
||||||
|
Sets the id of this Category.
|
||||||
|
|
||||||
|
|
||||||
|
:param id: The id of this Category.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._id = id
|
self._id = id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
"""
|
||||||
|
Gets the name of this Category.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this Category.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(self, name):
|
def name(self, name):
|
||||||
|
"""
|
||||||
|
Sets the name of this Category.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this Category.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._name = name
|
self._name = name
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
|
@ -61,42 +61,112 @@ class Order(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
"""
|
||||||
|
Gets the id of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The id of this Order.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(self, id):
|
def id(self, id):
|
||||||
|
"""
|
||||||
|
Sets the id of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:param id: The id of this Order.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._id = id
|
self._id = id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pet_id(self):
|
def pet_id(self):
|
||||||
|
"""
|
||||||
|
Gets the pet_id of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The pet_id of this Order.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._pet_id
|
return self._pet_id
|
||||||
|
|
||||||
@pet_id.setter
|
@pet_id.setter
|
||||||
def pet_id(self, pet_id):
|
def pet_id(self, pet_id):
|
||||||
|
"""
|
||||||
|
Sets the pet_id of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:param pet_id: The pet_id of this Order.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._pet_id = pet_id
|
self._pet_id = pet_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def quantity(self):
|
def quantity(self):
|
||||||
|
"""
|
||||||
|
Gets the quantity of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The quantity of this Order.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._quantity
|
return self._quantity
|
||||||
|
|
||||||
@quantity.setter
|
@quantity.setter
|
||||||
def quantity(self, quantity):
|
def quantity(self, quantity):
|
||||||
|
"""
|
||||||
|
Sets the quantity of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:param quantity: The quantity of this Order.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._quantity = quantity
|
self._quantity = quantity
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ship_date(self):
|
def ship_date(self):
|
||||||
|
"""
|
||||||
|
Gets the ship_date of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The ship_date of this Order.
|
||||||
|
:rtype: datetime
|
||||||
|
"""
|
||||||
return self._ship_date
|
return self._ship_date
|
||||||
|
|
||||||
@ship_date.setter
|
@ship_date.setter
|
||||||
def ship_date(self, ship_date):
|
def ship_date(self, ship_date):
|
||||||
|
"""
|
||||||
|
Sets the ship_date of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:param ship_date: The ship_date of this Order.
|
||||||
|
:type: datetime
|
||||||
|
"""
|
||||||
self._ship_date = ship_date
|
self._ship_date = ship_date
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
|
"""
|
||||||
|
Gets the status of this Order.
|
||||||
|
Order Status
|
||||||
|
|
||||||
|
:return: The status of this Order.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
@status.setter
|
@status.setter
|
||||||
def status(self, status):
|
def status(self, status):
|
||||||
|
"""
|
||||||
|
Sets the status of this Order.
|
||||||
|
Order Status
|
||||||
|
|
||||||
|
:param status: The status of this Order.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
allowed_values = ["placed", "approved", "delivered"]
|
allowed_values = ["placed", "approved", "delivered"]
|
||||||
if status not in allowed_values:
|
if status not in allowed_values:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
@ -107,10 +177,24 @@ class Order(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def complete(self):
|
def complete(self):
|
||||||
|
"""
|
||||||
|
Gets the complete of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The complete of this Order.
|
||||||
|
:rtype: bool
|
||||||
|
"""
|
||||||
return self._complete
|
return self._complete
|
||||||
|
|
||||||
@complete.setter
|
@complete.setter
|
||||||
def complete(self, complete):
|
def complete(self, complete):
|
||||||
|
"""
|
||||||
|
Sets the complete of this Order.
|
||||||
|
|
||||||
|
|
||||||
|
:param complete: The complete of this Order.
|
||||||
|
:type: bool
|
||||||
|
"""
|
||||||
self._complete = complete
|
self._complete = complete
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
|
@ -61,50 +61,134 @@ class Pet(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
"""
|
||||||
|
Gets the id of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The id of this Pet.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(self, id):
|
def id(self, id):
|
||||||
|
"""
|
||||||
|
Sets the id of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:param id: The id of this Pet.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._id = id
|
self._id = id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def category(self):
|
def category(self):
|
||||||
|
"""
|
||||||
|
Gets the category of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The category of this Pet.
|
||||||
|
:rtype: Category
|
||||||
|
"""
|
||||||
return self._category
|
return self._category
|
||||||
|
|
||||||
@category.setter
|
@category.setter
|
||||||
def category(self, category):
|
def category(self, category):
|
||||||
|
"""
|
||||||
|
Sets the category of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:param category: The category of this Pet.
|
||||||
|
:type: Category
|
||||||
|
"""
|
||||||
self._category = category
|
self._category = category
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
"""
|
||||||
|
Gets the name of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this Pet.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(self, name):
|
def name(self, name):
|
||||||
|
"""
|
||||||
|
Sets the name of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this Pet.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._name = name
|
self._name = name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def photo_urls(self):
|
def photo_urls(self):
|
||||||
|
"""
|
||||||
|
Gets the photo_urls of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The photo_urls of this Pet.
|
||||||
|
:rtype: list[str]
|
||||||
|
"""
|
||||||
return self._photo_urls
|
return self._photo_urls
|
||||||
|
|
||||||
@photo_urls.setter
|
@photo_urls.setter
|
||||||
def photo_urls(self, photo_urls):
|
def photo_urls(self, photo_urls):
|
||||||
|
"""
|
||||||
|
Sets the photo_urls of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:param photo_urls: The photo_urls of this Pet.
|
||||||
|
:type: list[str]
|
||||||
|
"""
|
||||||
self._photo_urls = photo_urls
|
self._photo_urls = photo_urls
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def tags(self):
|
def tags(self):
|
||||||
|
"""
|
||||||
|
Gets the tags of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The tags of this Pet.
|
||||||
|
:rtype: list[Tag]
|
||||||
|
"""
|
||||||
return self._tags
|
return self._tags
|
||||||
|
|
||||||
@tags.setter
|
@tags.setter
|
||||||
def tags(self, tags):
|
def tags(self, tags):
|
||||||
|
"""
|
||||||
|
Sets the tags of this Pet.
|
||||||
|
|
||||||
|
|
||||||
|
:param tags: The tags of this Pet.
|
||||||
|
:type: list[Tag]
|
||||||
|
"""
|
||||||
self._tags = tags
|
self._tags = tags
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def status(self):
|
def status(self):
|
||||||
|
"""
|
||||||
|
Gets the status of this Pet.
|
||||||
|
pet status in the store
|
||||||
|
|
||||||
|
:return: The status of this Pet.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._status
|
return self._status
|
||||||
|
|
||||||
@status.setter
|
@status.setter
|
||||||
def status(self, status):
|
def status(self, status):
|
||||||
|
"""
|
||||||
|
Sets the status of this Pet.
|
||||||
|
pet status in the store
|
||||||
|
|
||||||
|
:param status: The status of this Pet.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
allowed_values = ["available", "pending", "sold"]
|
allowed_values = ["available", "pending", "sold"]
|
||||||
if status not in allowed_values:
|
if status not in allowed_values:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
|
@ -49,18 +49,46 @@ class Tag(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
"""
|
||||||
|
Gets the id of this Tag.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The id of this Tag.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(self, id):
|
def id(self, id):
|
||||||
|
"""
|
||||||
|
Sets the id of this Tag.
|
||||||
|
|
||||||
|
|
||||||
|
:param id: The id of this Tag.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._id = id
|
self._id = id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
|
"""
|
||||||
|
Gets the name of this Tag.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The name of this Tag.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@name.setter
|
@name.setter
|
||||||
def name(self, name):
|
def name(self, name):
|
||||||
|
"""
|
||||||
|
Sets the name of this Tag.
|
||||||
|
|
||||||
|
|
||||||
|
:param name: The name of this Tag.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._name = name
|
self._name = name
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
|
@ -67,66 +67,178 @@ class User(object):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def id(self):
|
def id(self):
|
||||||
|
"""
|
||||||
|
Gets the id of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The id of this User.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._id
|
return self._id
|
||||||
|
|
||||||
@id.setter
|
@id.setter
|
||||||
def id(self, id):
|
def id(self, id):
|
||||||
|
"""
|
||||||
|
Sets the id of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param id: The id of this User.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._id = id
|
self._id = id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def username(self):
|
def username(self):
|
||||||
|
"""
|
||||||
|
Gets the username of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The username of this User.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._username
|
return self._username
|
||||||
|
|
||||||
@username.setter
|
@username.setter
|
||||||
def username(self, username):
|
def username(self, username):
|
||||||
|
"""
|
||||||
|
Sets the username of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param username: The username of this User.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._username = username
|
self._username = username
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def first_name(self):
|
def first_name(self):
|
||||||
|
"""
|
||||||
|
Gets the first_name of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The first_name of this User.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._first_name
|
return self._first_name
|
||||||
|
|
||||||
@first_name.setter
|
@first_name.setter
|
||||||
def first_name(self, first_name):
|
def first_name(self, first_name):
|
||||||
|
"""
|
||||||
|
Sets the first_name of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param first_name: The first_name of this User.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._first_name = first_name
|
self._first_name = first_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def last_name(self):
|
def last_name(self):
|
||||||
|
"""
|
||||||
|
Gets the last_name of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The last_name of this User.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._last_name
|
return self._last_name
|
||||||
|
|
||||||
@last_name.setter
|
@last_name.setter
|
||||||
def last_name(self, last_name):
|
def last_name(self, last_name):
|
||||||
|
"""
|
||||||
|
Sets the last_name of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param last_name: The last_name of this User.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._last_name = last_name
|
self._last_name = last_name
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def email(self):
|
def email(self):
|
||||||
|
"""
|
||||||
|
Gets the email of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The email of this User.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._email
|
return self._email
|
||||||
|
|
||||||
@email.setter
|
@email.setter
|
||||||
def email(self, email):
|
def email(self, email):
|
||||||
|
"""
|
||||||
|
Sets the email of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param email: The email of this User.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._email = email
|
self._email = email
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def password(self):
|
def password(self):
|
||||||
|
"""
|
||||||
|
Gets the password of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The password of this User.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._password
|
return self._password
|
||||||
|
|
||||||
@password.setter
|
@password.setter
|
||||||
def password(self, password):
|
def password(self, password):
|
||||||
|
"""
|
||||||
|
Sets the password of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param password: The password of this User.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._password = password
|
self._password = password
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def phone(self):
|
def phone(self):
|
||||||
|
"""
|
||||||
|
Gets the phone of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:return: The phone of this User.
|
||||||
|
:rtype: str
|
||||||
|
"""
|
||||||
return self._phone
|
return self._phone
|
||||||
|
|
||||||
@phone.setter
|
@phone.setter
|
||||||
def phone(self, phone):
|
def phone(self, phone):
|
||||||
|
"""
|
||||||
|
Sets the phone of this User.
|
||||||
|
|
||||||
|
|
||||||
|
:param phone: The phone of this User.
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
self._phone = phone
|
self._phone = phone
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_status(self):
|
def user_status(self):
|
||||||
|
"""
|
||||||
|
Gets the user_status of this User.
|
||||||
|
User Status
|
||||||
|
|
||||||
|
:return: The user_status of this User.
|
||||||
|
:rtype: int
|
||||||
|
"""
|
||||||
return self._user_status
|
return self._user_status
|
||||||
|
|
||||||
@user_status.setter
|
@user_status.setter
|
||||||
def user_status(self, user_status):
|
def user_status(self, user_status):
|
||||||
|
"""
|
||||||
|
Sets the user_status of this User.
|
||||||
|
User Status
|
||||||
|
|
||||||
|
:param user_status: The user_status of this User.
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
self._user_status = user_status
|
self._user_status = user_status
|
||||||
|
|
||||||
def to_dict(self):
|
def to_dict(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user