# generated by datamodel-codegen:
#   filename:  schema.json
#   timestamp: 2025-10-19T17:24:31+00:00

from __future__ import annotations

from typing import Dict, List, Optional

from pydantic import BaseModel, Field


class MetadataDto(BaseModel):
    """@public"""

    data_version: str = Field(..., description="Match data version.")
    match_id: str = Field(..., description="Match id.")
    participants: List[str] = Field(..., description="A list of participant PUUIDs.")


class CompanionDto(BaseModel):
    """@public"""

    content_id: str = Field(..., alias="content_ID")
    item_id: int = Field(..., alias="item_ID")
    skin_id: int = Field(..., alias="skin_ID")
    species: str


class TraitDto(BaseModel):
    """@public"""

    name: str = Field(..., description="Trait name.")
    num_units: int = Field(..., description="Number of units with this trait.")
    style: Optional[int] = Field(
        None,
        description="Current style for this trait. (0 = No style, 1 = Bronze, 2 = Silver, 3 = Gold, 4 = Chromatic)",
    )
    tier_current: int = Field(..., description="Current active tier for the trait.")
    tier_total: Optional[int] = Field(None, description="Total tiers for the trait.")


class UnitDto(BaseModel):
    """@public"""

    items: Optional[List[int]] = Field(
        None,
        description="A list of the unit's items. Please refer to the Teamfight Tactics documentation for item ids.",
    )
    character_id: str = Field(
        ..., description="This field was introduced in patch 9.22 with data_version 2."
    )
    item_names: Optional[List[str]] = Field(None, alias="itemNames")
    chosen: Optional[str] = Field(
        None,
        description="If a unit is chosen as part of the Fates set mechanic, the chosen trait will be indicated by this field. Otherwise this field is excluded from the response.",
    )
    name: str = Field(..., description="Unit name. This field is often left blank.")
    rarity: int = Field(
        ..., description="Unit rarity. This doesn't equate to the unit cost."
    )
    tier: int = Field(..., description="Unit tier.")


class ParticipantMissionsDto(BaseModel):
    """@public"""

    assists: Optional[int] = Field(None, alias="Assists")
    damage_dealt: Optional[int] = Field(None, alias="DamageDealt")
    damage_dealt_to_objectives: Optional[int] = Field(
        None, alias="DamageDealtToObjectives"
    )
    damage_dealt_to_turrets: Optional[int] = Field(None, alias="DamageDealtToTurrets")
    damage_taken: Optional[int] = Field(None, alias="DamageTaken")
    double_kills: Optional[int] = Field(None, alias="DoubleKills")
    gold_earned: Optional[int] = Field(None, alias="GoldEarned")
    gold_spent: Optional[int] = Field(None, alias="GoldSpent")
    inhibitors_destroyed: Optional[int] = Field(None, alias="InhibitorsDestroyed")
    kills: Optional[int] = Field(None, alias="Kills")
    largest_killing_spree: Optional[int] = Field(None, alias="LargestKillingSpree")
    largest_multi_kill: Optional[int] = Field(None, alias="LargestMultiKill")
    magic_damage_dealt: Optional[int] = Field(None, alias="MagicDamageDealt")
    magic_damage_dealt_to_champions: Optional[int] = Field(
        None, alias="MagicDamageDealtToChampions"
    )
    neutral_minions_killed_team_jungle: Optional[int] = Field(
        None, alias="NeutralMinionsKilledTeamJungle"
    )
    physical_damage_dealt: Optional[int] = Field(None, alias="PhysicalDamageDealt")
    physical_damage_taken: Optional[int] = Field(None, alias="PhysicalDamageTaken")
    player_score0: Optional[int] = Field(None, alias="PlayerScore0")
    player_score1: Optional[int] = Field(None, alias="PlayerScore1")
    player_score2: Optional[int] = Field(None, alias="PlayerScore2")
    player_score3: Optional[int] = Field(None, alias="PlayerScore3")
    player_score4: Optional[int] = Field(None, alias="PlayerScore4")
    player_score5: Optional[int] = Field(None, alias="PlayerScore5")
    player_score6: Optional[int] = Field(None, alias="PlayerScore6")
    player_score9: Optional[int] = Field(None, alias="PlayerScore9")
    player_score10: Optional[int] = Field(None, alias="PlayerScore10")
    player_score11: Optional[int] = Field(None, alias="PlayerScore11")
    quadra_kills: Optional[int] = Field(None, alias="QuadraKills")
    spell1_casts: Optional[int] = Field(None, alias="Spell1Casts")
    spell2_casts: Optional[int] = Field(None, alias="Spell2Casts")
    spell3_casts: Optional[int] = Field(None, alias="Spell3Casts")
    spell4_casts: Optional[int] = Field(None, alias="Spell4Casts")
    summoner_spell1_casts: Optional[int] = Field(None, alias="SummonerSpell1Casts")
    time_cc_others: Optional[int] = Field(None, alias="TimeCCOthers")
    total_minions_killed: Optional[int] = Field(None, alias="TotalMinionsKilled")
    true_damage_dealt_to_champions: Optional[int] = Field(
        None, alias="TrueDamageDealtToChampions"
    )
    unreal_kills: Optional[int] = Field(None, alias="UnrealKills")
    vision_score: Optional[int] = Field(None, alias="VisionScore")
    wards_killed: Optional[int] = Field(None, alias="WardsKilled")
    deaths: Optional[int] = Field(None, alias="Deaths")
    killing_sprees: Optional[int] = Field(None, alias="KillingSprees")
    magic_damage_taken: Optional[int] = Field(None, alias="MagicDamageTaken")
    penta_kills: Optional[int] = Field(None, alias="PentaKills")
    physical_damage_dealt_to_champions: Optional[int] = Field(
        None, alias="PhysicalDamageDealtToChampions"
    )
    total_damage_dealt_to_champions: Optional[int] = Field(
        None, alias="TotalDamageDealtToChampions"
    )
    triple_kills: Optional[int] = Field(None, alias="TripleKills")
    true_damage_dealt: Optional[int] = Field(None, alias="TrueDamageDealt")
    true_damage_taken: Optional[int] = Field(None, alias="TrueDamageTaken")


