-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Array.get_id supports both int and str
id
's
Updated error message for failure to create `Model` object Added attributes to attributes module. Removed 'health' primitives
- Loading branch information
1 parent
8052701
commit cc0026a
Showing
27 changed files
with
317 additions
and
419 deletions.
There are no files selected for viewing
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
39 changes: 22 additions & 17 deletions
39
async_v20/health/types.py → async_v20/definitions/health_types.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 |
---|---|---|
@@ -1,45 +1,50 @@ | ||
from ..definitions.base import Model, Array | ||
from .primitives import * | ||
from .base import Model, Array | ||
|
||
|
||
class ServiceList(Model): | ||
"""A collection of related services | ||
""" | ||
|
||
def __new__(cls, id: Id, name: Name, description: Description, url: URL): | ||
def __new__(cls, id: str, name: str, description: str, url: str): | ||
return super().__new__(**ServiceList._preset_arguments, **locals()) | ||
|
||
|
||
class ArrayServiceList(Array): | ||
_contains = ServiceList | ||
|
||
class Service(Model): | ||
"""A log of all events that have occurred in the past. | ||
The current state of a service is represented by the current status of the service.""" | ||
|
||
def __new__(cls, id: Id, name: Name, description: Description, | ||
list: ServiceList, current_event: CurrentEvent, url: URL): | ||
return super().__new__(**Service._preset_arguments, **locals()) | ||
|
||
class ArrayService(Array): | ||
_contains = Service | ||
|
||
class Status(Model): | ||
"""The current event of a status""" | ||
|
||
def __new__(cls, id: Id, name: Name, description: Description, url: URL, | ||
level: Level, image: Image, default: Default): | ||
def __new__(cls, id: str, name: str, description: str, url: str, | ||
level: str, image: str, default: bool): | ||
return super().__new__(**Status._preset_arguments, **locals()) | ||
|
||
|
||
class ArrayStatus(Array): | ||
_contains = Status | ||
|
||
|
||
class Event(Model): | ||
"""Anything Interesting that has happened to a Service""" | ||
|
||
def __new__(cls, sid: Sid, message: Message, timestamp: Timestamp, | ||
url: URL, status: Status, informational: Informational): | ||
def __new__(cls, sid: str, message: str, timestamp: str, | ||
url: str, status: Status, informational: bool): | ||
return super().__new__(**Event._preset_arguments, **locals()) | ||
|
||
|
||
class ArrayEvent(Array): | ||
_contains = Event | ||
|
||
|
||
class Service(Model): | ||
"""A log of all events that have occurred in the past. | ||
The current state of a service is represented by the current status of the service.""" | ||
|
||
def __new__(cls, id: str, name: str, description: str, | ||
list: ServiceList, current_event: Event, url: str): | ||
return super().__new__(**Service._preset_arguments, **locals()) | ||
|
||
|
||
class ArrayService(Array): | ||
_contains = Service |
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.