# Generated by ariadne-codegen
# Source: exponent/core/graphql/operations

from typing import Any, Literal, Optional, Union

from pydantic import Field

from .base_model import BaseModel


class EnableCloudRepository(BaseModel):
    enable_cloud_repository: Union[
        "EnableCloudRepositoryEnableCloudRepositoryInputValidationError",
        "EnableCloudRepositoryEnableCloudRepositoryNotFoundError",
        "EnableCloudRepositoryEnableCloudRepositoryCloudSessionError",
        "EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResult",
        "EnableCloudRepositoryEnableCloudRepositoryUnauthenticatedError",
    ] = Field(alias="enableCloudRepository", discriminator="typename__")


class EnableCloudRepositoryEnableCloudRepositoryInputValidationError(BaseModel):
    typename__: Literal["InputValidationError"] = Field(alias="__typename")


class EnableCloudRepositoryEnableCloudRepositoryNotFoundError(BaseModel):
    typename__: Literal["NotFoundError"] = Field(alias="__typename")
    resource_type: str = Field(alias="resourceType")
    resource_id: Optional[str] = Field(alias="resourceId")
    message: str


class EnableCloudRepositoryEnableCloudRepositoryCloudSessionError(BaseModel):
    typename__: Literal["CloudSessionError"] = Field(alias="__typename")
    message: str


class EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResult(
    BaseModel
):
    typename__: Literal["EnableCloudRepositoriesResult"] = Field(alias="__typename")
    results: list[
        "EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResultResults"
    ]


class EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResultResults(
    BaseModel
):
    org_name: str = Field(alias="orgName")
    repo_name: str = Field(alias="repoName")
    success: bool
    error_message: Optional[str] = Field(alias="errorMessage")
    images: Optional[
        list[
            "EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResultResultsImages"
        ]
    ]


class EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResultResultsImages(
    BaseModel
):
    build_ref: str = Field(alias="buildRef")
    created_at: Any = Field(alias="createdAt")
    updated_at: Any = Field(alias="updatedAt")


class EnableCloudRepositoryEnableCloudRepositoryUnauthenticatedError(BaseModel):
    typename__: Literal["UnauthenticatedError"] = Field(alias="__typename")
    message: str


EnableCloudRepository.model_rebuild()
EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResult.model_rebuild()
EnableCloudRepositoryEnableCloudRepositoryEnableCloudRepositoriesResultResults.model_rebuild()