class ParticipantDto(BaseModel):
    """@public"""

    companion: CompanionDto = Field(..., description="Participant's companion.")
    gold_left: int = Field(
        ..., description="Gold left after participant was eliminated."
    )
    last_round: int = Field(
        ...,
        description="The round the participant was eliminated in. Note: If the player was eliminated in stage 2-1 their last_round would be 5.",
    )
    level: int = Field(
        ...,
        description="Participant Little Legend level. Note: This is not the number of active units.",
    )
    placement: int = Field(..., description="Participant placement upon elimination.")
    players_eliminated: int = Field(
        ..., description="Number of players the participant eliminated."
    )
    puuid: str
    riot_id_game_name: Optional[str] = Field(None, alias="riotIdGameName")
    riot_id_tagline: Optional[str] = Field(None, alias="riotIdTagline")
    time_eliminated: float = Field(
        ..., description="The number of seconds before the participant was eliminated."
    )
    total_damage_to_players: int = Field(
        ..., description="Damage the participant dealt to other players."
    )
    traits: List[TraitDto] = Field(
        ..., description="A complete list of traits for the participant's active units."
    )
    units: List[UnitDto] = Field(
        ..., description="A list of active units for the participant."
    )
    win: Optional[bool] = None
    augments: Optional[List[str]] = None
    partner_group_id: Optional[int] = None
    missions: Optional[ParticipantMissionsDto] = None
    skill_tree: Optional[Dict[str, int]] = None
    pve_score: Optional[int] = None
    pve_wonrun: Optional[bool] = None


class InfoDto(BaseModel):
    """@public"""

    end_of_game_result: Optional[str] = Field(None, alias="endOfGameResult")
    game_creation: Optional[int] = Field(None, alias="gameCreation")
    game_id: Optional[int] = Field(None, alias="gameId")
    game_datetime: int = Field(..., description="Unix timestamp.")
    game_length: float = Field(..., description="Game length in seconds.")
    game_version: str = Field(..., description="Game client version.")
    game_variation: Optional[str] = Field(
        None,
        description="Deprecated. Game variation key. Game variations documented in TFT static data.",
    )
    map_id: Optional[int] = Field(None, alias="mapId")
    participants: List[ParticipantDto]
    queue_id: int = Field(
        ..., description="Please refer to the League of Legends documentation."
    )
    queue_id_1: Optional[int] = Field(
        None,
        alias="queueId",
        description="Please refer to the League of Legends documentation.",
    )
    tft_game_type: Optional[str] = None
    tft_set_core_name: Optional[str] = None
    tft_set_number: int = Field(..., description="Teamfight Tactics set number.")


class MatchDto(BaseModel):
    """@public"""

    metadata: MetadataDto = Field(..., description="Match metadata.")
    info: InfoDto = Field(..., description="Match info.")
