init commit
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
# flake8: noqa
|
||||
# import models into model package
|
||||
from openapi_server.models.patch_notes import PatchNotes
|
||||
from openapi_server.models.user import User
|
||||
@@ -0,0 +1,68 @@
|
||||
import pprint
|
||||
|
||||
import typing
|
||||
|
||||
from openapi_server import util
|
||||
|
||||
T = typing.TypeVar('T')
|
||||
|
||||
|
||||
class Model:
|
||||
# openapiTypes: The key is attribute name and the
|
||||
# value is attribute type.
|
||||
openapi_types: typing.Dict[str, type] = {}
|
||||
|
||||
# attributeMap: The key is attribute name and the
|
||||
# value is json key in definition.
|
||||
attribute_map: typing.Dict[str, str] = {}
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls: typing.Type[T], dikt) -> T:
|
||||
"""Returns the dict as a model"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
def to_dict(self):
|
||||
"""Returns the model properties as a dict
|
||||
|
||||
:rtype: dict
|
||||
"""
|
||||
result = {}
|
||||
|
||||
for attr in self.openapi_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
|
||||
|
||||
:rtype: str
|
||||
"""
|
||||
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"""
|
||||
return self.__dict__ == other.__dict__
|
||||
|
||||
def __ne__(self, other):
|
||||
"""Returns true if both objects are not equal"""
|
||||
return not self == other
|
||||
@@ -0,0 +1,139 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server import util
|
||||
|
||||
|
||||
class PatchNotes(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, patch_id=None, title=None, changes=None, _date=None): # noqa: E501
|
||||
"""PatchNotes - a model defined in OpenAPI
|
||||
|
||||
:param patch_id: The patch_id of this PatchNotes. # noqa: E501
|
||||
:type patch_id: str
|
||||
:param title: The title of this PatchNotes. # noqa: E501
|
||||
:type title: str
|
||||
:param changes: The changes of this PatchNotes. # noqa: E501
|
||||
:type changes: str
|
||||
:param _date: The _date of this PatchNotes. # noqa: E501
|
||||
:type _date: str
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'patch_id': str,
|
||||
'title': str,
|
||||
'changes': str,
|
||||
'_date': str
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'patch_id': 'patchID',
|
||||
'title': 'title',
|
||||
'changes': 'changes',
|
||||
'_date': 'date'
|
||||
}
|
||||
|
||||
self._patch_id = patch_id
|
||||
self._title = title
|
||||
self._changes = changes
|
||||
self.__date = _date
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'PatchNotes':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The patch_notes of this PatchNotes. # noqa: E501
|
||||
:rtype: PatchNotes
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def patch_id(self) -> str:
|
||||
"""Gets the patch_id of this PatchNotes.
|
||||
|
||||
|
||||
:return: The patch_id of this PatchNotes.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._patch_id
|
||||
|
||||
@patch_id.setter
|
||||
def patch_id(self, patch_id: str):
|
||||
"""Sets the patch_id of this PatchNotes.
|
||||
|
||||
|
||||
:param patch_id: The patch_id of this PatchNotes.
|
||||
:type patch_id: str
|
||||
"""
|
||||
|
||||
self._patch_id = patch_id
|
||||
|
||||
@property
|
||||
def title(self) -> str:
|
||||
"""Gets the title of this PatchNotes.
|
||||
|
||||
|
||||
:return: The title of this PatchNotes.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._title
|
||||
|
||||
@title.setter
|
||||
def title(self, title: str):
|
||||
"""Sets the title of this PatchNotes.
|
||||
|
||||
|
||||
:param title: The title of this PatchNotes.
|
||||
:type title: str
|
||||
"""
|
||||
|
||||
self._title = title
|
||||
|
||||
@property
|
||||
def changes(self) -> str:
|
||||
"""Gets the changes of this PatchNotes.
|
||||
|
||||
|
||||
:return: The changes of this PatchNotes.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._changes
|
||||
|
||||
@changes.setter
|
||||
def changes(self, changes: str):
|
||||
"""Sets the changes of this PatchNotes.
|
||||
|
||||
|
||||
:param changes: The changes of this PatchNotes.
|
||||
:type changes: str
|
||||
"""
|
||||
|
||||
self._changes = changes
|
||||
|
||||
@property
|
||||
def _date(self) -> str:
|
||||
"""Gets the _date of this PatchNotes.
|
||||
|
||||
|
||||
:return: The _date of this PatchNotes.
|
||||
:rtype: str
|
||||
"""
|
||||
return self.__date
|
||||
|
||||
@_date.setter
|
||||
def _date(self, _date: str):
|
||||
"""Sets the _date of this PatchNotes.
|
||||
|
||||
|
||||
:param _date: The _date of this PatchNotes.
|
||||
:type _date: str
|
||||
"""
|
||||
|
||||
self.__date = _date
|
||||
@@ -0,0 +1,61 @@
|
||||
from datetime import date, datetime # noqa: F401
|
||||
|
||||
from typing import List, Dict # noqa: F401
|
||||
|
||||
from openapi_server.models.base_model import Model
|
||||
from openapi_server import util
|
||||
|
||||
|
||||
class User(Model):
|
||||
"""NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
|
||||
Do not edit the class manually.
|
||||
"""
|
||||
|
||||
def __init__(self, last_note_checked=None): # noqa: E501
|
||||
"""User - a model defined in OpenAPI
|
||||
|
||||
:param last_note_checked: The last_note_checked of this User. # noqa: E501
|
||||
:type last_note_checked: str
|
||||
"""
|
||||
self.openapi_types = {
|
||||
'last_note_checked': str
|
||||
}
|
||||
|
||||
self.attribute_map = {
|
||||
'last_note_checked': 'lastNoteChecked'
|
||||
}
|
||||
|
||||
self._last_note_checked = last_note_checked
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, dikt) -> 'User':
|
||||
"""Returns the dict as a model
|
||||
|
||||
:param dikt: A dict.
|
||||
:type: dict
|
||||
:return: The user of this User. # noqa: E501
|
||||
:rtype: User
|
||||
"""
|
||||
return util.deserialize_model(dikt, cls)
|
||||
|
||||
@property
|
||||
def last_note_checked(self) -> str:
|
||||
"""Gets the last_note_checked of this User.
|
||||
|
||||
|
||||
:return: The last_note_checked of this User.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._last_note_checked
|
||||
|
||||
@last_note_checked.setter
|
||||
def last_note_checked(self, last_note_checked: str):
|
||||
"""Sets the last_note_checked of this User.
|
||||
|
||||
|
||||
:param last_note_checked: The last_note_checked of this User.
|
||||
:type last_note_checked: str
|
||||
"""
|
||||
|
||||
self._last_note_checked = last_note_checked
|
||||
Reference in New Issue
Block a user