# 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 Pipeline(BaseModel):
    pipeline_by_code: Optional["PipelinePipelineByCode"] = Field(alias="pipelineByCode")


class PipelinePipelineByCode(BaseModel):
    id: Any
    code: str
    name: Optional[str]
    description: Optional[str]
    type: PipelineType
    current_version: Optional["PipelinePipelineByCodeCurrentVersion"] = Field(
        alias="currentVersion"
    )
    runs: "PipelinePipelineByCodeRuns"
    webhook_url: Optional[str] = Field(alias="webhookUrl")
    webhook_enabled: bool = Field(alias="webhookEnabled")
    schedule: Optional[str]
    notebook_path: Optional[str] = Field(alias="notebookPath")
    source_template: Optional["PipelinePipelineByCodeSourceTemplate"] = Field(
        alias="sourceTemplate"
    )
    has_new_template_versions: bool = Field(alias="hasNewTemplateVersions")
    new_template_versions: List["PipelinePipelineByCodeNewTemplateVersions"] = Field(
        alias="newTemplateVersions"
    )
    recipients: List["PipelinePipelineByCodeRecipients"]


class PipelinePipelineByCodeCurrentVersion(BaseModel):
    id: Any
    name: Optional[str]
    version_number: int = Field(alias="versionNumber")
    user: Optional["PipelinePipelineByCodeCurrentVersionUser"]
    created_at: Any = Field(alias="createdAt")


class PipelinePipelineByCodeCurrentVersionUser(BaseModel):
    id: Any
    email: str
    display_name: str = Field(alias="displayName")
    avatar: "PipelinePipelineByCodeCurrentVersionUserAvatar"


class PipelinePipelineByCodeCurrentVersionUserAvatar(BaseModel):
    initials: str
    color: str


class PipelinePipelineByCodeRuns(BaseModel):
    items: List["PipelinePipelineByCodeRunsItems"]


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


class PipelinePipelineByCodeRunsItemsUser(BaseModel):
    id: Any
    display_name: str = Field(alias="displayName")
    email: str


class PipelinePipelineByCodeSourceTemplate(BaseModel):
    id: Any
    code: str
    name: str


class PipelinePipelineByCodeNewTemplateVersions(BaseModel):
    id: Any
    changelog: Optional[str]
    version_number: int = Field(alias="versionNumber")
    created_at: Any = Field(alias="createdAt")


class PipelinePipelineByCodeRecipients(BaseModel):
    user: "PipelinePipelineByCodeRecipientsUser"


class PipelinePipelineByCodeRecipientsUser(BaseModel):
    id: Any
    display_name: str = Field(alias="displayName")


Pipeline.model_rebuild()
PipelinePipelineByCode.model_rebuild()
PipelinePipelineByCodeCurrentVersion.model_rebuild()
PipelinePipelineByCodeCurrentVersionUser.model_rebuild()
PipelinePipelineByCodeRuns.model_rebuild()
PipelinePipelineByCodeRunsItems.model_rebuild()
PipelinePipelineByCodeRecipients.model_rebuild()
