b5a62ee9a3
- domain: User, Workspace, Project, AssetLibrary, Asset, IngestJob - ports: repository interfaces - application: use cases - adapters: in-memory - API: FastAPI 5 routes - worker: Celery ingest_asset - tests: 4 passing
27 lines
729 B
Python
27 lines
729 B
Python
from pydantic import BaseModel, Field
|
|
|
|
|
|
class CreateAssetRequest(BaseModel):
|
|
workspace_id: str = Field(..., min_length=1)
|
|
project_id: str = Field(..., min_length=1)
|
|
library_id: str = Field(..., min_length=1)
|
|
name: str = Field(..., min_length=1, max_length=100)
|
|
storage_key: str = Field(..., min_length=1, max_length=255)
|
|
mime_type: str = Field(..., min_length=1, max_length=100)
|
|
metadata: dict[str, object] = Field(default_factory=dict)
|
|
|
|
|
|
class AssetResponse(BaseModel):
|
|
id: str
|
|
workspace_id: str
|
|
project_id: str
|
|
library_id: str
|
|
name: str
|
|
storage_key: str
|
|
mime_type: str
|
|
metadata: dict[str, object]
|
|
|
|
|
|
class ListAssetsResponse(BaseModel):
|
|
items: list[AssetResponse]
|