2026-04-03 19:04:46 +08:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
2026-04-16 16:11:09 +08:00
|
|
|
from typing import Literal
|
|
|
|
|
|
2026-04-03 19:04:46 +08:00
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PointsBalanceResponse(BaseModel):
|
|
|
|
|
model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True)
|
|
|
|
|
|
|
|
|
|
balance: int = Field(ge=0)
|
|
|
|
|
frozen_balance: int = Field(alias="frozenBalance", ge=0)
|
|
|
|
|
available_balance: int = Field(alias="availableBalance", ge=0)
|
|
|
|
|
run_cost: int = Field(alias="runCost", gt=0)
|
|
|
|
|
can_run: bool = Field(alias="canRun")
|
2026-04-16 16:11:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class PackageInfo(BaseModel):
|
|
|
|
|
model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True)
|
|
|
|
|
|
|
|
|
|
product_code: str = Field(alias="productCode", min_length=1, max_length=128)
|
|
|
|
|
type: Literal["starter", "regular"]
|
|
|
|
|
price: float = Field(ge=0)
|
|
|
|
|
credits: int = Field(ge=1)
|
|
|
|
|
is_starter: bool = Field(alias="isStarter")
|
|
|
|
|
starter_eligible: bool = Field(alias="starterEligible")
|
|
|
|
|
sort_order: int = Field(alias="sortOrder", ge=0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PackagesResponse(BaseModel):
|
|
|
|
|
model_config = ConfigDict(populate_by_name=True, serialize_by_alias=True)
|
|
|
|
|
|
|
|
|
|
region: str = Field(min_length=1, max_length=8)
|
|
|
|
|
currency: str = Field(min_length=1, max_length=8)
|
|
|
|
|
packages: list[PackageInfo]
|