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

from typing import List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import ExecutionResultStateEnum, RunOnEnum


class DeviceResult(BaseModel):
    device_result: Optional["DeviceResultDeviceResult"] = Field(alias="deviceResult")


class DeviceResultDeviceResult(BaseModel):
    results: Optional[List[Optional["DeviceResultDeviceResultResults"]]]


class DeviceResultDeviceResultResults(BaseModel):
    id: str
    state: Optional[ExecutionResultStateEnum]
    message: Optional[str]
    granularity: Optional[int]
    neops_task: Optional["DeviceResultDeviceResultResultsNeopsTask"] = Field(
        alias="neopsTask"
    )
    device: Optional["DeviceResultDeviceResultResultsDevice"]
    execution: Optional["DeviceResultDeviceResultResultsExecution"]


class DeviceResultDeviceResultResultsNeopsTask(BaseModel):
    id: str
    name: Optional[str]


class DeviceResultDeviceResultResultsDevice(BaseModel):
    id: str
    hostname: Optional[str]


class DeviceResultDeviceResultResultsExecution(BaseModel):
    id: str
    run_on: Optional[RunOnEnum] = Field(alias="runOn")
