# Generated by ariadne-codegen
# Source: operations/

from typing import Any, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import VMStatus


class RentServer(BaseModel):
    rent_server: "RentServerRentServer" = Field(alias="rentServer")


class RentServerRentServer(BaseModel):
    id: Any = Field(alias="_id")
    name: str
    ip: str
    owner: "RentServerRentServerOwner"
    ssh_port: int = Field(alias="sshPort")
    ssh_username: Optional[str] = Field(alias="sshUsername")
    status: "RentServerRentServerStatus"
    created_at: Any = Field(alias="createdAt")
    provider_info: Optional["RentServerRentServerProviderInfo"] = Field(
        alias="providerInfo"
    )
    country: Optional[str]
    city: Optional[str]
    continent: Optional[str]
    events: list["RentServerRentServerEvents"]
    gpu_info: Optional["RentServerRentServerGpuInfo"] = Field(alias="gpuInfo")
    zeaburlet_status: "RentServerRentServerZeaburletStatus" = Field(
        alias="zeaburletStatus"
    )
    is_managed: bool = Field(alias="isManaged")
    is_auto_renew_disabled: Optional[bool] = Field(alias="isAutoRenewDisabled")
    expires_at: Optional[Any] = Field(alias="expiresAt")
    price: Optional[int]


class RentServerRentServerOwner(BaseModel):
    id: Any = Field(alias="_id")
    name: str
    email: str
    language: str
    github_id: Optional[int] = Field(alias="githubID")
    discord_id: Optional[str] = Field(alias="discordID")
    avatar_url: str = Field(alias="avatarURL")
    created_at: Any = Field(alias="createdAt")
    email_preference: Any = Field(alias="emailPreference")
    referral_code: str = Field(alias="referralCode")
    username: str
    referral_reward_redeemed: bool = Field(alias="referralRewardRedeemed")
    passed_china_identity_verification: bool = Field(
        alias="passedChinaIdentityVerification"
    )
    phone: Optional[str]


class RentServerRentServerStatus(BaseModel):
    is_online: bool = Field(alias="isOnline")
    total_cpu: int = Field(alias="totalCPU")
    used_cpu: int = Field(alias="usedCPU")
    total_memory: int = Field(alias="totalMemory")
    used_memory: int = Field(alias="usedMemory")
    warnings: list[str]
    vm_status: VMStatus = Field(alias="vmStatus")


class RentServerRentServerProviderInfo(BaseModel):
    code: str
    name: str
    icon: str
    homepage: str
    console: str
    can_refund: bool = Field(alias="canRefund")


class RentServerRentServerEvents(BaseModel):
    message: str
    time: Any
    severity: str


class RentServerRentServerGpuInfo(BaseModel):
    has_gpu: bool = Field(alias="hasGPU")
    is_ready: bool = Field(alias="isReady")
    name: str


class RentServerRentServerZeaburletStatus(BaseModel):
    last_updated_at: Any = Field(alias="lastUpdatedAt")


RentServer.model_rebuild()
RentServerRentServer.model_rebuild()
