2023-07-19 21:47:47 +09:00
|
|
|
from typing import Any
|
|
|
|
|
2023-05-01 20:00:32 +09:00
|
|
|
from pydantic.dataclasses import dataclass
|
|
|
|
|
|
|
|
from mdrsclient.models.utils import iso8601_to_user_friendly
|
|
|
|
|
|
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
|
|
class File:
|
|
|
|
id: str
|
|
|
|
name: str
|
|
|
|
type: str
|
|
|
|
size: int
|
|
|
|
thumbnail: str | None
|
|
|
|
description: str
|
2023-07-19 21:47:47 +09:00
|
|
|
metadata: dict[str, Any]
|
2023-05-01 20:00:32 +09:00
|
|
|
download_url: str
|
|
|
|
created_at: str
|
|
|
|
updated_at: str
|
|
|
|
|
|
|
|
@property
|
|
|
|
def created_at_name(self) -> str:
|
|
|
|
return iso8601_to_user_friendly(self.created_at)
|
|
|
|
|
|
|
|
@property
|
|
|
|
def updated_at_name(self) -> str:
|
|
|
|
return iso8601_to_user_friendly(self.updated_at)
|