corvix.domain¶
Domain models for GitHub notifications.
Attributes¶
Classes¶
Normalized notification from GitHub's notifications API. |
|
Scored and rule-evaluated notification persisted for dashboards. |
Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Parse an ISO8601 timestamp into a timezone-aware datetime. |
|
Format a timezone-aware datetime as an ISO8601 string. |
|
Return a stable account-scoped key for a notification. |
|
|
|
Module Contents¶
- corvix.domain._require_non_empty_str(payload: collections.abc.Mapping[str, object], key: str, label: str) str[source][source]¶
- corvix.domain._optional_str(payload: collections.abc.Mapping[str, object], key: str) str | None[source][source]¶
- corvix.domain._optional_bool(payload: collections.abc.Mapping[str, object], key: str, default: bool, label: str) bool[source][source]¶
- corvix.domain._optional_float(payload: collections.abc.Mapping[str, object], key: str, default: float, label: str) float[source][source]¶
- corvix.domain._optional_str_list(payload: collections.abc.Mapping[str, object], key: str) list[str][source][source]¶
- corvix.domain._optional_context(payload: collections.abc.Mapping[str, object], key: str) dict[str, object][source][source]¶
- corvix.domain.parse_timestamp(value: str) datetime.datetime[source][source]¶
Parse an ISO8601 timestamp into a timezone-aware datetime.
- corvix.domain.format_timestamp(value: datetime.datetime) str[source][source]¶
Format a timezone-aware datetime as an ISO8601 string.
- class corvix.domain.Notification[source][source]¶
Normalized notification from GitHub’s notifications API.
- updated_at: datetime.datetime[source][source]¶
- classmethod from_api_payload(payload: collections.abc.Mapping[str, object], *, account_id: str = 'primary', account_label: str = 'Primary') Notification[source][source]¶
Build a notification from a GitHub API response payload.
- class corvix.domain.NotificationRecord[source][source]¶
Scored and rule-evaluated notification persisted for dashboards.
- notification: Notification[source][source]¶
- classmethod from_dict(payload: collections.abc.Mapping[str, object]) NotificationRecord[source][source]¶
Parse a stored record.
- corvix.domain.notification_key(notification: Notification) str[source][source]¶
Return a stable account-scoped key for a notification.
- corvix.domain._get_non_empty_str_or_default(payload: collections.abc.Mapping[str, object], key: str, default: str) str[source][source]¶