Rectifier / App /Editor /Schema.py
Mbonea's picture
dynamic assests and cutscences -- not tested
8a4825d
raw
history blame
639 Bytes
from typing import List, Optional
from pydantic import BaseModel, HttpUrl
from pydantic import validator
class LinkInfo(BaseModel):
file_name: str
link: HttpUrl
class Assets(BaseModel):
type: str
sequence: List[dict]
@validator("type")
def valid_type(cls, v):
if v not in ["video", "audio", "text"]:
raise ValueError("Invalid asset type")
return v
class EditorRequest(BaseModel):
links: Optional[List[LinkInfo]] # List of LinkInfo objects
assets: List[Assets]
script: str
class TaskInfo(BaseModel):
task_id: str
progress: int
completed_tasks: List[str]