# Generated by ariadne-codegen
# Source: operations/

from typing import Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import ServiceSpecGitSource, ServiceSpecHealthCheckType, ServiceSpecPortType


class PrebuiltMarketplaceItems(BaseModel):
    prebuilt_marketplace_items: list[
        "PrebuiltMarketplaceItemsPrebuiltMarketplaceItems"
    ] = Field(alias="prebuiltMarketplaceItems")


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItems(BaseModel):
    id: Optional[str]
    name: str
    icon: Optional[str]
    source: "PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsSource"
    ports: Optional[list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsPorts"]]
    volumes: Optional[list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsVolumes"]]
    instructions: Optional[
        list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInstructions"]
    ]
    env: Optional[list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsEnv"]]
    init_rules: Optional[
        list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInitRules"]
    ] = Field(alias="initRules")
    configs: Optional[list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsConfigs"]]
    gpu: Optional["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsGpu"]
    health_check: Optional[
        "PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsHealthCheck"
    ] = Field(alias="healthCheck")
    port_forwarding: Optional[
        "PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsPortForwarding"
    ] = Field(alias="portForwarding")


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsSource(BaseModel):
    image: Optional[str]
    username: Optional[str]
    password: Optional[str]
    source: Optional[ServiceSpecGitSource]
    repo_id: Optional[int] = Field(alias="repoID")
    upload_id: Optional[str] = Field(alias="uploadID")
    branch: Optional[str]
    submodule_name: Optional[str] = Field(alias="submoduleName")
    watch_paths: Optional[list[str]] = Field(alias="watchPaths")
    root_directory: Optional[str] = Field(alias="rootDirectory")
    dockerfile: Optional[str]
    command: Optional[list[str]]
    args: Optional[list[str]]
    run_as_user_id: Optional[int] = Field(alias="runAsUserID")


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsPorts(BaseModel):
    id: str
    port: int
    type: ServiceSpecPortType


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsVolumes(BaseModel):
    id: str
    dir: str


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInstructions(BaseModel):
    title: str
    content: str


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsEnv(BaseModel):
    key: str
    default: Optional[str]
    expose: Optional[bool]


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInitRules(BaseModel):
    id: str
    image: Optional[str]
    command: Optional[list[str]]
    volumes: Optional[
        list["PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInitRulesVolumes"]
    ]


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInitRulesVolumes(BaseModel):
    id: str


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsConfigs(BaseModel):
    path: str
    template: str
    permission: Optional[int]
    envsubst: Optional[bool]


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsGpu(BaseModel):
    enabled: bool


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsHealthCheck(BaseModel):
    type: ServiceSpecHealthCheckType
    port: str


class PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsPortForwarding(BaseModel):
    enabled: bool


PrebuiltMarketplaceItems.model_rebuild()
PrebuiltMarketplaceItemsPrebuiltMarketplaceItems.model_rebuild()
PrebuiltMarketplaceItemsPrebuiltMarketplaceItemsInitRules.model_rebuild()
