Spaces:
Sleeping
Sleeping
File size: 752 Bytes
8aa8f36 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | from typing import Optional, Literal
from pydantic import BaseModel, Field
from datetime import datetime
class AlertCreate(BaseModel):
provider_id: int
credential_id: Optional[int] = None
severity: Literal["info", "warning", "critical"]
window_days: int
message: str
channel: Optional[str] = "ui"
class AlertRead(BaseModel):
id: int
provider_id: int
credential_id: Optional[int] = None
severity: str
window_days: int
message: str
channel: str
created_at: datetime
resolved_at: Optional[datetime] = None
resolution_note: Optional[str] = None
class AlertResolution(BaseModel):
resolution_note: Optional[str] = None
class AlertSummary(BaseModel):
severity_counts: dict[str, int]
|