# 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 Executions(BaseModel):
    executions: Optional["ExecutionsExecutions"]


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


class ExecutionsExecutionsResults(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["ExecutionsExecutionsResultsUser"]
    process: Optional["ExecutionsExecutionsResultsProcess"]
    neops_task: Optional["ExecutionsExecutionsResultsNeopsTask"] = Field(
        alias="neopsTask"
    )
    execution_results: Optional[
        List[Optional["ExecutionsExecutionsResultsExecutionResults"]]
    ] = Field(alias="executionResults")


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


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


class ExecutionsExecutionsResultsNeopsTask(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]
    provider: Optional["ExecutionsExecutionsResultsNeopsTaskProvider"]


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


class ExecutionsExecutionsResultsExecutionResults(BaseModel):
    devicegroupexecutionresult: Optional[
        "ExecutionsExecutionsResultsExecutionResultsDevicegroupexecutionresult"
    ]
    deviceexecutionresult: Optional[
        "ExecutionsExecutionsResultsExecutionResultsDeviceexecutionresult"
    ]
    clientexecutionresult: Optional[
        "ExecutionsExecutionsResultsExecutionResultsClientexecutionresult"
    ]
    interfaceexecutionresult: Optional[
        "ExecutionsExecutionsResultsExecutionResultsInterfaceexecutionresult"
    ]


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


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


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


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


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


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


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


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