# 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,
    ExecutionResultStateEnum,
    ExecutionStateEnum,
    ExecutionTypeEnum,
    ProviderTypeEnum,
    RunOnEnum,
)


class ProcessOverview(BaseModel):
    process_executions: Optional["ProcessOverviewProcessExecutions"] = Field(
        alias="processExecutions"
    )


class ProcessOverviewProcessExecutions(BaseModel):
    results: Optional[List[Optional["ProcessOverviewProcessExecutionsResults"]]]


class ProcessOverviewProcessExecutionsResults(BaseModel):
    id: str
    name: Optional[str]
    executions: Optional[
        List[Optional["ProcessOverviewProcessExecutionsResultsExecutions"]]
    ]


class ProcessOverviewProcessExecutionsResultsExecutions(BaseModel):
    id: str
    name: Optional[str]
    state: Optional[ExecutionStateEnum]
    execution_type: Optional[ExecutionTypeEnum] = Field(alias="executionType")
    task: Optional[str]
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")
    args: Optional[Any]
    do: Optional[str]
    done: Optional[str]
    log: Optional[str]
    execution_results: Optional[
        List[
            Optional[
                "ProcessOverviewProcessExecutionsResultsExecutionsExecutionResults"
            ]
        ]
    ] = Field(alias="executionResults")
    neops_task: Optional[
        "ProcessOverviewProcessExecutionsResultsExecutionsNeopsTask"
    ] = Field(alias="neopsTask")
    device_execution: Optional[
        List[
            Optional["ProcessOverviewProcessExecutionsResultsExecutionsDeviceExecution"]
        ]
    ] = Field(alias="deviceExecution")


class ProcessOverviewProcessExecutionsResultsExecutionsExecutionResults(BaseModel):
    id: str
    state: Optional[ExecutionResultStateEnum]
    message: Optional[str]


class ProcessOverviewProcessExecutionsResultsExecutionsNeopsTask(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]
    provider: Optional[
        "ProcessOverviewProcessExecutionsResultsExecutionsNeopsTaskProvider"
    ]


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


class ProcessOverviewProcessExecutionsResultsExecutionsDeviceExecution(BaseModel):
    id: str
    state: Optional[DeviceExecutionStateEnum]
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")
    changed: Optional[bool]
    will_change: Optional[bool] = Field(alias="willChange")
    run_on: Optional[RunOnEnum] = Field(alias="runOn")
    execute_on: Optional[List[Optional[int]]] = Field(alias="executeOn")
    device: Optional[
        "ProcessOverviewProcessExecutionsResultsExecutionsDeviceExecutionDevice"
    ]


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


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


ProcessOverview.model_rebuild()
ProcessOverviewProcessExecutions.model_rebuild()
ProcessOverviewProcessExecutionsResults.model_rebuild()
ProcessOverviewProcessExecutionsResultsExecutions.model_rebuild()
ProcessOverviewProcessExecutionsResultsExecutionsNeopsTask.model_rebuild()
ProcessOverviewProcessExecutionsResultsExecutionsDeviceExecution.model_rebuild()
ProcessOverviewProcessExecutionsResultsExecutionsDeviceExecutionDevice.model_rebuild()
