from typing import List, Optional
from pydantic import BaseModel

class BatchConfigRequest(BaseModel):
    config: dict
    switch_ips: List[str]
    username: Optional[str] = None
    password: Optional[str] = None
    timeout: Optional[int] = None

class ConfigRequest(BaseModel):
    config: dict
    switch_ip: str
    username: Optional[str] = None
    password: Optional[str] = None
    timeout: Optional[int] = None
    vendor: str = "huawei"

class CLICommandRequest(BaseModel):
    switch_ip: str
    commands: List[str]
    username: Optional[str] = None
    password: Optional[str] = None

    def extract_credentials(self):
        return self.username or "NONE", self.password or "NONE"
