from pydantic import BaseModel
from typing import Optional, List


class BaseResponse(BaseModel):
    success: bool
    message: Optional[str] = None
    data: Optional[dict] = None

class SwitchInfo(BaseModel):
    ip: str
    username: str
    password: str
    model: Optional[str] = None
    description: Optional[str] = None

class ConfigHistory(BaseModel):
    command: str
    config: dict
    timestamp: float
    status: str  # success/failed
    error: Optional[str] = None
class TrafficReport(BaseModel):
    report_type: str
    period: str
    interface_stats: List[dict]
    trend_chart: Optional[str] = None  # base64 encoded image

class TopologyVisualization(BaseModel):
    nodes: List[dict]
    edges: List[dict]
    image: Optional[str] = None  # base64 encoded image

class ConfigValidationResult(BaseModel):
    valid: bool
    errors: List[str]
    has_security_risks: bool
    warnings: Optional[List[str]] = None

__all__ = ["BaseResponse", "SwitchInfo", "ConfigHistory"]
