# 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 CreateProject(BaseModel):
    create_project: "CreateProjectCreateProject" = Field(alias="createProject")


class CreateProjectCreateProject(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["CreateProjectCreateProjectOwner"]
    collaborators: list["CreateProjectCreateProjectCollaborators"]
    invitations: list["CreateProjectCreateProjectInvitations"]
    region: "CreateProjectCreateProjectRegion"
    pull_request: Optional[str] = Field(alias="pullRequest")
    groups: list["CreateProjectCreateProjectGroups"]
    environments: list["CreateProjectCreateProjectEnvironments"]
    services: list["CreateProjectCreateProjectServices"]


class CreateProjectCreateProjectOwner(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 CreateProjectCreateProjectCollaborators(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 CreateProjectCreateProjectInvitations(BaseModel):
    id: Any = Field(alias="_id")
    inviter: "CreateProjectCreateProjectInvitationsInviter"
    invitee: Optional["CreateProjectCreateProjectInvitationsInvitee"]
    email: str
    project: "CreateProjectCreateProjectInvitationsProject"
    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 CreateProjectCreateProjectInvitationsInviter(BaseModel):
    id: Any = Field(alias="_id")


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


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


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


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


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


class CreateProjectCreateProjectServices(BaseModel):
    id: Any = Field(alias="_id")
    name: str
    template: ServiceTemplate
    project: "CreateProjectCreateProjectServicesProject"
    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["CreateProjectCreateProjectServicesSpec"]
    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["CreateProjectCreateProjectServicesDeployments"]
    domains: list["CreateProjectCreateProjectServicesDomains"]


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


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


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


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


CreateProject.model_rebuild()
CreateProjectCreateProject.model_rebuild()
CreateProjectCreateProjectInvitations.model_rebuild()
CreateProjectCreateProjectServices.model_rebuild()
