Skip to content

Update MatchTimeline type to v5 definition #75

@2ajoyce

Description

@2ajoyce

This is the v5 type definition I'm testing locally for the response from the GET /lol/match/v5/matches/{matchId}/timeline endpoint.

Many of the objects in the riot docs end in Dto. I have removed that suffix from these types.

type MatchTimeline struct {
	Metadata MetadataTimeline `json:"metadata"`
	Info     InfoTimeline     `json:"info"`
}

type MetadataTimeline struct {
	DataVersion  string   `json:"dataVersion"`
	MatchID      string   `json:"matchId"`
	Participants []string `json:"participants"`
}

type InfoTimeline struct {
	EndOfGameResult string                `json:"endOfGameResult"`
	FrameInterval   int64                 `json:"frameInterval"`
	GameID          int64                 `json:"gameId"`
	Participants    []ParticipantTimeline `json:"participants"`
	Frames          []FramesTimeline      `json:"frames"`
}

type ParticipantTimeline struct {
	ParticipantID int    `json:"participantId"`
	PUUID         string `json:"puuid"`
}

type FramesTimeline struct {
	Timestamp         int                         `json:"timestamp"`
	Events            []EventsTimeline            `json:"events"`
	ParticipantFrames map[string]ParticipantFrame `json:"participantFrames"`
}

type EventsTimeline struct {
	Timestamp               int64          `json:"timestamp"`
	Type                    string         `json:"type"`
	RealTimestamp           *int64          `json:"realTimestamp,omitempty"`
	ActualStartTime         *int64         `json:"actualStartTime,omitempty"`
	AfterID                 *int           `json:"afterId,omitempty"`
	AssistingParticipantIds []int          `json:"assistingParticipantIds,omitempty"`
	BeforeID                *int           `json:"beforeId,omitempty"`
	Bounty                  *int           `json:"bounty,omitempty"`
	BuildingType            *string        `json:"buildingType,omitempty"`
	CreatorID               *int           `json:"creatorId,omitempty"`
	FeatType                *int           `json:"featType,omitempty"`
	FeatValue               *int           `json:"featValue,omitempty"`
	GameID                  *int64         `json:"gameId,omitempty"`
	GoldGain                *int           `json:"goldGain,omitempty"`
	ItemID                  *int           `json:"itemId,omitempty"`
	KillerID                *int           `json:"killerId,omitempty"`
	KillerTeamID            *int           `json:"killerTeamId,omitempty"`
	KillStreakLength        *int           `json:"killStreakLength,omitempty"`
	KillType                *string        `json:"killType,omitempty"`
	LaneType                *string        `json:"laneType,omitempty"`
	Level                   *int           `json:"level,omitempty"`
	LevelUpType             *string        `json:"levelUpType,omitempty"`
	MonsterSubType          *string        `json:"monsterSubType,omitempty"`
	MonsterType             *string        `json:"monsterType,omitempty"`
	MultiKillLength         *int           `json:"multiKillLength,omitempty"`
	Name                    *string        `json:"name,omitempty"`
	ParticipantID           *int           `json:"participantId,omitempty"`
	Position                *EventPosition `json:"position,omitempty"`
	ShutdownBounty          *int           `json:"shutdownBounty,omitempty"`
	SkillSlot               *int           `json:"skillSlot,omitempty"`
	TeamID                  *int           `json:"teamId,omitempty"`
	TowerType               *string        `json:"towerType,omitempty"`
	TransformType           *string        `json:"transformType,omitempty"`
	VictimDamageDealt       []VictimDamage `json:"victimDamageDealt,omitempty"`
	VictimDamageReceived    []VictimDamage `json:"victimDamageReceived,omitempty"`
	VictimID                *int           `json:"victimId,omitempty"`
	WardType                *string        `json:"wardType,omitempty"`
	WinningTeam             *int           `json:"winningTeam,omitempty"`
}

type EventPosition struct {
	X int `json:"x"`
	Y int `json:"y"`
}

type VictimDamage struct {
	Basic          *bool   `json:"basic,omitempty"`
	MagicDamage    *int    `json:"magicDamage,omitempty"`
	Name           *string `json:"name,omitempty"`
	ParticipantID  *int    `json:"participantId,omitempty"`
	PhysicalDamage *int    `json:"physicalDamage,omitempty"`
	SpellName      *string `json:"spellName,omitempty"`
	SpellSlot      *int    `json:"spellSlot,omitempty"`
	TrueDamage     *int    `json:"trueDamage,omitempty"`
	Type           *string `json:"type,omitempty"`
}

type ParticipantFrame struct {
	ChampionStats            ChampionStats `json:"championStats"`
	CurrentGold              int           `json:"currentGold"`
	DamageStats              DamageStats   `json:"damageStats"`
	GoldPerSecond            int           `json:"goldPerSecond"`
	JungleMinionsKilled      int           `json:"jungleMinionsKilled"`
	Level                    int           `json:"level"`
	MinionsKilled            int           `json:"minionsKilled"`
	ParticipantID            int           `json:"participantId"`
	Position                 Position      `json:"position"`
	TimeEnemySpentControlled int           `json:"timeEnemySpentControlled"`
	TotalGold                int           `json:"totalGold"`
	XP                       int           `json:"xp"`
}

type ChampionStats struct {
	AbilityHaste         int `json:"abilityHaste"`
	AbilityPower         int `json:"abilityPower"`
	Armor                int `json:"armor"`
	ArmorPen             int `json:"armorPen"`
	ArmorPenPercent      int `json:"armorPenPercent"`
	AttackDamage         int `json:"attackDamage"`
	AttackSpeed          int `json:"attackSpeed"`
	BonusArmorPenPercent int `json:"bonusArmorPenPercent"`
	BonusMagicPenPercent int `json:"bonusMagicPenPercent"`
	CCReduction          int `json:"ccReduction"`
	CooldownReduction    int `json:"cooldownReduction"`
	Health               int `json:"health"`
	HealthMax            int `json:"healthMax"`
	HealthRegen          int `json:"healthRegen"`
	Lifesteal            int `json:"lifesteal"`
	MagicPen             int `json:"magicPen"`
	MagicPenPercent      int `json:"magicPenPercent"`
	MagicResist          int `json:"magicResist"`
	MovementSpeed        int `json:"movementSpeed"`
	Omnivamp             int `json:"omnivamp"`
	PhysicalVamp         int `json:"physicalVamp"`
	Power                int `json:"power"`
	PowerMax             int `json:"powerMax"`
	PowerRegen           int `json:"powerRegen"`
	SpellVamp            int `json:"spellVamp"`
}

type DamageStats struct {
	MagicDamageDone               int `json:"magicDamageDone"`
	MagicDamageDoneToChampions    int `json:"magicDamageDoneToChampions"`
	MagicDamageTaken              int `json:"magicDamageTaken"`
	PhysicalDamageDone            int `json:"physicalDamageDone"`
	PhysicalDamageDoneToChampions int `json:"physicalDamageDoneToChampions"`
	PhysicalDamageTaken           int `json:"physicalDamageTaken"`
	TotalDamageDone               int `json:"totalDamageDone"`
	TotalDamageDoneToChampions    int `json:"totalDamageDoneToChampions"`
	TotalDamageTaken              int `json:"totalDamageTaken"`
	TrueDamageDone                int `json:"trueDamageDone"`
	TrueDamageDoneToChampions     int `json:"trueDamageDoneToChampions"`
	TrueDamageTaken               int `json:"trueDamageTaken"`
}

type Position struct {
	X int `json:"x"`
	Y int `json:"y"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions