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

from typing import Any, List, Optional

from pydantic import Field

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


class ExecutionsDetail(BaseModel):
    executions: Optional["ExecutionsDetailExecutions"]


class ExecutionsDetailExecutions(BaseModel):
    total_count: Optional[int] = Field(alias="totalCount")
    results: Optional[List[Optional["ExecutionsDetailExecutionsResults"]]]


class ExecutionsDetailExecutionsResults(BaseModel):
    id: str
    task_id: Optional[str] = Field(alias="taskId")
    name: Optional[str]
    execution_type: Optional[ExecutionTypeEnum] = Field(alias="executionType")
    created_at: Optional[Any] = Field(alias="createdAt")
    updated_at: Optional[Any] = Field(alias="updatedAt")
    state: Optional[ExecutionStateEnum]
    user: Optional["ExecutionsDetailExecutionsResultsUser"]
    process: Optional["ExecutionsDetailExecutionsResultsProcess"]
    neops_task: Optional["ExecutionsDetailExecutionsResultsNeopsTask"] = Field(
        alias="neopsTask"
    )
    execution_results: Optional[
        List[Optional["ExecutionsDetailExecutionsResultsExecutionResults"]]
    ] = Field(alias="executionResults")


class ExecutionsDetailExecutionsResultsUser(BaseModel):
    username: Optional[str]
    last_name: Optional[str] = Field(alias="lastName")
    first_name: Optional[str] = Field(alias="firstName")
    email: Optional[str]
    id: str


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


class ExecutionsDetailExecutionsResultsNeopsTask(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]
    provider: Optional["ExecutionsDetailExecutionsResultsNeopsTaskProvider"]


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


class ExecutionsDetailExecutionsResultsExecutionResults(BaseModel):
    devicegroupexecutionresult: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsDevicegroupexecutionresult"
    ]
    deviceexecutionresult: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsDeviceexecutionresult"
    ]
    clientexecutionresult: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsClientexecutionresult"
    ]
    interfaceexecutionresult: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsInterfaceexecutionresult"
    ]


class ExecutionsDetailExecutionsResultsExecutionResultsDevicegroupexecutionresult(
    BaseModel
):
    group: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsDevicegroupexecutionresultGroup"
    ]
    granularity: Optional[int]
    message: Optional[str]
    state: Optional[ExecutionResultStateEnum]


class ExecutionsDetailExecutionsResultsExecutionResultsDevicegroupexecutionresultGroup(
    BaseModel
):
    name: Optional[str]


class ExecutionsDetailExecutionsResultsExecutionResultsDeviceexecutionresult(BaseModel):
    device: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsDeviceexecutionresultDevice"
    ]
    granularity: Optional[int]
    message: Optional[str]
    state: Optional[ExecutionResultStateEnum]


class ExecutionsDetailExecutionsResultsExecutionResultsDeviceexecutionresultDevice(
    BaseModel
):
    hostname: Optional[str]


class ExecutionsDetailExecutionsResultsExecutionResultsClientexecutionresult(BaseModel):
    client: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsClientexecutionresultClient"
    ]
    granularity: Optional[int]
    message: Optional[str]
    state: Optional[ExecutionResultStateEnum]


class ExecutionsDetailExecutionsResultsExecutionResultsClientexecutionresultClient(
    BaseModel
):
    macaddress: Optional[str]


class ExecutionsDetailExecutionsResultsExecutionResultsInterfaceexecutionresult(
    BaseModel
):
    interface: Optional[
        "ExecutionsDetailExecutionsResultsExecutionResultsInterfaceexecutionresultInterface"
    ]
    granularity: Optional[int]
    message: Optional[str]
    state: Optional[ExecutionResultStateEnum]


class ExecutionsDetailExecutionsResultsExecutionResultsInterfaceexecutionresultInterface(
    BaseModel
):
    name: Optional[str]


ExecutionsDetail.model_rebuild()
ExecutionsDetailExecutions.model_rebuild()
ExecutionsDetailExecutionsResults.model_rebuild()
ExecutionsDetailExecutionsResultsNeopsTask.model_rebuild()
ExecutionsDetailExecutionsResultsExecutionResults.model_rebuild()
ExecutionsDetailExecutionsResultsExecutionResultsDevicegroupexecutionresult.model_rebuild()
ExecutionsDetailExecutionsResultsExecutionResultsDeviceexecutionresult.model_rebuild()
ExecutionsDetailExecutionsResultsExecutionResultsClientexecutionresult.model_rebuild()
ExecutionsDetailExecutionsResultsExecutionResultsInterfaceexecutionresult.model_rebuild()
