mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-03 17:00:43 +00:00
Adding model type hints for Python Flask (#16382)
Co-authored-by: Baptiste LE MORLEC <baptiste.lemorlec@stryker.com>
This commit is contained in:
committed by
GitHub
parent
9cda7b0965
commit
26899ee59b
@@ -50,7 +50,7 @@ class ApiResponse(Model):
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def code(self):
|
||||
def code(self) -> int:
|
||||
"""Gets the code of this ApiResponse.
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class ApiResponse(Model):
|
||||
return self._code
|
||||
|
||||
@code.setter
|
||||
def code(self, code):
|
||||
def code(self, code: int):
|
||||
"""Sets the code of this ApiResponse.
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ class ApiResponse(Model):
|
||||
self._code = code
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
def type(self) -> str:
|
||||
"""Gets the type of this ApiResponse.
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class ApiResponse(Model):
|
||||
return self._type
|
||||
|
||||
@type.setter
|
||||
def type(self, type):
|
||||
def type(self, type: str):
|
||||
"""Sets the type of this ApiResponse.
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class ApiResponse(Model):
|
||||
self._type = type
|
||||
|
||||
@property
|
||||
def message(self):
|
||||
def message(self) -> str:
|
||||
"""Gets the message of this ApiResponse.
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class ApiResponse(Model):
|
||||
return self._message
|
||||
|
||||
@message.setter
|
||||
def message(self, message):
|
||||
def message(self, message: str):
|
||||
"""Sets the message of this ApiResponse.
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ class Category(Model):
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
def id(self) -> int:
|
||||
"""Gets the id of this Category.
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class Category(Model):
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
def id(self, id: int):
|
||||
"""Sets the id of this Category.
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class Category(Model):
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Category.
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class Category(Model):
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Category.
|
||||
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class Order(Model):
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
def id(self) -> int:
|
||||
"""Gets the id of this Order.
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class Order(Model):
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
def id(self, id: int):
|
||||
"""Sets the id of this Order.
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ class Order(Model):
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def pet_id(self):
|
||||
def pet_id(self) -> int:
|
||||
"""Gets the pet_id of this Order.
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class Order(Model):
|
||||
return self._pet_id
|
||||
|
||||
@pet_id.setter
|
||||
def pet_id(self, pet_id):
|
||||
def pet_id(self, pet_id: int):
|
||||
"""Sets the pet_id of this Order.
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class Order(Model):
|
||||
self._pet_id = pet_id
|
||||
|
||||
@property
|
||||
def quantity(self):
|
||||
def quantity(self) -> int:
|
||||
"""Gets the quantity of this Order.
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class Order(Model):
|
||||
return self._quantity
|
||||
|
||||
@quantity.setter
|
||||
def quantity(self, quantity):
|
||||
def quantity(self, quantity: int):
|
||||
"""Sets the quantity of this Order.
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ class Order(Model):
|
||||
self._quantity = quantity
|
||||
|
||||
@property
|
||||
def ship_date(self):
|
||||
def ship_date(self) -> datetime:
|
||||
"""Gets the ship_date of this Order.
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class Order(Model):
|
||||
return self._ship_date
|
||||
|
||||
@ship_date.setter
|
||||
def ship_date(self, ship_date):
|
||||
def ship_date(self, ship_date: datetime):
|
||||
"""Sets the ship_date of this Order.
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ class Order(Model):
|
||||
self._ship_date = ship_date
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
def status(self) -> str:
|
||||
"""Gets the status of this Order.
|
||||
|
||||
Order Status # noqa: E501
|
||||
@@ -160,7 +160,7 @@ class Order(Model):
|
||||
return self._status
|
||||
|
||||
@status.setter
|
||||
def status(self, status):
|
||||
def status(self, status: str):
|
||||
"""Sets the status of this Order.
|
||||
|
||||
Order Status # noqa: E501
|
||||
@@ -178,7 +178,7 @@ class Order(Model):
|
||||
self._status = status
|
||||
|
||||
@property
|
||||
def complete(self):
|
||||
def complete(self) -> bool:
|
||||
"""Gets the complete of this Order.
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ class Order(Model):
|
||||
return self._complete
|
||||
|
||||
@complete.setter
|
||||
def complete(self, complete):
|
||||
def complete(self, complete: bool):
|
||||
"""Sets the complete of this Order.
|
||||
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class Pet(Model):
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
def id(self) -> int:
|
||||
"""Gets the id of this Pet.
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ class Pet(Model):
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
def id(self, id: int):
|
||||
"""Sets the id of this Pet.
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ class Pet(Model):
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def category(self):
|
||||
def category(self) -> Category:
|
||||
"""Gets the category of this Pet.
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ class Pet(Model):
|
||||
return self._category
|
||||
|
||||
@category.setter
|
||||
def category(self, category):
|
||||
def category(self, category: Category):
|
||||
"""Sets the category of this Pet.
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class Pet(Model):
|
||||
self._category = category
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Pet.
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ class Pet(Model):
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Pet.
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ class Pet(Model):
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def photo_urls(self):
|
||||
def photo_urls(self) -> List[str]:
|
||||
"""Gets the photo_urls of this Pet.
|
||||
|
||||
|
||||
@@ -144,7 +144,7 @@ class Pet(Model):
|
||||
return self._photo_urls
|
||||
|
||||
@photo_urls.setter
|
||||
def photo_urls(self, photo_urls):
|
||||
def photo_urls(self, photo_urls: List[str]):
|
||||
"""Sets the photo_urls of this Pet.
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class Pet(Model):
|
||||
self._photo_urls = photo_urls
|
||||
|
||||
@property
|
||||
def tags(self):
|
||||
def tags(self) -> List[Tag]:
|
||||
"""Gets the tags of this Pet.
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ class Pet(Model):
|
||||
return self._tags
|
||||
|
||||
@tags.setter
|
||||
def tags(self, tags):
|
||||
def tags(self, tags: List[Tag]):
|
||||
"""Sets the tags of this Pet.
|
||||
|
||||
|
||||
@@ -178,7 +178,7 @@ class Pet(Model):
|
||||
self._tags = tags
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
def status(self) -> str:
|
||||
"""Gets the status of this Pet.
|
||||
|
||||
pet status in the store # noqa: E501
|
||||
@@ -189,7 +189,7 @@ class Pet(Model):
|
||||
return self._status
|
||||
|
||||
@status.setter
|
||||
def status(self, status):
|
||||
def status(self, status: str):
|
||||
"""Sets the status of this Pet.
|
||||
|
||||
pet status in the store # noqa: E501
|
||||
|
||||
@@ -45,7 +45,7 @@ class Tag(Model):
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
def id(self) -> int:
|
||||
"""Gets the id of this Tag.
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class Tag(Model):
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
def id(self, id: int):
|
||||
"""Sets the id of this Tag.
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class Tag(Model):
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
def name(self) -> str:
|
||||
"""Gets the name of this Tag.
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class Tag(Model):
|
||||
return self._name
|
||||
|
||||
@name.setter
|
||||
def name(self, name):
|
||||
def name(self, name: str):
|
||||
"""Sets the name of this Tag.
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ class User(Model):
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
def id(self) -> int:
|
||||
"""Gets the id of this User.
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ class User(Model):
|
||||
return self._id
|
||||
|
||||
@id.setter
|
||||
def id(self, id):
|
||||
def id(self, id: int):
|
||||
"""Sets the id of this User.
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class User(Model):
|
||||
self._id = id
|
||||
|
||||
@property
|
||||
def username(self):
|
||||
def username(self) -> str:
|
||||
"""Gets the username of this User.
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class User(Model):
|
||||
return self._username
|
||||
|
||||
@username.setter
|
||||
def username(self, username):
|
||||
def username(self, username: str):
|
||||
"""Sets the username of this User.
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ class User(Model):
|
||||
self._username = username
|
||||
|
||||
@property
|
||||
def first_name(self):
|
||||
def first_name(self) -> str:
|
||||
"""Gets the first_name of this User.
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@ class User(Model):
|
||||
return self._first_name
|
||||
|
||||
@first_name.setter
|
||||
def first_name(self, first_name):
|
||||
def first_name(self, first_name: str):
|
||||
"""Sets the first_name of this User.
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ class User(Model):
|
||||
self._first_name = first_name
|
||||
|
||||
@property
|
||||
def last_name(self):
|
||||
def last_name(self) -> str:
|
||||
"""Gets the last_name of this User.
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ class User(Model):
|
||||
return self._last_name
|
||||
|
||||
@last_name.setter
|
||||
def last_name(self, last_name):
|
||||
def last_name(self, last_name: str):
|
||||
"""Sets the last_name of this User.
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ class User(Model):
|
||||
self._last_name = last_name
|
||||
|
||||
@property
|
||||
def email(self):
|
||||
def email(self) -> str:
|
||||
"""Gets the email of this User.
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ class User(Model):
|
||||
return self._email
|
||||
|
||||
@email.setter
|
||||
def email(self, email):
|
||||
def email(self, email: str):
|
||||
"""Sets the email of this User.
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ class User(Model):
|
||||
self._email = email
|
||||
|
||||
@property
|
||||
def password(self):
|
||||
def password(self) -> str:
|
||||
"""Gets the password of this User.
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ class User(Model):
|
||||
return self._password
|
||||
|
||||
@password.setter
|
||||
def password(self, password):
|
||||
def password(self, password: str):
|
||||
"""Sets the password of this User.
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ class User(Model):
|
||||
self._password = password
|
||||
|
||||
@property
|
||||
def phone(self):
|
||||
def phone(self) -> str:
|
||||
"""Gets the phone of this User.
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ class User(Model):
|
||||
return self._phone
|
||||
|
||||
@phone.setter
|
||||
def phone(self, phone):
|
||||
def phone(self, phone: str):
|
||||
"""Sets the phone of this User.
|
||||
|
||||
|
||||
@@ -222,7 +222,7 @@ class User(Model):
|
||||
self._phone = phone
|
||||
|
||||
@property
|
||||
def user_status(self):
|
||||
def user_status(self) -> int:
|
||||
"""Gets the user_status of this User.
|
||||
|
||||
User Status # noqa: E501
|
||||
@@ -233,7 +233,7 @@ class User(Model):
|
||||
return self._user_status
|
||||
|
||||
@user_status.setter
|
||||
def user_status(self, user_status):
|
||||
def user_status(self, user_status: int):
|
||||
"""Sets the user_status of this User.
|
||||
|
||||
User Status # noqa: E501
|
||||
|
||||
Reference in New Issue
Block a user