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

from typing import Annotated, Literal, Optional, Union

from pydantic import Field

from .base_model import BaseModel


class GetTicketComments(BaseModel):
    user: Optional["GetTicketCommentsUser"]


class GetTicketCommentsUser(BaseModel):
    tracker: Optional["GetTicketCommentsUserTracker"]


class GetTicketCommentsUserTracker(BaseModel):
    id: int
    rid: str
    ticket: Optional["GetTicketCommentsUserTrackerTicket"]


class GetTicketCommentsUserTrackerTicket(BaseModel):
    id: int
    events: "GetTicketCommentsUserTrackerTicketEvents"


class GetTicketCommentsUserTrackerTicketEvents(BaseModel):
    results: list["GetTicketCommentsUserTrackerTicketEventsResults"]


class GetTicketCommentsUserTrackerTicketEventsResults(BaseModel):
    changes: list[
        Annotated[
            Union[
                "GetTicketCommentsUserTrackerTicketEventsResultsChangesEventDetail",
                "GetTicketCommentsUserTrackerTicketEventsResultsChangesComment",
            ],
            Field(discriminator="typename__"),
        ]
    ]


class GetTicketCommentsUserTrackerTicketEventsResultsChangesEventDetail(BaseModel):
    typename__: Literal[
        "Assignment",
        "Created",
        "EventDetail",
        "LabelUpdate",
        "StatusChange",
        "TicketMention",
        "UserMention",
    ] = Field(alias="__typename")


class GetTicketCommentsUserTrackerTicketEventsResultsChangesComment(BaseModel):
    typename__: Literal["Comment"] = Field(alias="__typename")
    text: str


GetTicketComments.model_rebuild()
GetTicketCommentsUser.model_rebuild()
GetTicketCommentsUserTracker.model_rebuild()
GetTicketCommentsUserTrackerTicket.model_rebuild()
GetTicketCommentsUserTrackerTicketEvents.model_rebuild()
GetTicketCommentsUserTrackerTicketEventsResults.model_rebuild()
