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

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 GetLists(BaseModel):
    me: "GetListsMe"


class GetListsMe(BaseModel):
    lists: "GetListsMeLists"


class GetListsMeLists(BaseModel):
    results: list["GetListsMeListsResults"]
    cursor: Optional[Any]


class GetListsMeListsResults(BaseModel):
    id: int
    rid: str
    name: str
    description: Optional[str]
    updated: Annotated[datetime, BeforeValidator(gql_time)]
    owner: "GetListsMeListsResultsOwner"


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


GetLists.model_rebuild()
GetListsMe.model_rebuild()
GetListsMeLists.model_rebuild()
GetListsMeListsResults.model_rebuild()
