File size: 822 Bytes
1c1e321
 
8a4825d
1c1e321
 
abb1a7f
 
 
 
 
84efe74
 
 
 
 
 
 
8a4825d
 
 
 
 
 
1234584
8a4825d
 
 
 
1c1e321
abb1a7f
8a4825d
84efe74
1c1e321
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from typing import List, Optional
from pydantic import BaseModel, HttpUrl
from pydantic import validator


class LinkInfo(BaseModel):
    file_name: str
    link: HttpUrl


class Constants(BaseModel):
    duration: Optional[int]
    height: Optional[int]
    width: Optional[int]
    text: Optional[dict]


class Assets(BaseModel):
    type: str
    sequence: List[dict]

    @validator("type")
    def valid_type(cls, v):
        if v not in ["video", "audio", "text", "image", "sfx", "background"]:
            raise ValueError("Invalid asset type")
        return v


class EditorRequest(BaseModel):
    links: Optional[List[LinkInfo]]  # List of LinkInfo objects
    assets: List[Assets]
    constants: Optional[Constants]


class TaskInfo(BaseModel):
    task_id: str
    progress: int
    completed_tasks: List[str]