# Generated by ariadne-codegen
# Source: hubsrht/services/hg/

from datetime import datetime
from typing import Annotated, Any, Literal, Optional

from pydantic import BeforeValidator, Field
from srht.graphql import gql_time

from .base_model import BaseModel


class GetRepos(BaseModel):
    me: "GetReposMe"


class GetReposMe(BaseModel):
    repositories: "GetReposMeRepositories"


class GetReposMeRepositories(BaseModel):
    results: list[Optional["GetReposMeRepositoriesResults"]]
    cursor: Optional[Any]


class GetReposMeRepositoriesResults(BaseModel):
    id: int
    rid: str
    name: str
    updated: Annotated[datetime, BeforeValidator(gql_time)]
    owner: "GetReposMeRepositoriesResultsOwner"


class GetReposMeRepositoriesResultsOwner(BaseModel):
    typename__: Literal["Entity", "User"] = Field(alias="__typename")
    canonical_name: str = Field(alias="canonicalName")


GetRepos.model_rebuild()
GetReposMe.model_rebuild()
GetReposMeRepositories.model_rebuild()
GetReposMeRepositoriesResults.model_rebuild()
