from datetime import datetime from typing import List from uuid import UUID from pydantic import BaseModel class ChannelURLCreate(BaseModel): """Pydantic model for creating channel URLs""" url: str class ChannelURLBase(ChannelURLCreate): """Base Pydantic model for channel URL responses""" id: UUID created_at: datetime updated_at: datetime class Config: from_attributes = True class ChannelURLResponse(ChannelURLBase): """Pydantic model for channel URL responses""" pass class ChannelCreate(BaseModel): """Pydantic model for creating channels""" urls: List[str] # List of URLs to create with the channel name: str group_title: str tvg_id: str tvg_logo: str tvg_name: str class ChannelUpdate(BaseModel): """Pydantic model for updating channels""" name: str | None = None group_title: str | None = None tvg_id: str | None = None tvg_logo: str | None = None tvg_name: str | None = None class ChannelResponse(BaseModel): """Pydantic model for channel responses""" id: UUID name: str group_title: str tvg_id: str tvg_logo: str tvg_name: str urls: List[ChannelURLResponse] # List of URL objects without channel_id created_at: datetime updated_at: datetime class Config: from_attributes = True