"""Pydantic models for config API."""

from typing import Optional, List, Dict, Any
from pydantic import BaseModel, Field


class SignUrlRequest(BaseModel):
    """Request to sign a URL."""
    url: str


class SystemConfig(BaseModel):
    """System configuration model."""
    default_image_model: Optional[str] = None
    default_video_model: Optional[str] = None
    default_audio_model: Optional[str] = None
    default_llm_model: Optional[str] = None
    default_style: Optional[str] = None
    default_resolution: Optional[str] = None
    default_ratio: Optional[str] = None


class ModelRegistrationRequest(BaseModel):
    """Request to register a new model."""
    model_id: str
    provider: str
    name: str
    type: str
    enabled: bool = True
    config: Dict[str, Any] = Field(default_factory=dict)


class ProviderKeyField(BaseModel):
    """Provider key field configuration."""
    name: str
    label: str
    placeholder: str
    required: bool
    type: Optional[str] = "text"  # 'password' or 'text'


class ProviderConfigResponse(BaseModel):
    """Provider configuration response."""
    id: str
    name: str
    icon: str
    description: str
    fields: List[ProviderKeyField]
    helpUrl: Optional[str] = None
