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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import ExecutionStateEnum, ExecutionTypeEnum, ProviderTypeEnum


class ExecutionsElastic(BaseModel):
    executions_elastic: Optional["ExecutionsElasticExecutionsElastic"] = Field(
        alias="executionsElastic"
    )


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


class ExecutionsElasticExecutionsElasticResults(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")
    user: Optional["ExecutionsElasticExecutionsElasticResultsUser"]
    process: Optional["ExecutionsElasticExecutionsElasticResultsProcess"]
    neops_task: Optional["ExecutionsElasticExecutionsElasticResultsNeopsTask"] = Field(
        alias="neopsTask"
    )
    state: Optional[ExecutionStateEnum]


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


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


class ExecutionsElasticExecutionsElasticResultsNeopsTask(BaseModel):
    id: str
    name: Optional[str]
    description: Optional[str]
    provider: Optional["ExecutionsElasticExecutionsElasticResultsNeopsTaskProvider"]


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


ExecutionsElastic.model_rebuild()
ExecutionsElasticExecutionsElastic.model_rebuild()
ExecutionsElasticExecutionsElasticResults.model_rebuild()
ExecutionsElasticExecutionsElasticResultsNeopsTask.model_rebuild()
