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

from typing import Any, List, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import PipelineRunStatus, PipelineType


class Pipelines(BaseModel):
    pipelines: "PipelinesPipelines"


class PipelinesPipelines(BaseModel):
    total_pages: int = Field(alias="totalPages")
    items: List["PipelinesPipelinesItems"]


class PipelinesPipelinesItems(BaseModel):
    id: Any
    code: str
    name: Optional[str]
    type: PipelineType
    current_version: Optional["PipelinesPipelinesItemsCurrentVersion"] = Field(
        alias="currentVersion"
    )
    last_runs: "PipelinesPipelinesItemsLastRuns" = Field(alias="lastRuns")


class PipelinesPipelinesItemsCurrentVersion(BaseModel):
    id: Any
    name: Optional[str]
    version_number: int = Field(alias="versionNumber")


class PipelinesPipelinesItemsLastRuns(BaseModel):
    items: List["PipelinesPipelinesItemsLastRunsItems"]


class PipelinesPipelinesItemsLastRunsItems(BaseModel):
    id: Any
    status: PipelineRunStatus
    execution_date: Optional[Any] = Field(alias="executionDate")


Pipelines.model_rebuild()
PipelinesPipelines.model_rebuild()
PipelinesPipelinesItems.model_rebuild()
PipelinesPipelinesItemsLastRuns.model_rebuild()
