Publish curated ITWorx-ModelForge source from 990401737f96c8d46a9f7b0d84994516cadcb6a0
This commit is contained in:
1 parent
7082ab955a
commit
848f0d8f8a
434 files changed
+67298
-4315
No files matched your search
@@ -0,0 +1,49 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from enum import StrEnum
|
||||
from uuid import UUID
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
|
||||
class NotificationStatus(StrEnum):
|
||||
PENDING = "PENDING"
|
||||
DISPATCHING = "DISPATCHING"
|
||||
RETRY_WAIT = "RETRY_WAIT"
|
||||
DELIVERED = "DELIVERED"
|
||||
FAILED = "FAILED"
|
||||
HELD_FOR_REVIEW = "HELD_FOR_REVIEW"
|
||||
|
||||
|
||||
class NotificationKind(StrEnum):
|
||||
FIRING = "FIRING"
|
||||
RESOLVED = "RESOLVED"
|
||||
TEST = "TEST"
|
||||
|
||||
|
||||
class NotificationDeliveryResponse(BaseModel):
|
||||
"""Safe operator-facing delivery metadata. Payload and destination are never returned."""
|
||||
|
||||
model_config = ConfigDict(extra="forbid", from_attributes=True)
|
||||
|
||||
id: UUID
|
||||
alert_history_event_id: UUID | None
|
||||
route_key: str
|
||||
event_kind: NotificationKind
|
||||
severity: str | None
|
||||
status: NotificationStatus
|
||||
attempt_count: int
|
||||
next_attempt_at: datetime | None
|
||||
last_attempt_at: datetime | None
|
||||
delivered_at: datetime | None
|
||||
last_http_status: int | None
|
||||
last_error_code: str | None
|
||||
created_at: datetime
|
||||
|
||||
|
||||
class NotificationTestResponse(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
delivery: NotificationDeliveryResponse
|
||||
message: str
|
||||
Reference in new issue
Block a user