# Generated by ariadne-codegen
# Source: mansrht/git/

from typing import Annotated, Literal, Optional, Union

from pydantic import Field

from .base_model import BaseModel
from .fragments import CommitDetails, RepoDetails


class GetRootTree(BaseModel):
    me: "GetRootTreeMe"


class GetRootTreeMe(BaseModel):
    repository: Optional["GetRootTreeMeRepository"]


class GetRootTreeMeRepository(RepoDetails):
    reference: Optional["GetRootTreeMeRepositoryReference"]


class GetRootTreeMeRepositoryReference(BaseModel):
    commit: Optional[
        Annotated[
            Union[
                "GetRootTreeMeRepositoryReferenceCommitObject",
                "GetRootTreeMeRepositoryReferenceCommitCommit",
            ],
            Field(discriminator="typename__"),
        ]
    ]


class GetRootTreeMeRepositoryReferenceCommitObject(BaseModel):
    typename__: Literal["BinaryBlob", "Object", "Tag", "TextBlob", "Tree"] = Field(
        alias="__typename"
    )


class GetRootTreeMeRepositoryReferenceCommitCommit(CommitDetails):
    typename__: Literal["Commit"] = Field(alias="__typename")


GetRootTree.model_rebuild()
GetRootTreeMe.model_rebuild()
GetRootTreeMeRepository.model_rebuild()
GetRootTreeMeRepositoryReference.model_rebuild()
