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

# 数据模型
class PriceRequest(BaseModel):
    instance_type: str
    region: str
    operating_system: str
    purchase_option: str
    duration: Optional[int] = 1
    disk_gb: Optional[int] = 0

class PriceComparison(BaseModel):
    configurations: List[PriceRequest]

class InstanceSearchRequest(BaseModel):
    cpu_cores: Optional[int] = None
    memory_gb: Optional[float] = None
    disk_gb: Optional[int] = None
    region: Optional[str] = None
    operating_system: Optional[str] = "Linux"
    platform: Optional[str] = "aws"  # 新增平台字段，默认为AWS

# 第二套价格计算API的数据模型
class InstanceSearchRequestV2(BaseModel):
    cpu_cores: Optional[int] = None
    memory_gb: Optional[float] = None
    disk_gb: Optional[int] = None
    region: Optional[str] = None
    operating_system: Optional[str] = "Linux" 