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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import (
    DeviceExecutionStateEnum,
    ExecutionStateEnum,
    ExecutionTypeEnum,
    ProviderTypeEnum,
    RunOnEnum,
)


class ExecuteNeopsTask(BaseModel):
    execute_neops_task: Optional["ExecuteNeopsTaskExecuteNeopsTask"] = Field(
        alias="executeNeopsTask"
    )


class ExecuteNeopsTaskExecuteNeopsTask(BaseModel):
    executions: Optional[List[Optional["ExecuteNeopsTaskExecuteNeopsTaskExecutions"]]]


class ExecuteNeopsTaskExecuteNeopsTaskExecutions(BaseModel):
    args: Optional[Any]
    id: str
    task_id: Optional[str] = Field(alias="taskId")
    name: Optional[str]
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")
    state: Optional[ExecutionStateEnum]
    execution_type: Optional[ExecutionTypeEnum] = Field(alias="executionType")
    task_id: Optional[str] = Field(alias="taskId")
    task: Optional[str]
    neops_task: Optional["ExecuteNeopsTaskExecuteNeopsTaskExecutionsNeopsTask"] = Field(
        alias="neopsTask"
    )
    device_execution: Optional[
        List[Optional["ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecution"]]
    ] = Field(alias="deviceExecution")


class ExecuteNeopsTaskExecuteNeopsTaskExecutionsNeopsTask(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]
    provider: Optional["ExecuteNeopsTaskExecuteNeopsTaskExecutionsNeopsTaskProvider"]


class ExecuteNeopsTaskExecuteNeopsTaskExecutionsNeopsTaskProvider(BaseModel):
    provider_type: Optional[ProviderTypeEnum] = Field(alias="providerType")


class ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecution(BaseModel):
    execution: Optional[
        "ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecutionExecution"
    ]
    id: str
    device: Optional["ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecutionDevice"]
    run_on: Optional[RunOnEnum] = Field(alias="runOn")
    execute_on: Optional[List[Optional[int]]] = Field(alias="executeOn")
    state: Optional[DeviceExecutionStateEnum]
    exception: Optional[str]
    do: Optional[str]
    done: Optional[str]
    changed: Optional[bool]
    will_change: Optional[bool] = Field(alias="willChange")
    log: Optional[str]


class ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecutionExecution(BaseModel):
    id: str


class ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecutionDevice(BaseModel):
    id: str
    hostname: Optional[str]
    vendor: Optional[str]
    model: Optional[str]
    platform: Optional[
        "ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecutionDevicePlatform"
    ]
    software_release: Optional[str] = Field(alias="softwareRelease")


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


ExecuteNeopsTask.model_rebuild()
ExecuteNeopsTaskExecuteNeopsTask.model_rebuild()
ExecuteNeopsTaskExecuteNeopsTaskExecutions.model_rebuild()
ExecuteNeopsTaskExecuteNeopsTaskExecutionsNeopsTask.model_rebuild()
ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecution.model_rebuild()
ExecuteNeopsTaskExecuteNeopsTaskExecutionsDeviceExecutionDevice.model_rebuild()
