32 lines
710 B
Python
32 lines
710 B
Python
from datetime import datetime
|
|
from typing import Optional
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
class SnapshotBrief(BaseModel):
|
|
"""Snapshot metadata without content — used in list endpoints."""
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: int
|
|
device_id: int
|
|
device_ip: Optional[str] = None
|
|
device_hostname: Optional[str] = None
|
|
sha256: str
|
|
label: Optional[str]
|
|
size: int
|
|
created_at: datetime
|
|
|
|
|
|
class SnapshotDetail(SnapshotBrief):
|
|
"""Snapshot with full content — used when viewing a single snapshot."""
|
|
|
|
content: str
|
|
|
|
|
|
class SnapshotDiffResponse(BaseModel):
|
|
snapshot_a_id: int
|
|
snapshot_b_id: int
|
|
diff: str
|
|
is_identical: bool
|