from typing import Optional

from pydantic import BaseModel

from fastapi import UploadFile, File

# Shared properties
class VideoBase(BaseModel):
    title: Optional[str] = None

# Properties to receive on item upload
class VideoUpload(VideoBase):
    title: str
    zip_file: UploadFile=File()

# Properties to receive on item creation
class VideoCreate(VideoBase):
    title: str

# Properties to receive on item update
class VideoUpdate(VideoBase):
    pass

# Properties shared by models stored in DB
class VideoInDBBase(VideoBase):
    id: int
    title: str
    progress: str
    owner_id: int

    class Config:
        orm_mode = True


# Properties to return to client
class Video(VideoInDBBase):
    pass


# Properties properties stored in DB
class VideoInDB(VideoInDBBase):
    pass
