18 lines
399 B
Python
18 lines
399 B
Python
"""Alert schemas."""
|
|||
|
|
from pydantic import BaseModel, Field
|
||
|
|
from typing import Optional
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
|
||
|
|
class AlertResponse(BaseModel):
|
||
|
|
id: int
|
||
|
|
alert_type: str
|
||
|
|
severity: str
|
||
|
|
message: str
|
||
|
|
project_id: Optional[int] = None
|
||
|
|
worker_id: Optional[int] = None
|
||
|
|
is_read: bool
|
||
|
|
tenant_id: int
|
||
|
|
created_at: datetime
|
||
|
|
|
||
|
|
model_config = {"from_attributes": True}
|