# Generated by ariadne-codegen
# Source: operations/

from typing import Any, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import ServiceStatus, ServiceTemplate


class Project(BaseModel):
    project: "ProjectProject"


class ProjectProject(BaseModel):
    id: Any = Field(alias="_id")
    name: str
    description: Optional[str]
    icon_url: Optional[str] = Field(alias="iconURL")
    created_at: Any = Field(alias="createdAt")
    owner: Optional["ProjectProjectOwner"]
    collaborators: list["ProjectProjectCollaborators"]
    invitations: list["ProjectProjectInvitations"]
    region: "ProjectProjectRegion"
    pull_request: Optional[str] = Field(alias="pullRequest")
    groups: list["ProjectProjectGroups"]
    environments: list["ProjectProjectEnvironments"]
    services: list["ProjectProjectServices"]


class ProjectProjectOwner(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 ProjectProjectCollaborators(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 ProjectProjectInvitations(BaseModel):
    id: Any = Field(alias="_id")
    inviter: "ProjectProjectInvitationsInviter"
    invitee: Optional["ProjectProjectInvitationsInvitee"]
    email: str
    project: "ProjectProjectInvitationsProject"
    invited_at: Any = Field(alias="invitedAt")
    accepted_at: Optional[Any] = Field(alias="acceptedAt")
    cancelled_at: Optional[Any] = Field(alias="cancelledAt")
    leaved_at: Optional[Any] = Field(alias="leavedAt")


class ProjectProjectInvitationsInviter(BaseModel):
    id: Any = Field(alias="_id")


class ProjectProjectInvitationsInvitee(BaseModel):
    id: Any = Field(alias="_id")


class ProjectProjectInvitationsProject(BaseModel):
    id: Any = Field(alias="_id")


class ProjectProjectRegion(BaseModel):
    id: str
    code: str
    name: str
    description: str
    available: bool
    coordinates: list[float]
    continent: str
    country: str
    city: str


class ProjectProjectGroups(BaseModel):
    name: Optional[str]
    service_i_ds: list[Any] = Field(alias="serviceIDs")


class ProjectProjectEnvironments(BaseModel):
    id: Any = Field(alias="_id")
    name: str
    project_id: Any = Field(alias="projectID")
    created_at: Any = Field(alias="createdAt")


class ProjectProjectServices(BaseModel):
    id: Any = Field(alias="_id")
    name: str
    template: ServiceTemplate
    project: "ProjectProjectServicesProject"
    watch_paths: list[str] = Field(alias="watchPaths")
    root_directory: str = Field(alias="rootDirectory")
    custom_build_command: Optional[str] = Field(alias="customBuildCommand")
    custom_start_command: Optional[str] = Field(alias="customStartCommand")
    output_dir: Optional[str] = Field(alias="outputDir")
    created_at: Any = Field(alias="createdAt")
    market_item_code: Optional[str] = Field(alias="marketItemCode")
    spec: Optional["ProjectProjectServicesSpec"]
    status: ServiceStatus
    dns_name: str = Field(alias="dnsName")
    port_forwarded_host: str = Field(alias="portForwardedHost")
    suspended_at: Optional[Any] = Field(alias="suspendedAt")
    once_product: Optional[str] = Field(alias="onceProduct")
    failure_threshold: int = Field(alias="failureThreshold")
    deployments: list["ProjectProjectServicesDeployments"]
    domains: list["ProjectProjectServicesDomains"]


class ProjectProjectServicesProject(BaseModel):
    id: Any = Field(alias="_id")


class ProjectProjectServicesSpec(BaseModel):
    id: Optional[str]


class ProjectProjectServicesDeployments(BaseModel):
    id: Any = Field(alias="_id")


class ProjectProjectServicesDomains(BaseModel):
    id: Any = Field(alias="_id")


Project.model_rebuild()
ProjectProject.model_rebuild()
ProjectProjectInvitations.model_rebuild()
ProjectProjectServices.model_rebuild()
