# Generated by ariadne-codegen
# Source: combined.graphql

from datetime import datetime
from typing import Any, List, Optional
from uuid import UUID

from pydantic import Field

from .base_model import BaseModel
from .enums import ModuleInstanceStatus, ModuleInstanceTarget


class ArgumentFull(BaseModel):
    id: UUID
    typeinfo: Any
    value: Optional[Any]
    created_at: datetime
    rejected_at: Optional[datetime]
    source: Optional[UUID]
    tags: Optional[List[str]]


class ModuleFull(BaseModel):
    id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    path: str
    usage: Optional[str]
    ins: List[Any]
    ins_usage: Optional[List[str]]
    outs: List[Any]
    outs_usage: Optional[List[str]]
    description: Optional[str]
    typedesc: str
    tags: Optional[List[str]]
    targets: Optional[List[ModuleInstanceTarget]]
    resource_bounds: Optional["ModuleFullResourceBounds"]


class ModuleFullResourceBounds(BaseModel):
    gpu_min: int
    gpu_max: int
    gpu_hint: int
    gpu_mem_min: Optional[int]
    gpu_mem_max: Optional[int]
    gpu_mem_hint: Optional[int]
    cpu_min: Optional[int]
    cpu_max: Optional[int]
    cpu_hint: Optional[int]
    node_min: int
    node_max: int
    node_hint: int
    mem_min: int
    mem_max: int
    storage_min: int
    storage_max: int


class ModuleInstanceCommon(BaseModel):
    id: UUID
    account_id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    queued_at: Optional[datetime]
    admitted_at: Optional[datetime]
    dispatched_at: Optional[datetime]
    completed_at: Optional[datetime]
    path: str
    status: ModuleInstanceStatus
    target: ModuleInstanceTarget
    tags: Optional[List[str]]


class ModuleInstanceFull(ModuleInstanceCommon):
    ins: List["ModuleInstanceFullIns"]
    outs: List["ModuleInstanceFullOuts"]
    resources: Optional["ModuleInstanceFullResources"]
    progress: Optional["ModuleInstanceFullProgress"]


class ModuleInstanceFullIns(BaseModel):
    id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    rejected_at: Optional[datetime]
    account_id: UUID
    typeinfo: Any
    value: Optional[Any]
    tags: Optional[List[str]]


class ModuleInstanceFullOuts(BaseModel):
    id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    rejected_at: Optional[datetime]
    account_id: UUID
    typeinfo: Any
    value: Optional[Any]
    tags: Optional[List[str]]


class ModuleInstanceFullResources(BaseModel):
    gpus: Optional[int]
    nodes: Optional[int]
    mem: Optional[int]
    storage: Optional[int]
    walltime: Optional[int]


class ModuleInstanceFullProgress(BaseModel):
    n: int
    n_expected: int
    n_max: int
    done: bool


class PageInfoFull(BaseModel):
    has_previous_page: bool = Field(alias="hasPreviousPage")
    has_next_page: bool = Field(alias="hasNextPage")
    start_cursor: Optional[str] = Field(alias="startCursor")
    end_cursor: Optional[str] = Field(alias="endCursor")


class SimpleModuleInstanceCommon(BaseModel):
    id: UUID
    account_id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    queued_at: Optional[datetime]
    admitted_at: Optional[datetime]
    dispatched_at: Optional[datetime]
    completed_at: Optional[datetime]
    path: str
    status: ModuleInstanceStatus
    target: ModuleInstanceTarget
    tags: Optional[List[str]]


class SimpleModuleInstanceFull(SimpleModuleInstanceCommon):
    ins: List["SimpleModuleInstanceFullIns"]
    outs: List["SimpleModuleInstanceFullOuts"]
    resources: Optional["SimpleModuleInstanceFullResources"]
    progress: Optional["SimpleModuleInstanceFullProgress"]


class SimpleModuleInstanceFullIns(BaseModel):
    id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    rejected_at: Optional[datetime]
    account_id: UUID
    typeinfo: Any
    value: Optional[Any]
    tags: Optional[List[str]]


class SimpleModuleInstanceFullOuts(BaseModel):
    id: UUID
    created_at: datetime
    deleted_at: Optional[datetime]
    rejected_at: Optional[datetime]
    account_id: UUID
    typeinfo: Any
    value: Optional[Any]
    tags: Optional[List[str]]


class SimpleModuleInstanceFullResources(BaseModel):
    gpus: Optional[int]
    nodes: Optional[int]
    mem: Optional[int]
    storage: Optional[int]
    walltime: Optional[int]


class SimpleModuleInstanceFullProgress(BaseModel):
    n: int
    n_expected: int
    n_max: int
    done: bool


ArgumentFull.model_rebuild()
ModuleFull.model_rebuild()
ModuleFullResourceBounds.model_rebuild()
ModuleInstanceCommon.model_rebuild()
ModuleInstanceFull.model_rebuild()
ModuleInstanceFullIns.model_rebuild()
ModuleInstanceFullOuts.model_rebuild()
ModuleInstanceFullResources.model_rebuild()
ModuleInstanceFullProgress.model_rebuild()
PageInfoFull.model_rebuild()
SimpleModuleInstanceCommon.model_rebuild()
SimpleModuleInstanceFull.model_rebuild()
SimpleModuleInstanceFullIns.model_rebuild()
SimpleModuleInstanceFullOuts.model_rebuild()
SimpleModuleInstanceFullResources.model_rebuild()
SimpleModuleInstanceFullProgress.model_rebuild()
