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

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

from pydantic import Field

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


class ArgumentInput(BaseModel):
    id: Optional[UUID] = None
    value: Optional[Any] = None
    tags: Optional[List[str]] = None


class ModuleInput(BaseModel):
    path: str
    tags: Optional[List[str]] = None
    tests: List["TestCase"]


class ModuleInstanceInput(BaseModel):
    path: str
    args: List["ArgumentInput"]
    target: Optional[ModuleInstanceTarget] = None
    resources: Optional["ModuleInstanceResourcesInput"] = None
    tags: Optional[List[str]] = None
    out_tags: Optional[List[Optional[List[str]]]] = None
    end: Optional[bool] = None


class ModuleInstanceResourcesInput(BaseModel):
    gpus: Optional[int] = None
    gpu_mem: Optional[int] = None
    gpu_mem_units: Optional[MemUnits] = None
    cpus: Optional[int] = None
    nodes: Optional[int] = None
    mem: Optional[int] = None
    mem_units: Optional[MemUnits] = None
    storage: Optional[int] = None
    storage_units: Optional[MemUnits] = None
    walltime: Optional[int] = None
    storage_mounts: Optional[List[str]] = None


class ResourceUtilizationInput(BaseModel):
    module_instance_id: UUID = Field(alias="moduleInstanceId")
    gpu: Optional[float] = None
    mem: Optional[float] = None
    storage: float
    walltime: float
    cputime: float
    inodes: float
    sus: Optional[int] = None


class TestCase(BaseModel):
    args: List["ArgumentInput"]
    target: ModuleInstanceTarget
    resources: Optional["ModuleInstanceResourcesInput"] = None
    tags: Optional[List[str]] = None


class UpdateModuleInstanceInput(BaseModel):
    id: UUID
    path: Optional[str] = None
    ins: Optional[List["ArgumentInput"]] = None
    outs: Optional[List["ArgumentInput"]] = None
    target: Optional[ModuleInstanceTarget] = None
    status: Optional[ModuleInstanceStatus] = None
    resources: Optional["ModuleInstanceResourcesInput"] = None
    tags: Optional[List[str]] = None


ArgumentInput.model_rebuild()
ModuleInput.model_rebuild()
ModuleInstanceInput.model_rebuild()
ModuleInstanceResourcesInput.model_rebuild()
ResourceUtilizationInput.model_rebuild()
TestCase.model_rebuild()
UpdateModuleInstanceInput.model_rebuild()
