mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
25 lines
673 B
Python
25 lines
673 B
Python
from __future__ import annotations
|
|
from dataclasses import dataclass
|
|
from typing import Any, Dict, Optional
|
|
|
|
|
|
@dataclass
|
|
class EvidenceFileData:
|
|
file_id: str
|
|
file_name: str
|
|
created_utc: str
|
|
file_size: int
|
|
file_extension: str
|
|
|
|
evidence_category: Optional[str] = None
|
|
|
|
@classmethod
|
|
def from_api(cls, data: Dict[str, Any]) -> EvidenceFileData:
|
|
return cls(
|
|
file_id=data["fileId"],
|
|
file_name=data["fileName"],
|
|
created_utc=data["createdUtc"],
|
|
file_size=data["fileSize"],
|
|
file_extension=data["fileExtension"],
|
|
evidence_category=data.get("evidenceCategory"),
|
|
)
|