# Generated by ariadne-codegen
# Source: queries/series-state

from typing import Any, List, Literal, Optional

from pydantic import Field

from .base_model import BaseModel
from .enums import GameType, ParticipationStatus


class SeriesState(BaseModel):
    series_state: Optional["SeriesStateSeriesState"] = Field(alias="seriesState")


class SeriesStateSeriesState(BaseModel):
    version: Any
    id: str
    format: str
    started: bool
    finished: bool
    valid: bool
    updated_at: Any = Field(alias="updatedAt")
    started_at: Optional[Any] = Field(alias="startedAt")
    teams: List["SeriesStateSeriesStateTeams"]
    games: List["SeriesStateSeriesStateGames"]
    title: "SeriesStateSeriesStateTitle"
    duration: Any


class SeriesStateSeriesStateTeams(BaseModel):
    typename__: Literal[
        "SeriesTeamState",
        "SeriesTeamStateCs2",
        "SeriesTeamStateCsgo",
        "SeriesTeamStateDefault",
        "SeriesTeamStateDota",
        "SeriesTeamStatePubg",
        "SeriesTeamStateR6",
        "SeriesTeamStateValorant",
    ] = Field(alias="__typename")
    id: str
    name: str
    score: int
    won: bool


class SeriesStateSeriesStateGames(BaseModel):
    id: str
    sequence_number: int = Field(alias="sequenceNumber")
    type: Optional[GameType]
    started: bool
    finished: bool
    paused: bool
    started_at: Optional[Any] = Field(alias="startedAt")
    teams: List["SeriesStateSeriesStateGamesTeams"]
    external_links: List["SeriesStateSeriesStateGamesExternalLinks"] = Field(
        alias="externalLinks"
    )
    map: "SeriesStateSeriesStateGamesMap"
    title_version: Optional["SeriesStateSeriesStateGamesTitleVersion"] = Field(
        alias="titleVersion"
    )
    clock: Optional["SeriesStateSeriesStateGamesClock"]
    non_player_characters: List["SeriesStateSeriesStateGamesNonPlayerCharacters"] = (
        Field(alias="nonPlayerCharacters")
    )
    structures: List["SeriesStateSeriesStateGamesStructures"]
    duration: Any


class SeriesStateSeriesStateGamesTeams(BaseModel):
    typename__: Literal[
        "GameTeamState",
        "GameTeamStateCs2",
        "GameTeamStateCsgo",
        "GameTeamStateDefault",
        "GameTeamStateDota",
        "GameTeamStateLol",
        "GameTeamStatePubg",
        "GameTeamStateR6",
        "GameTeamStateValorant",
    ] = Field(alias="__typename")
    id: str
    name: str
    side: str
    won: bool
    score: int
    money: int
    loadout_value: int = Field(alias="loadoutValue")
    net_worth: int = Field(alias="netWorth")
    kills: int
    kill_assists_received: int = Field(alias="killAssistsReceived")
    kill_assists_given: int = Field(alias="killAssistsGiven")
    teamkills: int
    teamkill_assists_received: int = Field(alias="teamkillAssistsReceived")
    teamkill_assists_given: int = Field(alias="teamkillAssistsGiven")
    selfkills: int
    deaths: int
    first_kill: bool = Field(alias="firstKill")
    structures_destroyed: int = Field(alias="structuresDestroyed")
    structures_captured: int = Field(alias="structuresCaptured")
    kill_assists_received_from_player: List[
        "SeriesStateSeriesStateGamesTeamsKillAssistsReceivedFromPlayer"
    ] = Field(alias="killAssistsReceivedFromPlayer")
    objectives: List["SeriesStateSeriesStateGamesTeamsObjectives"]
    unit_kills: List["SeriesStateSeriesStateGamesTeamsUnitKills"] = Field(
        alias="unitKills"
    )
    players: List["SeriesStateSeriesStateGamesTeamsPlayers"]
    multikills: List["SeriesStateSeriesStateGamesTeamsMultikills"]


class SeriesStateSeriesStateGamesTeamsKillAssistsReceivedFromPlayer(BaseModel):
    id: str
    player_id: str = Field(alias="playerId")
    kill_assists_received: int = Field(alias="killAssistsReceived")


