2018-04-17 12:18:40 +00:00
|
|
|
"""OpenAPI X-Model extension models module"""
|
2017-09-22 08:14:07 +00:00
|
|
|
|
|
|
|
|
2018-08-21 17:33:24 +00:00
|
|
|
class BaseModel(object):
|
2018-04-17 12:18:40 +00:00
|
|
|
"""Base class for OpenAPI X-Model."""
|
2017-09-22 08:14:07 +00:00
|
|
|
|
2018-08-21 17:33:24 +00:00
|
|
|
@property
|
|
|
|
def __dict__(self):
|
|
|
|
raise NotImplementedError
|
|
|
|
|
|
|
|
|
|
|
|
class Model(BaseModel):
|
|
|
|
"""Model class for OpenAPI X-Model."""
|
|
|
|
|
|
|
|
def __init__(self, properties=None):
|
|
|
|
self.__properties = properties or {}
|
|
|
|
|
|
|
|
@property
|
|
|
|
def __dict__(self):
|
|
|
|
return self.__properties
|
|
|
|
|
|
|
|
def __getattr__(self, name):
|
|
|
|
if name not in self.__properties:
|
|
|
|
raise AttributeError
|
|
|
|
|
|
|
|
return self.__properties[name]
|