class SeriesStateSeriesStateGamesTeamsObjectives(BaseModel):
    id: str
    type: str
    completed_first: bool = Field(alias="completedFirst")
    completion_count: int = Field(alias="completionCount")


class SeriesStateSeriesStateGamesTeamsUnitKills(BaseModel):
    id: str
    unit_name: str = Field(alias="unitName")
    count: int


class SeriesStateSeriesStateGamesTeamsPlayers(BaseModel):
    typename__: Literal[
        "GamePlayerState",
        "GamePlayerStateCs2",
        "GamePlayerStateCsgo",
        "GamePlayerStateDefault",
        "GamePlayerStateDota",
        "GamePlayerStateLol",
        "GamePlayerStatePubg",
        "GamePlayerStateR6",
        "GamePlayerStateValorant",
    ] = Field(alias="__typename")
    id: str
    name: str
    participation_status: ParticipationStatus = Field(alias="participationStatus")
    money: int
    loadout_value: int = Field(alias="loadoutValue")
    net_worth: int = Field(alias="netWorth")
    kills: int
    kill_assists_received: int = Field(alias="killAssistsReceived")
    kill_assists_given: int = Field(alias="killAssistsGiven")
    deaths: int
    first_kill: bool = Field(alias="firstKill")
    structures_destroyed: int = Field(alias="structuresDestroyed")


class SeriesStateSeriesStateGamesTeamsMultikills(BaseModel):
    id: str
    number_of_kills: int = Field(alias="numberOfKills")
    count: int


class SeriesStateSeriesStateGamesExternalLinks(BaseModel):
    data_provider: "SeriesStateSeriesStateGamesExternalLinksDataProvider" = Field(
        alias="dataProvider"
    )
    external_entity: "SeriesStateSeriesStateGamesExternalLinksExternalEntity" = Field(
        alias="externalEntity"
    )


class SeriesStateSeriesStateGamesExternalLinksDataProvider(BaseModel):
    name: str


class SeriesStateSeriesStateGamesExternalLinksExternalEntity(BaseModel):
    id: str


class SeriesStateSeriesStateGamesMap(BaseModel):
    id: str
    name: str
    bounds: Optional["SeriesStateSeriesStateGamesMapBounds"]


class SeriesStateSeriesStateGamesMapBounds(BaseModel):
    min: "SeriesStateSeriesStateGamesMapBoundsMin"
    max: "SeriesStateSeriesStateGamesMapBoundsMax"


class SeriesStateSeriesStateGamesMapBoundsMin(BaseModel):
    x: float
    y: float


class SeriesStateSeriesStateGamesMapBoundsMax(BaseModel):
    x: float
    y: float


class SeriesStateSeriesStateGamesTitleVersion(BaseModel):
    name: str


class SeriesStateSeriesStateGamesClock(BaseModel):
    id: Optional[str]
    type: Optional[str]
    ticking: Optional[bool]
    ticks_backwards: Optional[bool] = Field(alias="ticksBackwards")
    current_seconds: Optional[int] = Field(alias="currentSeconds")


class SeriesStateSeriesStateGamesNonPlayerCharacters(BaseModel):
    id: str
    type: str
    side: str
    alive: bool


class SeriesStateSeriesStateGamesStructures(BaseModel):
    id: str
    type: str
    side: str
    team_id: str = Field(alias="teamId")
    current_health: int = Field(alias="currentHealth")
    max_health: int = Field(alias="maxHealth")
    destroyed: bool


class SeriesStateSeriesStateTitle(BaseModel):
    name_shortened: str = Field(alias="nameShortened")


SeriesState.model_rebuild()
SeriesStateSeriesState.model_rebuild()
SeriesStateSeriesStateGames.model_rebuild()
SeriesStateSeriesStateGamesTeams.model_rebuild()
SeriesStateSeriesStateGamesExternalLinks.model_rebuild()
SeriesStateSeriesStateGamesMap.model_rebuild()
SeriesStateSeriesStateGamesMapBounds.model_rebuild()
