From 0fc4841932f121e660f32a48a0b7cec347928067 Mon Sep 17 00:00:00 2001 From: Kyagara Date: Tue, 7 May 2024 14:43:35 -0300 Subject: [PATCH] context option for revalidating cache, running betteralign again --- api/api.go | 8 + clients/lol/models.go | 686 ++++++++++++++++++++-------------------- clients/tft/models.go | 202 ++++++------ clients/val/models.go | 132 ++++---- internal/client.go | 5 +- internal/client_test.go | 6 +- 6 files changed, 524 insertions(+), 515 deletions(-) diff --git a/api/api.go b/api/api.go index dffdc58..8f65ad8 100644 --- a/api/api.go +++ b/api/api.go @@ -13,6 +13,14 @@ const ( RIOT_API_BASE_URL_FORMAT = ".api.riotgames.com" ) +// Options to be used when executing requests. +type ExecuteOptions bool + +const ( + // Skips checking the cache then updates the cache with new data. + Revalidate ExecuteOptions = true +) + // Contains the *http.Request to the Riot API and all necessary information about it. type EquinoxRequest struct { Logger zerolog.Logger diff --git a/clients/lol/models.go b/clients/lol/models.go index 323d406..6f478a2 100644 --- a/clients/lol/models.go +++ b/clients/lol/models.go @@ -19,23 +19,23 @@ type ChallengesApexPlayerInfoV1DTO struct { // lol-challenges-v1.ChallengeConfigInfoDto type ChallengesChallengeConfigInfoV1DTO struct { - EndTimestamp int64 `json:"endTimestamp,omitempty"` - ID int64 `json:"id,omitempty"` - Leaderboard bool `json:"leaderboard,omitempty"` LocalizedNames map[string]map[string]string `json:"localizedNames,omitempty"` - StartTimestamp int64 `json:"startTimestamp,omitempty"` + Thresholds map[string]float64 `json:"thresholds,omitempty"` // DISABLED - not visible and not calculated, HIDDEN - not visible, but calculated, ENABLED - visible and calculated, ARCHIVED - visible, but not calculated - State string `json:"state,omitempty"` - Thresholds map[string]float64 `json:"thresholds,omitempty"` + State string `json:"state,omitempty"` // LIFETIME - stats are incremented without reset, SEASON - stats are accumulated by season and reset at the beginning of new season - Tracking string `json:"tracking,omitempty"` + Tracking string `json:"tracking,omitempty"` + EndTimestamp int64 `json:"endTimestamp,omitempty"` + ID int64 `json:"id,omitempty"` + StartTimestamp int64 `json:"startTimestamp,omitempty"` + Leaderboard bool `json:"leaderboard,omitempty"` } // lol-challenges-v1.ChallengeInfo type ChallengesChallengeInfoV1DTO struct { + Level Tier `json:"level,omitempty"` AchievedTime int64 `json:"achievedTime,omitempty"` ChallengeID int64 `json:"challengeId,omitempty"` - Level Tier `json:"level,omitempty"` Percentile float64 `json:"percentile,omitempty"` PlayersInLevel int64 `json:"playersInLevel,omitempty"` Position int64 `json:"position,omitempty"` @@ -44,8 +44,8 @@ type ChallengesChallengeInfoV1DTO struct { // lol-challenges-v1.ChallengePoints type ChallengesChallengePointsV1DTO struct { - Current int64 `json:"current,omitempty"` Level Tier `json:"level,omitempty"` + Current int64 `json:"current,omitempty"` Max int64 `json:"max,omitempty"` Percentile float64 `json:"percentile,omitempty"` } @@ -57,10 +57,10 @@ type ChallengesLevelV1DTO struct { // lol-challenges-v1.PlayerClientPreferences type ChallengesPlayerClientPreferencesV1DTO struct { BannerAccent string `json:"bannerAccent,omitempty"` - ChallengeIDs []int64 `json:"challengeIds,omitempty"` CrestBorder string `json:"crestBorder,omitempty"` - PrestigeCrestBorderLevel int32 `json:"prestigeCrestBorderLevel,omitempty"` Title string `json:"title,omitempty"` + ChallengeIDs []int64 `json:"challengeIds,omitempty"` + PrestigeCrestBorderLevel int32 `json:"prestigeCrestBorderLevel,omitempty"` } // lol-challenges-v1.PlayerInfoDto @@ -81,26 +81,26 @@ type ChallengesTrackingV1DTO struct { // champion-mastery-v4.ChampionMasteryDto type ChampionMasteryV4DTO struct { + // Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) + PUUID string `json:"puuid,omitempty"` + // Summoner ID for this entry. (Encrypted) + SummonerID string `json:"summonerId,omitempty"` // Champion ID for this entry. ChampionID int64 `json:"championId,omitempty"` - // Champion level for specified player and champion combination. - ChampionLevel int32 `json:"championLevel,omitempty"` - // Total number of champion points for this player and champion combination - they are used to determine championLevel. - ChampionPoints int32 `json:"championPoints,omitempty"` // Number of points earned since current level has been achieved. ChampionPointsSinceLastLevel int64 `json:"championPointsSinceLastLevel,omitempty"` // Number of points needed to achieve next level. Zero if player reached maximum champion level for this champion. ChampionPointsUntilNextLevel int64 `json:"championPointsUntilNextLevel,omitempty"` - // Is chest granted for this champion or not in current season. - ChestGranted bool `json:"chestGranted,omitempty"` // Last time this champion was played by this player - in Unix milliseconds time format. LastPlayTime int64 `json:"lastPlayTime,omitempty"` - // Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) - PUUID string `json:"puuid,omitempty"` - // Summoner ID for this entry. (Encrypted) - SummonerID string `json:"summonerId,omitempty"` + // Champion level for specified player and champion combination. + ChampionLevel int32 `json:"championLevel,omitempty"` + // Total number of champion points for this player and champion combination - they are used to determine championLevel. + ChampionPoints int32 `json:"championPoints,omitempty"` // The token earned for this champion at the current championLevel. When the championLevel is advanced the tokensEarned resets to 0. TokensEarned int32 `json:"tokensEarned,omitempty"` + // Is chest granted for this champion or not in current season. + ChestGranted bool `json:"chestGranted,omitempty"` } // champion-v3.ChampionInfo @@ -126,10 +126,10 @@ type ClashTeamV1DTO struct { // Summoner ID of the team captain. Captain string `json:"captain,omitempty"` ID string `json:"id,omitempty"` - IconID int32 `json:"iconId,omitempty"` Name string `json:"name,omitempty"` // Team members. Players []ClashPlayerV1DTO `json:"players,omitempty"` + IconID int32 `json:"iconId,omitempty"` Tier int32 `json:"tier,omitempty"` TournamentID int32 `json:"tournamentId,omitempty"` } @@ -144,94 +144,94 @@ type ClashTournamentPhaseV1DTO struct { // clash-v1.TournamentDto type ClashTournamentV1DTO struct { - ID int32 `json:"id,omitempty"` NameKey string `json:"nameKey,omitempty"` NameKeySecondary string `json:"nameKeySecondary,omitempty"` // Tournament phase. Schedule []ClashTournamentPhaseV1DTO `json:"schedule,omitempty"` + ID int32 `json:"id,omitempty"` ThemeID int32 `json:"themeId,omitempty"` } // league-v4.LeagueEntryDTO type LeagueEntryV4DTO struct { - FreshBlood bool `json:"freshBlood,omitempty"` - HotStreak bool `json:"hotStreak,omitempty"` - Inactive bool `json:"inactive,omitempty"` - LeagueID string `json:"leagueId,omitempty"` - LeaguePoints int32 `json:"leaguePoints,omitempty"` - // Losing team on Summoners Rift. - Losses int32 `json:"losses,omitempty"` - MiniSeries LeagueMiniSeriesV4DTO `json:"miniSeries,omitempty"` - QueueType QueueType `json:"queueType,omitempty"` + LeagueID string `json:"leagueId,omitempty"` + QueueType QueueType `json:"queueType,omitempty"` // The player's division within a tier. Rank Division `json:"rank,omitempty"` // Player's encrypted summonerId. - SummonerID string `json:"summonerId,omitempty"` - Tier Tier `json:"tier,omitempty"` - Veteran bool `json:"veteran,omitempty"` + SummonerID string `json:"summonerId,omitempty"` + Tier Tier `json:"tier,omitempty"` + MiniSeries LeagueMiniSeriesV4DTO `json:"miniSeries,omitempty"` + LeaguePoints int32 `json:"leaguePoints,omitempty"` + // Losing team on Summoners Rift. + Losses int32 `json:"losses,omitempty"` // Winning team on Summoners Rift. - Wins int32 `json:"wins,omitempty"` + Wins int32 `json:"wins,omitempty"` + FreshBlood bool `json:"freshBlood,omitempty"` + HotStreak bool `json:"hotStreak,omitempty"` + Inactive bool `json:"inactive,omitempty"` + Veteran bool `json:"veteran,omitempty"` } // league-exp-v4.LeagueEntryDTO type LeagueExpLeagueEntryV4DTO struct { - FreshBlood bool `json:"freshBlood,omitempty"` - HotStreak bool `json:"hotStreak,omitempty"` - Inactive bool `json:"inactive,omitempty"` - LeagueID string `json:"leagueId,omitempty"` - LeaguePoints int32 `json:"leaguePoints,omitempty"` - // Losing team on Summoners Rift. Second through eighth placement in Teamfight Tactics. - Losses int32 `json:"losses,omitempty"` - MiniSeries LeagueExpMiniSeriesV4DTO `json:"miniSeries,omitempty"` - QueueType QueueType `json:"queueType,omitempty"` + LeagueID string `json:"leagueId,omitempty"` + QueueType QueueType `json:"queueType,omitempty"` // The player's division within a tier. Rank Division `json:"rank,omitempty"` // Player's summonerId (Encrypted) - SummonerID string `json:"summonerId,omitempty"` - Tier Tier `json:"tier,omitempty"` - Veteran bool `json:"veteran,omitempty"` + SummonerID string `json:"summonerId,omitempty"` + Tier Tier `json:"tier,omitempty"` + MiniSeries LeagueExpMiniSeriesV4DTO `json:"miniSeries,omitempty"` + LeaguePoints int32 `json:"leaguePoints,omitempty"` + // Losing team on Summoners Rift. Second through eighth placement in Teamfight Tactics. + Losses int32 `json:"losses,omitempty"` // Winning team on Summoners Rift. First placement in Teamfight Tactics. - Wins int32 `json:"wins,omitempty"` + Wins int32 `json:"wins,omitempty"` + FreshBlood bool `json:"freshBlood,omitempty"` + HotStreak bool `json:"hotStreak,omitempty"` + Inactive bool `json:"inactive,omitempty"` + Veteran bool `json:"veteran,omitempty"` } // league-exp-v4.MiniSeriesDTO type LeagueExpMiniSeriesV4DTO struct { - Losses int32 `json:"losses,omitempty"` Progress string `json:"progress,omitempty"` + Losses int32 `json:"losses,omitempty"` Target int32 `json:"target,omitempty"` Wins int32 `json:"wins,omitempty"` } // league-v4.LeagueItemDTO type LeagueItemV4DTO struct { - FreshBlood bool `json:"freshBlood,omitempty"` - HotStreak bool `json:"hotStreak,omitempty"` - Inactive bool `json:"inactive,omitempty"` - LeaguePoints int32 `json:"leaguePoints,omitempty"` - // Losing team on Summoners Rift. - Losses int32 `json:"losses,omitempty"` - MiniSeries LeagueMiniSeriesV4DTO `json:"miniSeries,omitempty"` - Rank Division `json:"rank,omitempty"` + Rank Division `json:"rank,omitempty"` // Player's encrypted summonerId. - SummonerID string `json:"summonerId,omitempty"` - Veteran bool `json:"veteran,omitempty"` + SummonerID string `json:"summonerId,omitempty"` + MiniSeries LeagueMiniSeriesV4DTO `json:"miniSeries,omitempty"` + LeaguePoints int32 `json:"leaguePoints,omitempty"` + // Losing team on Summoners Rift. + Losses int32 `json:"losses,omitempty"` // Winning team on Summoners Rift. - Wins int32 `json:"wins,omitempty"` + Wins int32 `json:"wins,omitempty"` + FreshBlood bool `json:"freshBlood,omitempty"` + HotStreak bool `json:"hotStreak,omitempty"` + Inactive bool `json:"inactive,omitempty"` + Veteran bool `json:"veteran,omitempty"` } // league-v4.LeagueListDTO type LeagueListV4DTO struct { - Entries []LeagueItemV4DTO `json:"entries,omitempty"` LeagueID string `json:"leagueId,omitempty"` Name string `json:"name,omitempty"` Queue QueueType `json:"queue,omitempty"` Tier Tier `json:"tier,omitempty"` + Entries []LeagueItemV4DTO `json:"entries,omitempty"` } // league-v4.MiniSeriesDTO type LeagueMiniSeriesV4DTO struct { - Losses int32 `json:"losses,omitempty"` Progress string `json:"progress,omitempty"` + Losses int32 `json:"losses,omitempty"` Target int32 `json:"target,omitempty"` Wins int32 `json:"wins,omitempty"` } @@ -246,6 +246,18 @@ type MatchBanV5DTO struct { type MatchInfoV5DTO struct { // Refer to indicate if the game ended in termination. EndOfGameResult string `json:"endOfGameResult,omitempty"` + // Refer to the Game Constants documentation. + GameMode GameMode `json:"gameMode,omitempty"` + GameName string `json:"gameName,omitempty"` + GameType GameType `json:"gameType,omitempty"` + // The first two parts can be used to determine the patch a game was played on. + GameVersion string `json:"gameVersion,omitempty"` + // Platform where the match was played. + PlatformID string `json:"platformId,omitempty"` + // Tournament code used to generate the match. This field was added to match-v5 in patch 11.13 on June 23rd, 2021. + TournamentCode string `json:"tournamentCode,omitempty"` + Participants []MatchParticipantV5DTO `json:"participants,omitempty"` + Teams []MatchTeamV5DTO `json:"teams,omitempty"` // Unix timestamp for when the game is created on the game server (i.e., the loading screen). GameCreation int64 `json:"gameCreation,omitempty"` // Prior to patch 11.20, this field returns the game length in milliseconds calculated from gameEndTimestamp - gameStartTimestamp. Post patch 11.20, this field returns the max timePlayed of any participant in the game in seconds, which makes the behavior of this field consistent with that of match-v4. The best way to handling the change in this field is to treat the value as milliseconds if the gameEndTimestamp field isn't in the response and to treat the value as seconds if gameEndTimestamp is in the response. @@ -253,24 +265,12 @@ type MatchInfoV5DTO struct { // Unix timestamp for when match ends on the game server. This timestamp can occasionally be significantly longer than when the match "ends". The most reliable way of determining the timestamp for the end of the match would be to add the max time played of any participant to the gameStartTimestamp. This field was added to match-v5 in patch 11.20 on Oct 5th, 2021. GameEndTimestamp int64 `json:"gameEndTimestamp,omitempty"` GameID int64 `json:"gameId,omitempty"` - // Refer to the Game Constants documentation. - GameMode GameMode `json:"gameMode,omitempty"` - GameName string `json:"gameName,omitempty"` // Unix timestamp for when match starts on the game server. - GameStartTimestamp int64 `json:"gameStartTimestamp,omitempty"` - GameType GameType `json:"gameType,omitempty"` - // The first two parts can be used to determine the patch a game was played on. - GameVersion string `json:"gameVersion,omitempty"` + GameStartTimestamp int64 `json:"gameStartTimestamp,omitempty"` // Refer to the Game Constants documentation. - MapID int32 `json:"mapId,omitempty"` - Participants []MatchParticipantV5DTO `json:"participants,omitempty"` - // Platform where the match was played. - PlatformID string `json:"platformId,omitempty"` + MapID int32 `json:"mapId,omitempty"` // Refer to the Game Constants documentation. - QueueID int32 `json:"queueId,omitempty"` - Teams []MatchTeamV5DTO `json:"teams,omitempty"` - // Tournament code used to generate the match. This field was added to match-v5 in patch 11.13 on June 23rd, 2021. - TournamentCode string `json:"tournamentCode,omitempty"` + QueueID int32 `json:"queueId,omitempty"` } // match-v5.MetadataDto @@ -302,6 +302,7 @@ type MatchObjectivesV5DTO struct { // match-v5.ParticipantChallenges type MatchParticipantChallengesV5DTO struct { + LegendaryItemUsed []int32 `json:"legendaryItemUsed,omitempty"` AbilityUses float64 `json:"abilityUses,omitempty"` AcesBefore15Minutes float64 `json:"acesBefore15Minutes,omitempty"` AlliedJungleMonsterKills float64 `json:"alliedJungleMonsterKills,omitempty"` @@ -370,7 +371,6 @@ type MatchParticipantChallengesV5DTO struct { LaneMinionsFirst10Minutes float64 `json:"laneMinionsFirst10Minutes,omitempty"` LaningPhaseGoldExpAdvantage float64 `json:"laningPhaseGoldExpAdvantage,omitempty"` LegendaryCount float64 `json:"legendaryCount,omitempty"` - LegendaryItemUsed []int32 `json:"legendaryItemUsed,omitempty"` LostAnInhibitor float64 `json:"lostAnInhibitor,omitempty"` MaxCsAdvantageOnLaneOpponent float64 `json:"maxCsAdvantageOnLaneOpponent,omitempty"` MaxKillDeficit float64 `json:"maxKillDeficit,omitempty"` @@ -427,7 +427,6 @@ type MatchParticipantChallengesV5DTO struct { TurretTakedowns float64 `json:"turretTakedowns,omitempty"` TurretsTakenWithRiftHerald float64 `json:"turretsTakenWithRiftHerald,omitempty"` TwentyMinionsIn3SecondsCount float64 `json:"twentyMinionsIn3SecondsCount,omitempty"` - TwoWardsOneSweeperCount int32 `json:"twoWardsOneSweeperCount,omitempty"` UnseenRecalls float64 `json:"unseenRecalls,omitempty"` VisionScoreAdvantageLaneOpponent float64 `json:"visionScoreAdvantageLaneOpponent,omitempty"` VisionScorePerMinute float64 `json:"visionScorePerMinute,omitempty"` @@ -435,6 +434,7 @@ type MatchParticipantChallengesV5DTO struct { WardTakedownsBefore20M float64 `json:"wardTakedownsBefore20M,omitempty"` WardsGuarded float64 `json:"wardsGuarded,omitempty"` X12AssistStreakCount float64 `json:"12AssistStreakCount,omitempty"` + TwoWardsOneSweeperCount int32 `json:"twoWardsOneSweeperCount,omitempty"` } // match-v5.ParticipantMissions @@ -455,6 +455,24 @@ type MatchParticipantMissionsV5DTO struct { // match-v5.ParticipantDto type MatchParticipantV5DTO struct { + ChampionName string `json:"championName,omitempty"` + // Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field. + IndividualPosition string `json:"individualPosition,omitempty"` + Lane string `json:"lane,omitempty"` + PUUID string `json:"puuid,omitempty"` + // Use `riotIdName` for games before patch 14.5. + RiotIDGameName string `json:"riotIdGameName,omitempty"` + // Replaced by `riotIdGameName` in games played in patch 14.5 and after. + RiotIDName string `json:"riotIdName,omitempty"` + RiotIDTagline string `json:"riotIdTagline,omitempty"` + Role string `json:"role,omitempty"` + SummonerID string `json:"summonerId,omitempty"` + SummonerName string `json:"summonerName,omitempty"` + // Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field. + TeamPosition string `json:"teamPosition,omitempty"` + Perks MatchPerksV5DTO `json:"perks,omitempty"` + Challenges MatchParticipantChallengesV5DTO `json:"challenges,omitempty"` + Missions MatchParticipantMissionsV5DTO `json:"missions,omitempty"` AllInPings int32 `json:"allInPings,omitempty"` AssistMePings int32 `json:"assistMePings,omitempty"` Assists int32 `json:"assists,omitempty"` @@ -462,149 +480,131 @@ type MatchParticipantV5DTO struct { BaronKills int32 `json:"baronKills,omitempty"` BasicPings int32 `json:"basicPings,omitempty"` BountyLevel int32 `json:"bountyLevel,omitempty"` - Challenges MatchParticipantChallengesV5DTO `json:"challenges,omitempty"` ChampExperience int32 `json:"champExperience,omitempty"` ChampLevel int32 `json:"champLevel,omitempty"` // Prior to patch 11.4, on Feb 18th, 2021, this field returned invalid championIds. We recommend determining the champion based on the championName field for matches played prior to patch 11.4. - ChampionID int32 `json:"championId,omitempty"` - ChampionName string `json:"championName,omitempty"` + ChampionID int32 `json:"championId,omitempty"` // This field is currently only utilized for Kayn's transformations. (Legal values: 0 - None, 1 - Slayer, 2 - Assassin) - ChampionTransform int32 `json:"championTransform,omitempty"` - CommandPings int32 `json:"commandPings,omitempty"` - ConsumablesPurchased int32 `json:"consumablesPurchased,omitempty"` - DamageDealtToBuildings int32 `json:"damageDealtToBuildings,omitempty"` - DamageDealtToObjectives int32 `json:"damageDealtToObjectives,omitempty"` - DamageDealtToTurrets int32 `json:"damageDealtToTurrets,omitempty"` - DamageSelfMitigated int32 `json:"damageSelfMitigated,omitempty"` - DangerPings int32 `json:"dangerPings,omitempty"` - Deaths int32 `json:"deaths,omitempty"` - DetectorWardsPlaced int32 `json:"detectorWardsPlaced,omitempty"` - DoubleKills int32 `json:"doubleKills,omitempty"` - DragonKills int32 `json:"dragonKills,omitempty"` - EligibleForProgression bool `json:"eligibleForProgression,omitempty"` - EnemyMissingPings int32 `json:"enemyMissingPings,omitempty"` - EnemyVisionPings int32 `json:"enemyVisionPings,omitempty"` - FirstBloodAssist bool `json:"firstBloodAssist,omitempty"` - FirstBloodKill bool `json:"firstBloodKill,omitempty"` - FirstTowerAssist bool `json:"firstTowerAssist,omitempty"` - FirstTowerKill bool `json:"firstTowerKill,omitempty"` - GameEndedInEarlySurrender bool `json:"gameEndedInEarlySurrender,omitempty"` - GameEndedInSurrender bool `json:"gameEndedInSurrender,omitempty"` - GetBackPings int32 `json:"getBackPings,omitempty"` - GoldEarned int32 `json:"goldEarned,omitempty"` - GoldSpent int32 `json:"goldSpent,omitempty"` - HoldPings int32 `json:"holdPings,omitempty"` - // Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field. - IndividualPosition string `json:"individualPosition,omitempty"` - InhibitorKills int32 `json:"inhibitorKills,omitempty"` - InhibitorTakedowns int32 `json:"inhibitorTakedowns,omitempty"` - InhibitorsLost int32 `json:"inhibitorsLost,omitempty"` - Item0 int32 `json:"item0,omitempty"` - Item1 int32 `json:"item1,omitempty"` - Item2 int32 `json:"item2,omitempty"` - Item3 int32 `json:"item3,omitempty"` - Item4 int32 `json:"item4,omitempty"` - Item5 int32 `json:"item5,omitempty"` - Item6 int32 `json:"item6,omitempty"` - ItemsPurchased int32 `json:"itemsPurchased,omitempty"` - KillingSprees int32 `json:"killingSprees,omitempty"` - Kills int32 `json:"kills,omitempty"` - Lane string `json:"lane,omitempty"` - LargestCriticalStrike int32 `json:"largestCriticalStrike,omitempty"` - LargestKillingSpree int32 `json:"largestKillingSpree,omitempty"` - LargestMultiKill int32 `json:"largestMultiKill,omitempty"` - LongestTimeSpentLiving int32 `json:"longestTimeSpentLiving,omitempty"` - MagicDamageDealt int32 `json:"magicDamageDealt,omitempty"` - MagicDamageDealtToChampions int32 `json:"magicDamageDealtToChampions,omitempty"` - MagicDamageTaken int32 `json:"magicDamageTaken,omitempty"` - Missions MatchParticipantMissionsV5DTO `json:"missions,omitempty"` - NeedVisionPings int32 `json:"needVisionPings,omitempty"` - NeutralMinionsKilled int32 `json:"neutralMinionsKilled,omitempty"` - NexusKills int32 `json:"nexusKills,omitempty"` - NexusLost int32 `json:"nexusLost,omitempty"` - NexusTakedowns int32 `json:"nexusTakedowns,omitempty"` - ObjectivesStolen int32 `json:"objectivesStolen,omitempty"` - ObjectivesStolenAssists int32 `json:"objectivesStolenAssists,omitempty"` - OnMyWayPings int32 `json:"onMyWayPings,omitempty"` - PUUID string `json:"puuid,omitempty"` - ParticipantID int32 `json:"participantId,omitempty"` - PentaKills int32 `json:"pentaKills,omitempty"` - Perks MatchPerksV5DTO `json:"perks,omitempty"` - PhysicalDamageDealt int32 `json:"physicalDamageDealt,omitempty"` - PhysicalDamageDealtToChampions int32 `json:"physicalDamageDealtToChampions,omitempty"` - PhysicalDamageTaken int32 `json:"physicalDamageTaken,omitempty"` - Placement int32 `json:"placement,omitempty"` - PlayerAugment1 int32 `json:"playerAugment1,omitempty"` - PlayerAugment2 int32 `json:"playerAugment2,omitempty"` - PlayerAugment3 int32 `json:"playerAugment3,omitempty"` - PlayerAugment4 int32 `json:"playerAugment4,omitempty"` - PlayerScore0 int32 `json:"playerScore0,omitempty"` - PlayerScore1 int32 `json:"playerScore1,omitempty"` - PlayerScore10 int32 `json:"playerScore10,omitempty"` - PlayerScore11 int32 `json:"playerScore11,omitempty"` - PlayerScore2 int32 `json:"playerScore2,omitempty"` - PlayerScore3 int32 `json:"playerScore3,omitempty"` - PlayerScore4 int32 `json:"playerScore4,omitempty"` - PlayerScore5 int32 `json:"playerScore5,omitempty"` - PlayerScore6 int32 `json:"playerScore6,omitempty"` - PlayerScore7 int32 `json:"playerScore7,omitempty"` - PlayerScore8 int32 `json:"playerScore8,omitempty"` - PlayerScore9 int32 `json:"playerScore9,omitempty"` - PlayerSubteamID int32 `json:"playerSubteamId,omitempty"` - ProfileIcon int32 `json:"profileIcon,omitempty"` - PushPings int32 `json:"pushPings,omitempty"` - QuadraKills int32 `json:"quadraKills,omitempty"` - // Use `riotIdName` for games before patch 14.5. - RiotIDGameName string `json:"riotIdGameName,omitempty"` - // Replaced by `riotIdGameName` in games played in patch 14.5 and after. - RiotIDName string `json:"riotIdName,omitempty"` - RiotIDTagline string `json:"riotIdTagline,omitempty"` - Role string `json:"role,omitempty"` - SightWardsBoughtInGame int32 `json:"sightWardsBoughtInGame,omitempty"` - Spell1Casts int32 `json:"spell1Casts,omitempty"` - Spell2Casts int32 `json:"spell2Casts,omitempty"` - Spell3Casts int32 `json:"spell3Casts,omitempty"` - Spell4Casts int32 `json:"spell4Casts,omitempty"` - SubteamPlacement int32 `json:"subteamPlacement,omitempty"` - Summoner1Casts int32 `json:"summoner1Casts,omitempty"` - Summoner1ID int32 `json:"summoner1Id,omitempty"` - Summoner2Casts int32 `json:"summoner2Casts,omitempty"` - Summoner2ID int32 `json:"summoner2Id,omitempty"` - SummonerID string `json:"summonerId,omitempty"` - SummonerLevel int32 `json:"summonerLevel,omitempty"` - SummonerName string `json:"summonerName,omitempty"` - TeamEarlySurrendered bool `json:"teamEarlySurrendered,omitempty"` - TeamID int32 `json:"teamId,omitempty"` - // Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field. - TeamPosition string `json:"teamPosition,omitempty"` - TimeCCingOthers int32 `json:"timeCCingOthers,omitempty"` - TimePlayed int32 `json:"timePlayed,omitempty"` - TotalAllyJungleMinionsKilled int32 `json:"totalAllyJungleMinionsKilled,omitempty"` - TotalDamageDealt int32 `json:"totalDamageDealt,omitempty"` - TotalDamageDealtToChampions int32 `json:"totalDamageDealtToChampions,omitempty"` - TotalDamageShieldedOnTeammates int32 `json:"totalDamageShieldedOnTeammates,omitempty"` - TotalDamageTaken int32 `json:"totalDamageTaken,omitempty"` - TotalEnemyJungleMinionsKilled int32 `json:"totalEnemyJungleMinionsKilled,omitempty"` - TotalHeal int32 `json:"totalHeal,omitempty"` - TotalHealsOnTeammates int32 `json:"totalHealsOnTeammates,omitempty"` - TotalMinionsKilled int32 `json:"totalMinionsKilled,omitempty"` - TotalTimeCcdealt int32 `json:"totalTimeCCDealt,omitempty"` - TotalTimeSpentDead int32 `json:"totalTimeSpentDead,omitempty"` - TotalUnitsHealed int32 `json:"totalUnitsHealed,omitempty"` - TripleKills int32 `json:"tripleKills,omitempty"` - TrueDamageDealt int32 `json:"trueDamageDealt,omitempty"` - TrueDamageDealtToChampions int32 `json:"trueDamageDealtToChampions,omitempty"` - TrueDamageTaken int32 `json:"trueDamageTaken,omitempty"` - TurretKills int32 `json:"turretKills,omitempty"` - TurretTakedowns int32 `json:"turretTakedowns,omitempty"` - TurretsLost int32 `json:"turretsLost,omitempty"` - UnrealKills int32 `json:"unrealKills,omitempty"` - VisionClearedPings int32 `json:"visionClearedPings,omitempty"` - VisionScore int32 `json:"visionScore,omitempty"` - VisionWardsBoughtInGame int32 `json:"visionWardsBoughtInGame,omitempty"` - WardsKilled int32 `json:"wardsKilled,omitempty"` - WardsPlaced int32 `json:"wardsPlaced,omitempty"` - Win bool `json:"win,omitempty"` + ChampionTransform int32 `json:"championTransform,omitempty"` + CommandPings int32 `json:"commandPings,omitempty"` + ConsumablesPurchased int32 `json:"consumablesPurchased,omitempty"` + DamageDealtToBuildings int32 `json:"damageDealtToBuildings,omitempty"` + DamageDealtToObjectives int32 `json:"damageDealtToObjectives,omitempty"` + DamageDealtToTurrets int32 `json:"damageDealtToTurrets,omitempty"` + DamageSelfMitigated int32 `json:"damageSelfMitigated,omitempty"` + DangerPings int32 `json:"dangerPings,omitempty"` + Deaths int32 `json:"deaths,omitempty"` + DetectorWardsPlaced int32 `json:"detectorWardsPlaced,omitempty"` + DoubleKills int32 `json:"doubleKills,omitempty"` + DragonKills int32 `json:"dragonKills,omitempty"` + EnemyMissingPings int32 `json:"enemyMissingPings,omitempty"` + EnemyVisionPings int32 `json:"enemyVisionPings,omitempty"` + GetBackPings int32 `json:"getBackPings,omitempty"` + GoldEarned int32 `json:"goldEarned,omitempty"` + GoldSpent int32 `json:"goldSpent,omitempty"` + HoldPings int32 `json:"holdPings,omitempty"` + InhibitorKills int32 `json:"inhibitorKills,omitempty"` + InhibitorTakedowns int32 `json:"inhibitorTakedowns,omitempty"` + InhibitorsLost int32 `json:"inhibitorsLost,omitempty"` + Item0 int32 `json:"item0,omitempty"` + Item1 int32 `json:"item1,omitempty"` + Item2 int32 `json:"item2,omitempty"` + Item3 int32 `json:"item3,omitempty"` + Item4 int32 `json:"item4,omitempty"` + Item5 int32 `json:"item5,omitempty"` + Item6 int32 `json:"item6,omitempty"` + ItemsPurchased int32 `json:"itemsPurchased,omitempty"` + KillingSprees int32 `json:"killingSprees,omitempty"` + Kills int32 `json:"kills,omitempty"` + LargestCriticalStrike int32 `json:"largestCriticalStrike,omitempty"` + LargestKillingSpree int32 `json:"largestKillingSpree,omitempty"` + LargestMultiKill int32 `json:"largestMultiKill,omitempty"` + LongestTimeSpentLiving int32 `json:"longestTimeSpentLiving,omitempty"` + MagicDamageDealt int32 `json:"magicDamageDealt,omitempty"` + MagicDamageDealtToChampions int32 `json:"magicDamageDealtToChampions,omitempty"` + MagicDamageTaken int32 `json:"magicDamageTaken,omitempty"` + NeedVisionPings int32 `json:"needVisionPings,omitempty"` + NeutralMinionsKilled int32 `json:"neutralMinionsKilled,omitempty"` + NexusKills int32 `json:"nexusKills,omitempty"` + NexusLost int32 `json:"nexusLost,omitempty"` + NexusTakedowns int32 `json:"nexusTakedowns,omitempty"` + ObjectivesStolen int32 `json:"objectivesStolen,omitempty"` + ObjectivesStolenAssists int32 `json:"objectivesStolenAssists,omitempty"` + OnMyWayPings int32 `json:"onMyWayPings,omitempty"` + ParticipantID int32 `json:"participantId,omitempty"` + PentaKills int32 `json:"pentaKills,omitempty"` + PhysicalDamageDealt int32 `json:"physicalDamageDealt,omitempty"` + PhysicalDamageDealtToChampions int32 `json:"physicalDamageDealtToChampions,omitempty"` + PhysicalDamageTaken int32 `json:"physicalDamageTaken,omitempty"` + Placement int32 `json:"placement,omitempty"` + PlayerAugment1 int32 `json:"playerAugment1,omitempty"` + PlayerAugment2 int32 `json:"playerAugment2,omitempty"` + PlayerAugment3 int32 `json:"playerAugment3,omitempty"` + PlayerAugment4 int32 `json:"playerAugment4,omitempty"` + PlayerScore0 int32 `json:"playerScore0,omitempty"` + PlayerScore1 int32 `json:"playerScore1,omitempty"` + PlayerScore10 int32 `json:"playerScore10,omitempty"` + PlayerScore11 int32 `json:"playerScore11,omitempty"` + PlayerScore2 int32 `json:"playerScore2,omitempty"` + PlayerScore3 int32 `json:"playerScore3,omitempty"` + PlayerScore4 int32 `json:"playerScore4,omitempty"` + PlayerScore5 int32 `json:"playerScore5,omitempty"` + PlayerScore6 int32 `json:"playerScore6,omitempty"` + PlayerScore7 int32 `json:"playerScore7,omitempty"` + PlayerScore8 int32 `json:"playerScore8,omitempty"` + PlayerScore9 int32 `json:"playerScore9,omitempty"` + PlayerSubteamID int32 `json:"playerSubteamId,omitempty"` + ProfileIcon int32 `json:"profileIcon,omitempty"` + PushPings int32 `json:"pushPings,omitempty"` + QuadraKills int32 `json:"quadraKills,omitempty"` + SightWardsBoughtInGame int32 `json:"sightWardsBoughtInGame,omitempty"` + Spell1Casts int32 `json:"spell1Casts,omitempty"` + Spell2Casts int32 `json:"spell2Casts,omitempty"` + Spell3Casts int32 `json:"spell3Casts,omitempty"` + Spell4Casts int32 `json:"spell4Casts,omitempty"` + SubteamPlacement int32 `json:"subteamPlacement,omitempty"` + Summoner1Casts int32 `json:"summoner1Casts,omitempty"` + Summoner1ID int32 `json:"summoner1Id,omitempty"` + Summoner2Casts int32 `json:"summoner2Casts,omitempty"` + Summoner2ID int32 `json:"summoner2Id,omitempty"` + SummonerLevel int32 `json:"summonerLevel,omitempty"` + TeamID int32 `json:"teamId,omitempty"` + TimeCCingOthers int32 `json:"timeCCingOthers,omitempty"` + TimePlayed int32 `json:"timePlayed,omitempty"` + TotalAllyJungleMinionsKilled int32 `json:"totalAllyJungleMinionsKilled,omitempty"` + TotalDamageDealt int32 `json:"totalDamageDealt,omitempty"` + TotalDamageDealtToChampions int32 `json:"totalDamageDealtToChampions,omitempty"` + TotalDamageShieldedOnTeammates int32 `json:"totalDamageShieldedOnTeammates,omitempty"` + TotalDamageTaken int32 `json:"totalDamageTaken,omitempty"` + TotalEnemyJungleMinionsKilled int32 `json:"totalEnemyJungleMinionsKilled,omitempty"` + TotalHeal int32 `json:"totalHeal,omitempty"` + TotalHealsOnTeammates int32 `json:"totalHealsOnTeammates,omitempty"` + TotalMinionsKilled int32 `json:"totalMinionsKilled,omitempty"` + TotalTimeCcdealt int32 `json:"totalTimeCCDealt,omitempty"` + TotalTimeSpentDead int32 `json:"totalTimeSpentDead,omitempty"` + TotalUnitsHealed int32 `json:"totalUnitsHealed,omitempty"` + TripleKills int32 `json:"tripleKills,omitempty"` + TrueDamageDealt int32 `json:"trueDamageDealt,omitempty"` + TrueDamageDealtToChampions int32 `json:"trueDamageDealtToChampions,omitempty"` + TrueDamageTaken int32 `json:"trueDamageTaken,omitempty"` + TurretKills int32 `json:"turretKills,omitempty"` + TurretTakedowns int32 `json:"turretTakedowns,omitempty"` + TurretsLost int32 `json:"turretsLost,omitempty"` + UnrealKills int32 `json:"unrealKills,omitempty"` + VisionClearedPings int32 `json:"visionClearedPings,omitempty"` + VisionScore int32 `json:"visionScore,omitempty"` + VisionWardsBoughtInGame int32 `json:"visionWardsBoughtInGame,omitempty"` + WardsKilled int32 `json:"wardsKilled,omitempty"` + WardsPlaced int32 `json:"wardsPlaced,omitempty"` + EligibleForProgression bool `json:"eligibleForProgression,omitempty"` + FirstBloodAssist bool `json:"firstBloodAssist,omitempty"` + FirstBloodKill bool `json:"firstBloodKill,omitempty"` + FirstTowerAssist bool `json:"firstTowerAssist,omitempty"` + FirstTowerKill bool `json:"firstTowerKill,omitempty"` + GameEndedInEarlySurrender bool `json:"gameEndedInEarlySurrender,omitempty"` + GameEndedInSurrender bool `json:"gameEndedInSurrender,omitempty"` + TeamEarlySurrendered bool `json:"teamEarlySurrendered,omitempty"` + Win bool `json:"win,omitempty"` } // match-v5.PerkStatsDto @@ -631,8 +631,8 @@ type MatchPerkStyleV5DTO struct { // match-v5.PerksDto type MatchPerksV5DTO struct { - StatPerks MatchPerkStatsV5DTO `json:"statPerks,omitempty"` Styles []MatchPerkStyleV5DTO `json:"styles,omitempty"` + StatPerks MatchPerkStatsV5DTO `json:"statPerks,omitempty"` } // match-v5.TeamDto @@ -645,58 +645,58 @@ type MatchTeamV5DTO struct { // match-v5.MatchTimelineInfoFrameEvent type MatchTimelineInfoFrameEventV5DTO struct { - ActualStartTime int64 `json:"actualStartTime,omitempty"` - AfterID int32 `json:"afterId,omitempty"` - AssistingParticipantIDs []int32 `json:"assistingParticipantIds,omitempty"` - BeforeID int32 `json:"beforeId,omitempty"` - Bounty int32 `json:"bounty,omitempty"` - BuildingType string `json:"buildingType,omitempty"` - CreatorID int32 `json:"creatorId,omitempty"` - GameID int64 `json:"gameId,omitempty"` - GoldGain int32 `json:"goldGain,omitempty"` - ItemID int32 `json:"itemId,omitempty"` - KillStreakLength int32 `json:"killStreakLength,omitempty"` - KillType string `json:"killType,omitempty"` - KillerID int32 `json:"killerId,omitempty"` - KillerTeamID int32 `json:"killerTeamId,omitempty"` - LaneType string `json:"laneType,omitempty"` - Level int32 `json:"level,omitempty"` - LevelUpType string `json:"levelUpType,omitempty"` - MonsterSubType string `json:"monsterSubType,omitempty"` - MonsterType string `json:"monsterType,omitempty"` - MultiKillLength int32 `json:"multiKillLength,omitempty"` - Name string `json:"name,omitempty"` - ParticipantID int32 `json:"participantId,omitempty"` - Position MatchTimelinePositionV5DTO `json:"position,omitempty"` - RealTimestamp int64 `json:"realTimestamp,omitempty"` - ShutdownBounty int32 `json:"shutdownBounty,omitempty"` - SkillSlot int32 `json:"skillSlot,omitempty"` - TeamID int32 `json:"teamId,omitempty"` - Timestamp int32 `json:"timestamp,omitempty"` - TowerType string `json:"towerType,omitempty"` - TransformType string `json:"transformType,omitempty"` + BuildingType string `json:"buildingType,omitempty"` + KillType string `json:"killType,omitempty"` + LaneType string `json:"laneType,omitempty"` + LevelUpType string `json:"levelUpType,omitempty"` + MonsterSubType string `json:"monsterSubType,omitempty"` + MonsterType string `json:"monsterType,omitempty"` + Name string `json:"name,omitempty"` + TowerType string `json:"towerType,omitempty"` + TransformType string `json:"transformType,omitempty"` // Timeline event type. // // (Known legal values: ASCENDED_EVENT, BUILDING_KILL, CAPTURE_POINT, CHAMPION_KILL, CHAMPION_SPECIAL_KILL, CHAMPION_TRANSFORM, DRAGON_SOUL_GIVEN, ELITE_MONSTER_KILL, GAME_END, ITEM_DESTROYED, ITEM_PURCHASED, ITEM_SOLD, ITEM_UNDO, LEVEL_UP, OBJECTIVE_BOUNTY_FINISH, OBJECTIVE_BOUNTY_PRESTART, PAUSE_END, PAUSE_START, SKILL_LEVEL_UP, TURRET_PLATE_DESTROYED, WARD_KILL, WARD_PLACED) - Type string `json:"type,omitempty"` - VictimDamageDealt []MatchTimelineInfoFrameEventVictimDamageDealtV5DTO `json:"victimDamageDealt,omitempty"` - VictimDamageReceived []MatchTimelineInfoFrameEventVictimDamageDealtV5DTO `json:"victimDamageReceived,omitempty"` - VictimID int32 `json:"victimId,omitempty"` - WardType string `json:"wardType,omitempty"` - WinningTeam int32 `json:"winningTeam,omitempty"` + Type string `json:"type,omitempty"` + WardType string `json:"wardType,omitempty"` + AssistingParticipantIDs []int32 `json:"assistingParticipantIds,omitempty"` + VictimDamageDealt []MatchTimelineInfoFrameEventVictimDamageDealtV5DTO `json:"victimDamageDealt,omitempty"` + VictimDamageReceived []MatchTimelineInfoFrameEventVictimDamageDealtV5DTO `json:"victimDamageReceived,omitempty"` + ActualStartTime int64 `json:"actualStartTime,omitempty"` + GameID int64 `json:"gameId,omitempty"` + RealTimestamp int64 `json:"realTimestamp,omitempty"` + Position MatchTimelinePositionV5DTO `json:"position,omitempty"` + AfterID int32 `json:"afterId,omitempty"` + BeforeID int32 `json:"beforeId,omitempty"` + Bounty int32 `json:"bounty,omitempty"` + CreatorID int32 `json:"creatorId,omitempty"` + GoldGain int32 `json:"goldGain,omitempty"` + ItemID int32 `json:"itemId,omitempty"` + KillStreakLength int32 `json:"killStreakLength,omitempty"` + KillerID int32 `json:"killerId,omitempty"` + KillerTeamID int32 `json:"killerTeamId,omitempty"` + Level int32 `json:"level,omitempty"` + MultiKillLength int32 `json:"multiKillLength,omitempty"` + ParticipantID int32 `json:"participantId,omitempty"` + ShutdownBounty int32 `json:"shutdownBounty,omitempty"` + SkillSlot int32 `json:"skillSlot,omitempty"` + TeamID int32 `json:"teamId,omitempty"` + Timestamp int32 `json:"timestamp,omitempty"` + VictimID int32 `json:"victimId,omitempty"` + WinningTeam int32 `json:"winningTeam,omitempty"` } // match-v5.MatchTimelineInfoFrameEventVictimDamageDealt type MatchTimelineInfoFrameEventVictimDamageDealtV5DTO struct { - Basic bool `json:"basic,omitempty"` - MagicDamage int32 `json:"magicDamage,omitempty"` Name string `json:"name,omitempty"` + SpellName string `json:"spellName,omitempty"` + Type string `json:"type,omitempty"` + MagicDamage int32 `json:"magicDamage,omitempty"` ParticipantID int32 `json:"participantId,omitempty"` PhysicalDamage int32 `json:"physicalDamage,omitempty"` - SpellName string `json:"spellName,omitempty"` SpellSlot int32 `json:"spellSlot,omitempty"` TrueDamage int32 `json:"trueDamage,omitempty"` - Type string `json:"type,omitempty"` + Basic bool `json:"basic,omitempty"` } // match-v5.MatchTimelineInfoFrameParticipantFrameChampionStats @@ -762,8 +762,8 @@ type MatchTimelineInfoFrameParticipantFrameV5DTO struct { // match-v5.MatchTimelineInfoFrame type MatchTimelineInfoFrameV5DTO struct { - Events []MatchTimelineInfoFrameEventV5DTO `json:"events,omitempty"` ParticipantFrames map[int32]MatchTimelineInfoFrameParticipantFrameV5DTO `json:"participantFrames,omitempty"` + Events []MatchTimelineInfoFrameEventV5DTO `json:"events,omitempty"` Timestamp int32 `json:"timestamp,omitempty"` } @@ -776,10 +776,10 @@ type MatchTimelineInfoParticipantV5DTO struct { // match-v5.MatchTimelineInfo type MatchTimelineInfoV5DTO struct { EndOfGameResult string `json:"endOfGameResult,omitempty"` - FrameInterval int32 `json:"frameInterval,omitempty"` Frames []MatchTimelineInfoFrameV5DTO `json:"frames,omitempty"` - GameID int64 `json:"gameId,omitempty"` Participants []MatchTimelineInfoParticipantV5DTO `json:"participants,omitempty"` + GameID int64 `json:"gameId,omitempty"` + FrameInterval int32 `json:"frameInterval,omitempty"` } // match-v5.MatchTimelinePosition @@ -790,16 +790,16 @@ type MatchTimelinePositionV5DTO struct { // match-v5.MatchTimelineDto type MatchTimelineV5DTO struct { - Info MatchTimelineInfoV5DTO `json:"info,omitempty"` Metadata MatchMetadataV5DTO `json:"metadata,omitempty"` + Info MatchTimelineInfoV5DTO `json:"info,omitempty"` } // match-v5.MatchDto type MatchV5DTO struct { - // Match info. - Info MatchInfoV5DTO `json:"info,omitempty"` // Match metadata. Metadata MatchMetadataV5DTO `json:"metadata,omitempty"` + // Match info. + Info MatchInfoV5DTO `json:"info,omitempty"` } // spectator-v5.BannedChampion @@ -814,89 +814,89 @@ type SpectatorBannedChampionV5DTO struct { // spectator-v5.CurrentGameInfo type SpectatorCurrentGameInfoV5DTO struct { + // The game mode + GameMode GameMode `json:"gameMode,omitempty"` + // The game type + GameType GameType `json:"gameType,omitempty"` + // The observer information + Observers SpectatorObserverV5DTO `json:"observers,omitempty"` + // The ID of the platform on which the game is being played + PlatformID string `json:"platformId,omitempty"` // Banned champion information BannedChampions []SpectatorBannedChampionV5DTO `json:"bannedChampions,omitempty"` + // The participant information + Participants []SpectatorCurrentGameParticipantV5DTO `json:"participants,omitempty"` // The ID of the game GameID int64 `json:"gameId,omitempty"` // The amount of time in seconds that has passed since the game started GameLength int64 `json:"gameLength,omitempty"` - // The game mode - GameMode GameMode `json:"gameMode,omitempty"` // The queue type (queue types are documented on the Game Constants page) GameQueueConfigID int64 `json:"gameQueueConfigId,omitempty"` // The game start time represented in epoch milliseconds GameStartTime int64 `json:"gameStartTime,omitempty"` - // The game type - GameType GameType `json:"gameType,omitempty"` // The ID of the map MapID int64 `json:"mapId,omitempty"` - // The observer information - Observers SpectatorObserverV5DTO `json:"observers,omitempty"` - // The participant information - Participants []SpectatorCurrentGameParticipantV5DTO `json:"participants,omitempty"` - // The ID of the platform on which the game is being played - PlatformID string `json:"platformId,omitempty"` } // spectator-v5.CurrentGameParticipant type SpectatorCurrentGameParticipantV5DTO struct { - // Flag indicating whether or not this participant is a bot - Bot bool `json:"bot,omitempty"` - // The ID of the champion played by this participant - ChampionID int64 `json:"championId,omitempty"` + // The encrypted puuid of this participant + PUUID string `json:"puuid,omitempty"` + RiotID string `json:"riotId,omitempty"` + // The encrypted summoner ID of this participant + SummonerID string `json:"summonerId,omitempty"` // List of Game Customizations GameCustomizationObjects []SpectatorGameCustomizationObjectV5DTO `json:"gameCustomizationObjects,omitempty"` - // The encrypted puuid of this participant - PUUID string `json:"puuid,omitempty"` // Perks/Runes Reforged Information Perks SpectatorPerksV5DTO `json:"perks,omitempty"` + // The ID of the champion played by this participant + ChampionID int64 `json:"championId,omitempty"` // The ID of the profile icon used by this participant - ProfileIconID int64 `json:"profileIconId,omitempty"` - RiotID string `json:"riotId,omitempty"` + ProfileIconID int64 `json:"profileIconId,omitempty"` // The ID of the first summoner spell used by this participant Spell1ID int64 `json:"spell1Id,omitempty"` // The ID of the second summoner spell used by this participant Spell2ID int64 `json:"spell2Id,omitempty"` - // The encrypted summoner ID of this participant - SummonerID string `json:"summonerId,omitempty"` // The team ID of this participant, indicating the participant's team TeamID int64 `json:"teamId,omitempty"` + // Flag indicating whether or not this participant is a bot + Bot bool `json:"bot,omitempty"` } // spectator-v5.FeaturedGameInfo type SpectatorFeaturedGameInfoV5DTO struct { - // Banned champion information - BannedChampions []SpectatorBannedChampionV5DTO `json:"bannedChampions,omitempty"` - // The ID of the game - GameID int64 `json:"gameId,omitempty"` - // The amount of time in seconds that has passed since the game started - GameLength int64 `json:"gameLength,omitempty"` // The game mode // // (Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO) GameMode GameMode `json:"gameMode,omitempty"` - // The queue type (queue types are documented on the Game Constants page) - GameQueueConfigID int64 `json:"gameQueueConfigId,omitempty"` // The game type // // (Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME) GameType GameType `json:"gameType,omitempty"` - // The ID of the map - MapID int64 `json:"mapId,omitempty"` // The observer information Observers SpectatorObserverV5DTO `json:"observers,omitempty"` - // The participant information - Participants []SpectatorParticipantV5DTO `json:"participants,omitempty"` // The ID of the platform on which the game is being played PlatformID string `json:"platformId,omitempty"` + // Banned champion information + BannedChampions []SpectatorBannedChampionV5DTO `json:"bannedChampions,omitempty"` + // The participant information + Participants []SpectatorParticipantV5DTO `json:"participants,omitempty"` + // The ID of the game + GameID int64 `json:"gameId,omitempty"` + // The amount of time in seconds that has passed since the game started + GameLength int64 `json:"gameLength,omitempty"` + // The queue type (queue types are documented on the Game Constants page) + GameQueueConfigID int64 `json:"gameQueueConfigId,omitempty"` + // The ID of the map + MapID int64 `json:"mapId,omitempty"` } // spectator-v5.FeaturedGames type SpectatorFeaturedGamesV5DTO struct { - // The suggested interval to wait before requesting FeaturedGames again - ClientRefreshInterval int64 `json:"clientRefreshInterval,omitempty"` // The list of featured games GameList []SpectatorFeaturedGameInfoV5DTO `json:"gameList,omitempty"` + // The suggested interval to wait before requesting FeaturedGames again + ClientRefreshInterval int64 `json:"clientRefreshInterval,omitempty"` } // spectator-v5.GameCustomizationObject @@ -915,23 +915,23 @@ type SpectatorObserverV5DTO struct { // spectator-v5.Participant type SpectatorParticipantV5DTO struct { - // Flag indicating whether or not this participant is a bot - Bot bool `json:"bot,omitempty"` + // Encrypted puuid of this participant + PUUID string `json:"puuid,omitempty"` + RiotID string `json:"riotId,omitempty"` + // Encrypted summoner ID of this participant + SummonerID string `json:"summonerId,omitempty"` // The ID of the champion played by this participant ChampionID int64 `json:"championId,omitempty"` - // Encrypted puuid of this participant - PUUID string `json:"puuid,omitempty"` // The ID of the profile icon used by this participant - ProfileIconID int64 `json:"profileIconId,omitempty"` - RiotID string `json:"riotId,omitempty"` + ProfileIconID int64 `json:"profileIconId,omitempty"` // The ID of the first summoner spell used by this participant Spell1ID int64 `json:"spell1Id,omitempty"` // The ID of the second summoner spell used by this participant Spell2ID int64 `json:"spell2Id,omitempty"` - // Encrypted summoner ID of this participant - SummonerID string `json:"summonerId,omitempty"` // The team ID of this participant, indicating the participant's team TeamID int64 `json:"teamId,omitempty"` + // Flag indicating whether or not this participant is a bot + Bot bool `json:"bot,omitempty"` } // spectator-v5.Perks @@ -953,38 +953,38 @@ type StatusContentV4DTO struct { // lol-status-v4.PlatformDataDto type StatusPlatformDataV4DTO struct { ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` Incidents []StatusV4DTO `json:"incidents,omitempty"` Locales []string `json:"locales,omitempty"` Maintenances []StatusV4DTO `json:"maintenances,omitempty"` - Name string `json:"name,omitempty"` } // lol-status-v4.UpdateDto type StatusUpdateV4DTO struct { Author string `json:"author,omitempty"` CreatedAt string `json:"created_at,omitempty"` - ID int32 `json:"id,omitempty"` - Publish bool `json:"publish,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` // (Legal values: riotclient, riotstatus, game) PublishLocations []string `json:"publish_locations,omitempty"` Translations []StatusContentV4DTO `json:"translations,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` + ID int32 `json:"id,omitempty"` + Publish bool `json:"publish,omitempty"` } // lol-status-v4.StatusDto type StatusV4DTO struct { ArchiveAt string `json:"archive_at,omitempty"` CreatedAt string `json:"created_at,omitempty"` - ID int32 `json:"id,omitempty"` // (Legal values: info, warning, critical) IncidentSeverity string `json:"incident_severity,omitempty"` // (Legal values: scheduled, in_progress, complete) MaintenanceStatus string `json:"maintenance_status,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` // (Legal values: windows, macos, android, ios, ps4, xbone, switch) Platforms []string `json:"platforms,omitempty"` Titles []StatusContentV4DTO `json:"titles,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` Updates []StatusUpdateV4DTO `json:"updates,omitempty"` + ID int32 `json:"id,omitempty"` } // summoner-v4.SummonerDTO @@ -1005,10 +1005,6 @@ type SummonerV4DTO struct { // tournament-v5.TournamentCodeParametersV5 type TournamentCodeParametersV5DTO struct { - // Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future. - AllowedParticipants []string `json:"allowedParticipants,omitempty"` - // Checks if allowed participants are enough to make full teams. - EnoughPlayers bool `json:"enoughPlayers,omitempty"` // The map type of the game. // // (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) @@ -1023,14 +1019,16 @@ type TournamentCodeParametersV5DTO struct { // // (Legal values: NONE, LOBBYONLY, ALL) SpectatorType string `json:"spectatorType,omitempty"` + // Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future. + AllowedParticipants []string `json:"allowedParticipants,omitempty"` // The team size of the game. Valid values are 1-5. TeamSize int32 `json:"teamSize,omitempty"` + // Checks if allowed participants are enough to make full teams. + EnoughPlayers bool `json:"enoughPlayers,omitempty"` } // tournament-v5.TournamentCodeUpdateParametersV5 type TournamentCodeUpdateParametersV5DTO struct { - // Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future. - AllowedParticipants []string `json:"allowedParticipants,omitempty"` // The map type // // (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) @@ -1043,34 +1041,36 @@ type TournamentCodeUpdateParametersV5DTO struct { // // (Legal values: NONE, LOBBYONLY, ALL) SpectatorType string `json:"spectatorType,omitempty"` + // Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future. + AllowedParticipants []string `json:"allowedParticipants,omitempty"` } // tournament-v5.TournamentCodeV5DTO type TournamentCodeV5DTO struct { // The tournament code. Code string `json:"code,omitempty"` - // The tournament code's ID. - ID int32 `json:"id,omitempty"` // The lobby name for the tournament code game. LobbyName string `json:"lobbyName,omitempty"` // The game map for the tournament code game Map string `json:"map,omitempty"` // The metadata for tournament code. MetaData string `json:"metaData,omitempty"` - // The puuids of the participants (Encrypted) - Participants []string `json:"participants,omitempty"` // The password for the tournament code game. Password string `json:"password,omitempty"` // The pick mode for tournament code game. PickType string `json:"pickType,omitempty"` - // The provider's ID. - ProviderID int32 `json:"providerId,omitempty"` // The tournament code's region. // // (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR, PH, SG, TH, TW, VN) Region string `json:"region,omitempty"` // The spectator mode for the tournament code game. Spectators string `json:"spectators,omitempty"` + // The puuids of the participants (Encrypted) + Participants []string `json:"participants,omitempty"` + // The tournament code's ID. + ID int32 `json:"id,omitempty"` + // The provider's ID. + ProviderID int32 `json:"providerId,omitempty"` // The team size for the tournament code game. TeamSize int32 `json:"teamSize,omitempty"` // The tournament's ID. @@ -1079,20 +1079,20 @@ type TournamentCodeV5DTO struct { // tournament-v5.TournamentGamesV5 type TournamentGamesV5DTO struct { - GameID int64 `json:"gameId,omitempty"` - // Game Map ID - GameMap int32 `json:"gameMap,omitempty"` - GameMode string `json:"gameMode,omitempty"` - GameName string `json:"gameName,omitempty"` - GameType string `json:"gameType,omitempty"` - LosingTeam []TournamentTeamV5DTO `json:"losingTeam,omitempty"` + GameMode string `json:"gameMode,omitempty"` + GameName string `json:"gameName,omitempty"` + GameType string `json:"gameType,omitempty"` // Metadata for the TournamentCode MetaData string `json:"metaData,omitempty"` // Region of the game Region string `json:"region,omitempty"` // Tournament Code ShortCode string `json:"shortCode,omitempty"` + LosingTeam []TournamentTeamV5DTO `json:"losingTeam,omitempty"` WinningTeam []TournamentTeamV5DTO `json:"winningTeam,omitempty"` + GameID int64 `json:"gameId,omitempty"` + // Game Map ID + GameMap int32 `json:"gameMap,omitempty"` } // tournament-v5.LobbyEventV5DTO @@ -1130,10 +1130,6 @@ type TournamentRegistrationParametersV5DTO struct { // tournament-stub-v5.TournamentCodeParametersV5 type TournamentStubCodeParametersV5DTO struct { - // Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future. - AllowedParticipants []string `json:"allowedParticipants,omitempty"` - // Checks if allowed participants are enough to make full teams. - EnoughPlayers bool `json:"enoughPlayers,omitempty"` // The map type of the game. // // (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) @@ -1148,36 +1144,40 @@ type TournamentStubCodeParametersV5DTO struct { // // (Legal values: NONE, LOBBYONLY, ALL) SpectatorType string `json:"spectatorType,omitempty"` + // Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future. + AllowedParticipants []string `json:"allowedParticipants,omitempty"` // The team size of the game. Valid values are 1-5. TeamSize int32 `json:"teamSize,omitempty"` + // Checks if allowed participants are enough to make full teams. + EnoughPlayers bool `json:"enoughPlayers,omitempty"` } // tournament-stub-v5.TournamentCodeV5DTO type TournamentStubCodeV5DTO struct { // The tournament code. Code string `json:"code,omitempty"` - // The tournament code's ID. - ID int32 `json:"id,omitempty"` // The lobby name for the tournament code game. LobbyName string `json:"lobbyName,omitempty"` // The game map for the tournament code game Map string `json:"map,omitempty"` // The metadata for tournament code. MetaData string `json:"metaData,omitempty"` - // The puuids of the participants (Encrypted) - Participants []string `json:"participants,omitempty"` // The password for the tournament code game. Password string `json:"password,omitempty"` // The pick mode for tournament code game. PickType string `json:"pickType,omitempty"` - // The provider's ID. - ProviderID int32 `json:"providerId,omitempty"` // The tournament code's region. // // (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR) Region string `json:"region,omitempty"` // The spectator mode for the tournament code game. Spectators string `json:"spectators,omitempty"` + // The puuids of the participants (Encrypted) + Participants []string `json:"participants,omitempty"` + // The tournament code's ID. + ID int32 `json:"id,omitempty"` + // The provider's ID. + ProviderID int32 `json:"providerId,omitempty"` // The team size for the tournament code game. TeamSize int32 `json:"teamSize,omitempty"` // The tournament's ID. diff --git a/clients/tft/models.go b/clients/tft/models.go index b70d02b..79c6464 100644 --- a/clients/tft/models.go +++ b/clients/tft/models.go @@ -12,28 +12,14 @@ package tft // tft-league-v1.LeagueEntryDTO type LeagueEntryV1DTO struct { - // Not included for the RANKED_TFT_TURBO queueType. - FreshBlood bool `json:"freshBlood,omitempty"` - // Not included for the RANKED_TFT_TURBO queueType. - HotStreak bool `json:"hotStreak,omitempty"` - // Not included for the RANKED_TFT_TURBO queueType. - Inactive bool `json:"inactive,omitempty"` // Not included for the RANKED_TFT_TURBO queueType. LeagueID string `json:"leagueId,omitempty"` - // Not included for the RANKED_TFT_TURBO queueType. - LeaguePoints int32 `json:"leaguePoints,omitempty"` - // Second through eighth placement. - Losses int32 `json:"losses,omitempty"` - // Not included for the RANKED_TFT_TURBO queueType. - MiniSeries LeagueMiniSeriesV1DTO `json:"miniSeries,omitempty"` // Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) PUUID string `json:"puuid,omitempty"` QueueType QueueType `json:"queueType,omitempty"` // The player's division within a tier. Not included for the RANKED_TFT_TURBO queueType. Rank Division `json:"rank,omitempty"` // Only included for the RANKED_TFT_TURBO queueType. - RatedRating int32 `json:"ratedRating,omitempty"` - // Only included for the RANKED_TFT_TURBO queueType. // // (Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY) RatedTier string `json:"ratedTier,omitempty"` @@ -42,52 +28,66 @@ type LeagueEntryV1DTO struct { // Not included for the RANKED_TFT_TURBO queueType. Tier Tier `json:"tier,omitempty"` // Not included for the RANKED_TFT_TURBO queueType. - Veteran bool `json:"veteran,omitempty"` + MiniSeries LeagueMiniSeriesV1DTO `json:"miniSeries,omitempty"` + // Not included for the RANKED_TFT_TURBO queueType. + LeaguePoints int32 `json:"leaguePoints,omitempty"` + // Second through eighth placement. + Losses int32 `json:"losses,omitempty"` + // Only included for the RANKED_TFT_TURBO queueType. + RatedRating int32 `json:"ratedRating,omitempty"` // First placement. Wins int32 `json:"wins,omitempty"` + // Not included for the RANKED_TFT_TURBO queueType. + FreshBlood bool `json:"freshBlood,omitempty"` + // Not included for the RANKED_TFT_TURBO queueType. + HotStreak bool `json:"hotStreak,omitempty"` + // Not included for the RANKED_TFT_TURBO queueType. + Inactive bool `json:"inactive,omitempty"` + // Not included for the RANKED_TFT_TURBO queueType. + Veteran bool `json:"veteran,omitempty"` } // tft-league-v1.LeagueItemDTO type LeagueItemV1DTO struct { - FreshBlood bool `json:"freshBlood,omitempty"` - HotStreak bool `json:"hotStreak,omitempty"` - Inactive bool `json:"inactive,omitempty"` - LeaguePoints int32 `json:"leaguePoints,omitempty"` - // Second through eighth placement. - Losses int32 `json:"losses,omitempty"` - MiniSeries LeagueMiniSeriesV1DTO `json:"miniSeries,omitempty"` - Rank Division `json:"rank,omitempty"` + Rank Division `json:"rank,omitempty"` // Player's encrypted summonerId. - SummonerID string `json:"summonerId,omitempty"` - Veteran bool `json:"veteran,omitempty"` + SummonerID string `json:"summonerId,omitempty"` + MiniSeries LeagueMiniSeriesV1DTO `json:"miniSeries,omitempty"` + LeaguePoints int32 `json:"leaguePoints,omitempty"` + // Second through eighth placement. + Losses int32 `json:"losses,omitempty"` // First placement. - Wins int32 `json:"wins,omitempty"` + Wins int32 `json:"wins,omitempty"` + FreshBlood bool `json:"freshBlood,omitempty"` + HotStreak bool `json:"hotStreak,omitempty"` + Inactive bool `json:"inactive,omitempty"` + Veteran bool `json:"veteran,omitempty"` } // tft-league-v1.LeagueListDTO type LeagueListV1DTO struct { - Entries []LeagueItemV1DTO `json:"entries,omitempty"` LeagueID string `json:"leagueId,omitempty"` Name string `json:"name,omitempty"` Queue QueueType `json:"queue,omitempty"` Tier Tier `json:"tier,omitempty"` + Entries []LeagueItemV1DTO `json:"entries,omitempty"` } // tft-league-v1.MiniSeriesDTO type LeagueMiniSeriesV1DTO struct { - Losses int32 `json:"losses,omitempty"` Progress string `json:"progress,omitempty"` + Losses int32 `json:"losses,omitempty"` Target int32 `json:"target,omitempty"` Wins int32 `json:"wins,omitempty"` } // tft-league-v1.TopRatedLadderEntryDto type LeagueTopRatedLadderEntryV1DTO struct { - PreviousUpdateLadderPosition int32 `json:"previousUpdateLadderPosition,omitempty"` - RatedRating int32 `json:"ratedRating,omitempty"` // (Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY) - RatedTier string `json:"ratedTier,omitempty"` - SummonerID string `json:"summonerId,omitempty"` + RatedTier string `json:"ratedTier,omitempty"` + SummonerID string `json:"summonerId,omitempty"` + PreviousUpdateLadderPosition int32 `json:"previousUpdateLadderPosition,omitempty"` + RatedRating int32 `json:"ratedRating,omitempty"` // First placement. Wins int32 `json:"wins,omitempty"` } @@ -95,32 +95,32 @@ type LeagueTopRatedLadderEntryV1DTO struct { // tft-match-v1.CompanionDto type MatchCompanionV1DTO struct { ContentID string `json:"content_ID,omitempty"` + Species string `json:"species,omitempty"` ItemID int32 `json:"item_ID,omitempty"` SkinID int32 `json:"skin_ID,omitempty"` - Species string `json:"species,omitempty"` } // tft-match-v1.InfoDto type MatchInfoV1DTO struct { EndOfGameResult string `json:"endOfGameResult,omitempty"` - GameCreation int64 `json:"gameCreation,omitempty"` + // Game variation key. Game variations documented in TFT static data. + GameVariation string `json:"game_variation,omitempty"` + // Game client version. + GameVersion string `json:"game_version,omitempty"` + TFTGameType string `json:"tft_game_type,omitempty"` + TFTSetCoreName string `json:"tft_set_core_name,omitempty"` + Participants []MatchParticipantV1DTO `json:"participants,omitempty"` + GameCreation int64 `json:"gameCreation,omitempty"` // Unix timestamp. GameDatetime int64 `json:"game_datetime,omitempty"` GameID int64 `json:"gameId,omitempty"` + MapID int64 `json:"mapId,omitempty"` // Game length in seconds. GameLength float32 `json:"game_length,omitempty"` - // Game variation key. Game variations documented in TFT static data. - GameVariation string `json:"game_variation,omitempty"` - // Game client version. - GameVersion string `json:"game_version,omitempty"` - MapID int64 `json:"mapId,omitempty"` - Participants []MatchParticipantV1DTO `json:"participants,omitempty"` // Please refer to the League of Legends documentation. QueueID int32 `json:"queueId,omitempty"` // Please refer to the League of Legends documentation. - QueueID_ int32 `json:"queue_id,omitempty"` - TFTGameType string `json:"tft_game_type,omitempty"` - TFTSetCoreName string `json:"tft_set_core_name,omitempty"` + QueueID_ int32 `json:"queue_id,omitempty"` // Teamfight Tactics set number. TFTSetNumber int32 `json:"tft_set_number,omitempty"` } @@ -189,18 +189,22 @@ type MatchParticipantMissionsV1DTO struct { // tft-match-v1.ParticipantDto type MatchParticipantV1DTO struct { - Augments []string `json:"augments,omitempty"` // Participant's companion. Companion MatchCompanionV1DTO `json:"companion,omitempty"` + PUUID string `json:"puuid,omitempty"` + Augments []string `json:"augments,omitempty"` + // A complete list of traits for the participant's active units. + Traits []MatchTraitV1DTO `json:"traits,omitempty"` + // A list of active units for the participant. + Units []MatchUnitV1DTO `json:"units,omitempty"` + Missions MatchParticipantMissionsV1DTO `json:"missions,omitempty"` // Gold left after participant was eliminated. GoldLeft int32 `json:"gold_left,omitempty"` // The round the participant was eliminated in. Note: If the player was eliminated in stage 2-1 their last_round would be 5. LastRound int32 `json:"last_round,omitempty"` // Participant Little Legend level. Note: This is not the number of active units. - Level int32 `json:"level,omitempty"` - Missions MatchParticipantMissionsV1DTO `json:"missions,omitempty"` - PUUID string `json:"puuid,omitempty"` - PartnerGroupID int32 `json:"partner_group_id,omitempty"` + Level int32 `json:"level,omitempty"` + PartnerGroupID int32 `json:"partner_group_id,omitempty"` // Participant placement upon elimination. Placement int32 `json:"placement,omitempty"` // Number of players the participant eliminated. @@ -209,10 +213,6 @@ type MatchParticipantV1DTO struct { TimeEliminated float32 `json:"time_eliminated,omitempty"` // Damage the participant dealt to other players. TotalDamageToPlayers int32 `json:"total_damage_to_players,omitempty"` - // A complete list of traits for the participant's active units. - Traits []MatchTraitV1DTO `json:"traits,omitempty"` - // A list of active units for the participant. - Units []MatchUnitV1DTO `json:"units,omitempty"` } // tft-match-v1.TraitDto @@ -234,12 +234,12 @@ type MatchUnitV1DTO struct { // This field was introduced in patch 9.22 with data_version 2. CharacterID string `json:"character_id,omitempty"` // 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. - Chosen string `json:"chosen,omitempty"` + Chosen string `json:"chosen,omitempty"` + // Unit name. This field is often left blank. + Name string `json:"name,omitempty"` ItemNames []string `json:"itemNames,omitempty"` // A list of the unit's items. Please refer to the Teamfight Tactics documentation for item ids. Items []int32 `json:"items,omitempty"` - // Unit name. This field is often left blank. - Name string `json:"name,omitempty"` // Unit rarity. This doesn't equate to the unit cost. Rarity int32 `json:"rarity,omitempty"` // Unit tier. @@ -248,10 +248,10 @@ type MatchUnitV1DTO struct { // tft-match-v1.MatchDto type MatchV1DTO struct { - // Match info. - Info MatchInfoV1DTO `json:"info,omitempty"` // Match metadata. Metadata MatchMetadataV1DTO `json:"metadata,omitempty"` + // Match info. + Info MatchInfoV1DTO `json:"info,omitempty"` } // spectator-tft-v5.BannedChampion @@ -266,87 +266,87 @@ type SpectatorBannedChampionV5DTO struct { // spectator-tft-v5.CurrentGameInfo type SpectatorCurrentGameInfoV5DTO struct { + // The game mode + GameMode GameMode `json:"gameMode,omitempty"` + // The game type + GameType GameType `json:"gameType,omitempty"` + // The observer information + Observers SpectatorObserverV5DTO `json:"observers,omitempty"` + // The ID of the platform on which the game is being played + PlatformID string `json:"platformId,omitempty"` // Banned champion information BannedChampions []SpectatorBannedChampionV5DTO `json:"bannedChampions,omitempty"` + // The participant information + Participants []SpectatorCurrentGameParticipantV5DTO `json:"participants,omitempty"` // The ID of the game GameID int64 `json:"gameId,omitempty"` // The amount of time in seconds that has passed since the game started GameLength int64 `json:"gameLength,omitempty"` - // The game mode - GameMode GameMode `json:"gameMode,omitempty"` // The queue type (queue types are documented on the Game Constants page) GameQueueConfigID int64 `json:"gameQueueConfigId,omitempty"` // The game start time represented in epoch milliseconds GameStartTime int64 `json:"gameStartTime,omitempty"` - // The game type - GameType GameType `json:"gameType,omitempty"` // The ID of the map MapID int64 `json:"mapId,omitempty"` - // The observer information - Observers SpectatorObserverV5DTO `json:"observers,omitempty"` - // The participant information - Participants []SpectatorCurrentGameParticipantV5DTO `json:"participants,omitempty"` - // The ID of the platform on which the game is being played - PlatformID string `json:"platformId,omitempty"` } // spectator-tft-v5.CurrentGameParticipant type SpectatorCurrentGameParticipantV5DTO struct { - // The ID of the champion played by this participant - ChampionID int64 `json:"championId,omitempty"` + // The encrypted puuid of this participant + PUUID string `json:"puuid,omitempty"` + RiotID string `json:"riotId,omitempty"` + // The encrypted summoner ID of this participant + SummonerID string `json:"summonerId,omitempty"` // List of Game Customizations GameCustomizationObjects []SpectatorGameCustomizationObjectV5DTO `json:"gameCustomizationObjects,omitempty"` - // The encrypted puuid of this participant - PUUID string `json:"puuid,omitempty"` // Perks/Runes Reforged Information Perks SpectatorPerksV5DTO `json:"perks,omitempty"` + // The ID of the champion played by this participant + ChampionID int64 `json:"championId,omitempty"` // The ID of the profile icon used by this participant - ProfileIconID int64 `json:"profileIconId,omitempty"` - RiotID string `json:"riotId,omitempty"` + ProfileIconID int64 `json:"profileIconId,omitempty"` // The ID of the first summoner spell used by this participant Spell1ID int64 `json:"spell1Id,omitempty"` // The ID of the second summoner spell used by this participant Spell2ID int64 `json:"spell2Id,omitempty"` - // The encrypted summoner ID of this participant - SummonerID string `json:"summonerId,omitempty"` // The team ID of this participant, indicating the participant's team TeamID int64 `json:"teamId,omitempty"` } // spectator-tft-v5.FeaturedGameInfo type SpectatorFeaturedGameInfoV5DTO struct { - // Banned champion information - BannedChampions []SpectatorBannedChampionV5DTO `json:"bannedChampions,omitempty"` - // The ID of the game - GameID int64 `json:"gameId,omitempty"` - // The amount of time in seconds that has passed since the game started - GameLength int64 `json:"gameLength,omitempty"` // The game mode // // (Legal values: TFT) GameMode GameMode `json:"gameMode,omitempty"` - // The queue type (queue types are documented on the Game Constants page) - GameQueueConfigID int64 `json:"gameQueueConfigId,omitempty"` // The game type // // (Legal values: MATCHED) GameType GameType `json:"gameType,omitempty"` - // The ID of the map - MapID int64 `json:"mapId,omitempty"` // The observer information Observers SpectatorObserverV5DTO `json:"observers,omitempty"` - // The participant information - Participants []SpectatorParticipantV5DTO `json:"participants,omitempty"` // The ID of the platform on which the game is being played PlatformID string `json:"platformId,omitempty"` + // Banned champion information + BannedChampions []SpectatorBannedChampionV5DTO `json:"bannedChampions,omitempty"` + // The participant information + Participants []SpectatorParticipantV5DTO `json:"participants,omitempty"` + // The ID of the game + GameID int64 `json:"gameId,omitempty"` + // The amount of time in seconds that has passed since the game started + GameLength int64 `json:"gameLength,omitempty"` + // The queue type (queue types are documented on the Game Constants page) + GameQueueConfigID int64 `json:"gameQueueConfigId,omitempty"` + // The ID of the map + MapID int64 `json:"mapId,omitempty"` } // spectator-tft-v5.FeaturedGames type SpectatorFeaturedGamesV5DTO struct { - // The suggested interval to wait before requesting FeaturedGames again - ClientRefreshInterval int64 `json:"clientRefreshInterval,omitempty"` // The list of featured games GameList []SpectatorFeaturedGameInfoV5DTO `json:"gameList,omitempty"` + // The suggested interval to wait before requesting FeaturedGames again + ClientRefreshInterval int64 `json:"clientRefreshInterval,omitempty"` } // spectator-tft-v5.GameCustomizationObject @@ -365,19 +365,19 @@ type SpectatorObserverV5DTO struct { // spectator-tft-v5.Participant type SpectatorParticipantV5DTO struct { + // Encrypted puuid of this participant + PUUID string `json:"puuid,omitempty"` + RiotID string `json:"riotId,omitempty"` + // Encrypted summoner ID of this participant + SummonerID string `json:"summonerId,omitempty"` // The ID of the champion played by this participant ChampionID int64 `json:"championId,omitempty"` - // Encrypted puuid of this participant - PUUID string `json:"puuid,omitempty"` // The ID of the profile icon used by this participant - ProfileIconID int64 `json:"profileIconId,omitempty"` - RiotID string `json:"riotId,omitempty"` + ProfileIconID int64 `json:"profileIconId,omitempty"` // The ID of the first summoner spell used by this participant Spell1ID int64 `json:"spell1Id,omitempty"` // The ID of the second summoner spell used by this participant Spell2ID int64 `json:"spell2Id,omitempty"` - // Encrypted summoner ID of this participant - SummonerID string `json:"summonerId,omitempty"` // The team ID of this participant, indicating the participant's team TeamID int64 `json:"teamId,omitempty"` } @@ -401,38 +401,38 @@ type StatusContentV1DTO struct { // tft-status-v1.PlatformDataDto type StatusPlatformDataV1DTO struct { ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` Incidents []StatusV1DTO `json:"incidents,omitempty"` Locales []string `json:"locales,omitempty"` Maintenances []StatusV1DTO `json:"maintenances,omitempty"` - Name string `json:"name,omitempty"` } // tft-status-v1.UpdateDto type StatusUpdateV1DTO struct { Author string `json:"author,omitempty"` CreatedAt string `json:"created_at,omitempty"` - ID int32 `json:"id,omitempty"` - Publish bool `json:"publish,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` // (Legal values: riotclient, riotstatus, game) PublishLocations []string `json:"publish_locations,omitempty"` Translations []StatusContentV1DTO `json:"translations,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` + ID int32 `json:"id,omitempty"` + Publish bool `json:"publish,omitempty"` } // tft-status-v1.StatusDto type StatusV1DTO struct { ArchiveAt string `json:"archive_at,omitempty"` CreatedAt string `json:"created_at,omitempty"` - ID int32 `json:"id,omitempty"` // (Legal values: info, warning, critical) IncidentSeverity string `json:"incident_severity,omitempty"` // (Legal values: scheduled, in_progress, complete) MaintenanceStatus string `json:"maintenance_status,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` // (Legal values: windows, macos, android, ios, ps4, xbone, switch) Platforms []string `json:"platforms,omitempty"` Titles []StatusContentV1DTO `json:"titles,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` Updates []StatusUpdateV1DTO `json:"updates,omitempty"` + ID int32 `json:"id,omitempty"` } // tft-summoner-v1.SummonerDTO diff --git a/clients/val/models.go b/clients/val/models.go index b9b944b..3d58a5f 100644 --- a/clients/val/models.go +++ b/clients/val/models.go @@ -12,13 +12,13 @@ package val // val-content-v1.ActDto type ContentActV1DTO struct { - ID string `json:"id,omitempty"` - IsActive bool `json:"isActive,omitempty"` // This field is excluded from the response when a locale is set LocalizedNames ContentLocalizedNamesV1DTO `json:"localizedNames,omitempty"` + ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` ParentID string `json:"parentId,omitempty"` Type string `json:"type,omitempty"` + IsActive bool `json:"isActive,omitempty"` } // val-content-v1.ContentItemDto @@ -57,6 +57,7 @@ type ContentLocalizedNamesV1DTO struct { // val-content-v1.ContentDto type ContentV1DTO struct { + Version string `json:"version,omitempty"` Acts []ContentActV1DTO `json:"acts,omitempty"` Ceremonies []ContentItemV1DTO `json:"ceremonies,omitempty"` Characters []ContentItemV1DTO `json:"characters,omitempty"` @@ -73,8 +74,7 @@ type ContentV1DTO struct { SprayLevels []ContentItemV1DTO `json:"sprayLevels,omitempty"` Sprays []ContentItemV1DTO `json:"sprays,omitempty"` // Unknown type, this is a placeholder subject to change. - Totems []string `json:"totems,omitempty"` - Version string `json:"version,omitempty"` + Totems []string `json:"totems,omitempty"` } // val-match-v1.AbilityCastsDto @@ -101,21 +101,21 @@ type MatchCoachV1DTO struct { // val-match-v1.DamageDto type MatchDamageV1DTO struct { - Bodyshots int32 `json:"bodyshots,omitempty"` - Damage int32 `json:"damage,omitempty"` - Headshots int32 `json:"headshots,omitempty"` - Legshots int32 `json:"legshots,omitempty"` // PUUID - Receiver string `json:"receiver,omitempty"` + Receiver string `json:"receiver,omitempty"` + Bodyshots int32 `json:"bodyshots,omitempty"` + Damage int32 `json:"damage,omitempty"` + Headshots int32 `json:"headshots,omitempty"` + Legshots int32 `json:"legshots,omitempty"` } // val-match-v1.EconomyDto type MatchEconomyV1DTO struct { Armor string `json:"armor,omitempty"` + Weapon string `json:"weapon,omitempty"` LoadoutValue int32 `json:"loadoutValue,omitempty"` Remaining int32 `json:"remaining,omitempty"` Spent int32 `json:"spent,omitempty"` - Weapon string `json:"weapon,omitempty"` } // val-match-v1.FinishingDamageDto @@ -127,35 +127,35 @@ type MatchFinishingDamageV1DTO struct { // val-match-v1.MatchInfoDto type MatchInfoV1DTO struct { + PremierMatchInfo map[string]any `json:"premierMatchInfo,omitempty"` CustomGameName string `json:"customGameName,omitempty"` - GameLengthMillis int32 `json:"gameLengthMillis,omitempty"` GameMode string `json:"gameMode,omitempty"` - GameStartMillis int64 `json:"gameStartMillis,omitempty"` GameVersion string `json:"gameVersion,omitempty"` - IsCompleted bool `json:"isCompleted,omitempty"` - IsRanked bool `json:"isRanked,omitempty"` MapID string `json:"mapId,omitempty"` MatchID string `json:"matchId,omitempty"` - PremierMatchInfo map[string]any `json:"premierMatchInfo,omitempty"` ProvisioningFlowID string `json:"provisioningFlowId,omitempty"` QueueID string `json:"queueId,omitempty"` Region string `json:"region,omitempty"` SeasonID string `json:"seasonId,omitempty"` + GameStartMillis int64 `json:"gameStartMillis,omitempty"` + GameLengthMillis int32 `json:"gameLengthMillis,omitempty"` + IsCompleted bool `json:"isCompleted,omitempty"` + IsRanked bool `json:"isRanked,omitempty"` } // val-match-v1.KillDto type MatchKillV1DTO struct { - // List of PUUIDs - Assistants []string `json:"assistants,omitempty"` - FinishingDamage MatchFinishingDamageV1DTO `json:"finishingDamage,omitempty"` // PUUID - Killer string `json:"killer,omitempty"` + Killer string `json:"killer,omitempty"` + // PUUID + Victim string `json:"victim,omitempty"` + FinishingDamage MatchFinishingDamageV1DTO `json:"finishingDamage,omitempty"` + // List of PUUIDs + Assistants []string `json:"assistants,omitempty"` PlayerLocations []MatchPlayerLocationsV1DTO `json:"playerLocations,omitempty"` + VictimLocation MatchLocationV1DTO `json:"victimLocation,omitempty"` TimeSinceGameStartMillis int32 `json:"timeSinceGameStartMillis,omitempty"` TimeSinceRoundStartMillis int32 `json:"timeSinceRoundStartMillis,omitempty"` - // PUUID - Victim string `json:"victim,omitempty"` - VictimLocation MatchLocationV1DTO `json:"victimLocation,omitempty"` } // val-match-v1.LocationDto @@ -166,18 +166,18 @@ type MatchLocationV1DTO struct { // val-match-v1.PlayerLocationsDto type MatchPlayerLocationsV1DTO struct { - Location MatchLocationV1DTO `json:"location,omitempty"` PUUID string `json:"puuid,omitempty"` + Location MatchLocationV1DTO `json:"location,omitempty"` ViewRadians float32 `json:"viewRadians,omitempty"` } // val-match-v1.PlayerRoundStatsDto type MatchPlayerRoundStatsV1DTO struct { Ability MatchAbilityV1DTO `json:"ability,omitempty"` + PUUID string `json:"puuid,omitempty"` Damage []MatchDamageV1DTO `json:"damage,omitempty"` - Economy MatchEconomyV1DTO `json:"economy,omitempty"` Kills []MatchKillV1DTO `json:"kills,omitempty"` - PUUID string `json:"puuid,omitempty"` + Economy MatchEconomyV1DTO `json:"economy,omitempty"` Score int32 `json:"score,omitempty"` } @@ -194,25 +194,25 @@ type MatchPlayerStatsV1DTO struct { // val-match-v1.PlayerDto type MatchPlayerV1DTO struct { - AccountLevel int32 `json:"accountLevel,omitempty"` CharacterID string `json:"characterId,omitempty"` - CompetitiveTier int32 `json:"competitiveTier,omitempty"` GameName string `json:"gameName,omitempty"` - IsObserver bool `json:"isObserver,omitempty"` PUUID string `json:"puuid,omitempty"` PartyID string `json:"partyId,omitempty"` PlayerCard string `json:"playerCard,omitempty"` PlayerTitle string `json:"playerTitle,omitempty"` - Stats MatchPlayerStatsV1DTO `json:"stats,omitempty"` TagLine string `json:"tagLine,omitempty"` TeamID string `json:"teamId,omitempty"` + Stats MatchPlayerStatsV1DTO `json:"stats,omitempty"` + AccountLevel int32 `json:"accountLevel,omitempty"` + CompetitiveTier int32 `json:"competitiveTier,omitempty"` + IsObserver bool `json:"isObserver,omitempty"` } // val-match-v1.RecentMatchesDto type MatchRecentMatchesV1DTO struct { - CurrentTime int64 `json:"currentTime,omitempty"` // A list of recent match ids. - MatchIDs []string `json:"matchIds,omitempty"` + MatchIDs []string `json:"matchIds,omitempty"` + CurrentTime int64 `json:"currentTime,omitempty"` } // val-match-v1.RoundResultDto @@ -221,83 +221,83 @@ type MatchRoundResultV1DTO struct { BombDefuser string `json:"bombDefuser,omitempty"` // PUUID of player BombPlanter string `json:"bombPlanter,omitempty"` - DefuseLocation MatchLocationV1DTO `json:"defuseLocation,omitempty"` - DefusePlayerLocations []MatchPlayerLocationsV1DTO `json:"defusePlayerLocations,omitempty"` - DefuseRoundTime int32 `json:"defuseRoundTime,omitempty"` - PlantLocation MatchLocationV1DTO `json:"plantLocation,omitempty"` - PlantPlayerLocations []MatchPlayerLocationsV1DTO `json:"plantPlayerLocations,omitempty"` - PlantRoundTime int32 `json:"plantRoundTime,omitempty"` PlantSite string `json:"plantSite,omitempty"` - PlayerStats []MatchPlayerRoundStatsV1DTO `json:"playerStats,omitempty"` RoundCeremony string `json:"roundCeremony,omitempty"` - RoundNum int32 `json:"roundNum,omitempty"` RoundResult string `json:"roundResult,omitempty"` RoundResultCode string `json:"roundResultCode,omitempty"` WinningTeam string `json:"winningTeam,omitempty"` + DefusePlayerLocations []MatchPlayerLocationsV1DTO `json:"defusePlayerLocations,omitempty"` + PlantPlayerLocations []MatchPlayerLocationsV1DTO `json:"plantPlayerLocations,omitempty"` + PlayerStats []MatchPlayerRoundStatsV1DTO `json:"playerStats,omitempty"` + DefuseLocation MatchLocationV1DTO `json:"defuseLocation,omitempty"` + PlantLocation MatchLocationV1DTO `json:"plantLocation,omitempty"` + DefuseRoundTime int32 `json:"defuseRoundTime,omitempty"` + PlantRoundTime int32 `json:"plantRoundTime,omitempty"` + RoundNum int32 `json:"roundNum,omitempty"` } // val-match-v1.TeamDto type MatchTeamV1DTO struct { + // This is an arbitrary string. Red and Blue in bomb modes. The puuid of the player in deathmatch. + TeamID string `json:"teamId,omitempty"` // Team points scored. Number of kills in deathmatch. NumPoints int32 `json:"numPoints,omitempty"` RoundsPlayed int32 `json:"roundsPlayed,omitempty"` RoundsWon int32 `json:"roundsWon,omitempty"` - // This is an arbitrary string. Red and Blue in bomb modes. The puuid of the player in deathmatch. - TeamID string `json:"teamId,omitempty"` - Won bool `json:"won,omitempty"` + Won bool `json:"won,omitempty"` } // val-match-v1.MatchDto type MatchV1DTO struct { Coaches []MatchCoachV1DTO `json:"coaches,omitempty"` - MatchInfo MatchInfoV1DTO `json:"matchInfo,omitempty"` Players []MatchPlayerV1DTO `json:"players,omitempty"` RoundResults []MatchRoundResultV1DTO `json:"roundResults,omitempty"` Teams []MatchTeamV1DTO `json:"teams,omitempty"` + MatchInfo MatchInfoV1DTO `json:"matchInfo,omitempty"` } // val-match-v1.MatchlistEntryDto type MatchlistEntryV1DTO struct { - GameStartTimeMillis int64 `json:"gameStartTimeMillis,omitempty"` MatchID string `json:"matchId,omitempty"` QueueID string `json:"queueId,omitempty"` + GameStartTimeMillis int64 `json:"gameStartTimeMillis,omitempty"` } // val-match-v1.MatchlistDto type MatchlistV1DTO struct { - History []MatchlistEntryV1DTO `json:"history,omitempty"` PUUID string `json:"puuid,omitempty"` + History []MatchlistEntryV1DTO `json:"history,omitempty"` } // val-ranked-v1.LeaderboardDto type RankedLeaderboardV1DTO struct { + TierDetails map[int64]RankedTierDetailV1DTO `json:"tierDetails,omitempty"` // The act id for the given leaderboard. Act ids can be found using the val-content API. - ActID string `json:"actId,omitempty"` + ActID string `json:"actId,omitempty"` + Query string `json:"query,omitempty"` + // The shard for the given leaderboard. + Shard string `json:"shard,omitempty"` + Players []RankedPlayerV1DTO `json:"players,omitempty"` ImmortalStartingIndex int64 `json:"immortalStartingIndex,omitempty"` ImmortalStartingPage int64 `json:"immortalStartingPage,omitempty"` - Players []RankedPlayerV1DTO `json:"players,omitempty"` - Query string `json:"query,omitempty"` - // The shard for the given leaderboard. - Shard string `json:"shard,omitempty"` - StartIndex int64 `json:"startIndex,omitempty"` - TierDetails map[int64]RankedTierDetailV1DTO `json:"tierDetails,omitempty"` - TopTierRrthreshold int64 `json:"topTierRRThreshold,omitempty"` + StartIndex int64 `json:"startIndex,omitempty"` + TopTierRrthreshold int64 `json:"topTierRRThreshold,omitempty"` // The total number of players in the leaderboard. TotalPlayers int64 `json:"totalPlayers,omitempty"` } // val-ranked-v1.PlayerDto type RankedPlayerV1DTO struct { - CompetitiveTier int64 `json:"competitiveTier,omitempty"` // This field may be omitted if the player has been anonymized. - GameName string `json:"gameName,omitempty"` - LeaderboardRank int64 `json:"leaderboardRank,omitempty"` - NumberOfWins int64 `json:"numberOfWins,omitempty"` + GameName string `json:"gameName,omitempty"` // This field may be omitted if the player has been anonymized. - PUUID string `json:"puuid,omitempty"` - RankedRating int64 `json:"rankedRating,omitempty"` + PUUID string `json:"puuid,omitempty"` // This field may be omitted if the player has been anonymized. - TagLine string `json:"tagLine,omitempty"` + TagLine string `json:"tagLine,omitempty"` + CompetitiveTier int64 `json:"competitiveTier,omitempty"` + LeaderboardRank int64 `json:"leaderboardRank,omitempty"` + NumberOfWins int64 `json:"numberOfWins,omitempty"` + RankedRating int64 `json:"rankedRating,omitempty"` } // val-ranked-v1.TierDetailDto @@ -316,36 +316,36 @@ type StatusContentV1DTO struct { // val-status-v1.PlatformDataDto type StatusPlatformDataV1DTO struct { ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` Incidents []StatusV1DTO `json:"incidents,omitempty"` Locales []string `json:"locales,omitempty"` Maintenances []StatusV1DTO `json:"maintenances,omitempty"` - Name string `json:"name,omitempty"` } // val-status-v1.UpdateDto type StatusUpdateV1DTO struct { Author string `json:"author,omitempty"` CreatedAt string `json:"created_at,omitempty"` - ID int32 `json:"id,omitempty"` - Publish bool `json:"publish,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` // (Legal values: riotclient, riotstatus, game) PublishLocations []string `json:"publish_locations,omitempty"` Translations []StatusContentV1DTO `json:"translations,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` + ID int32 `json:"id,omitempty"` + Publish bool `json:"publish,omitempty"` } // val-status-v1.StatusDto type StatusV1DTO struct { ArchiveAt string `json:"archive_at,omitempty"` CreatedAt string `json:"created_at,omitempty"` - ID int32 `json:"id,omitempty"` // (Legal values: info, warning, critical) IncidentSeverity string `json:"incident_severity,omitempty"` // (Legal values: scheduled, in_progress, complete) MaintenanceStatus string `json:"maintenance_status,omitempty"` + UpdatedAt string `json:"updated_at,omitempty"` // (Legal values: windows, macos, android, ios, ps4, xbone, switch) Platforms []string `json:"platforms,omitempty"` Titles []StatusContentV1DTO `json:"titles,omitempty"` - UpdatedAt string `json:"updated_at,omitempty"` Updates []StatusUpdateV1DTO `json:"updates,omitempty"` + ID int32 `json:"id,omitempty"` } diff --git a/internal/client.go b/internal/client.go index b550550..1800464 100644 --- a/internal/client.go +++ b/internal/client.go @@ -131,9 +131,10 @@ func (c *Client) Execute(ctx context.Context, equinoxReq api.EquinoxRequest, tar return ErrContextIsNil } + revalidate := ctx.Value(api.Revalidate) key := GetCacheKey(equinoxReq) - if c.IsCacheEnabled && equinoxReq.Request.Method == http.MethodGet { + if c.IsCacheEnabled && equinoxReq.Request.Method == http.MethodGet && revalidate == nil { item, err := c.cache.Get(ctx, key) if err != nil { equinoxReq.Logger.Error().Err(err).Msg("Error retrieving cached response") @@ -209,7 +210,7 @@ func (c *Client) Execute(ctx context.Context, equinoxReq api.EquinoxRequest, tar return nil } -// Executes a 'EquinoxRequest', skips cache check and returns []byte. +// Executes a 'EquinoxRequest', skips checking cache and returns []byte. func (c *Client) ExecuteBytes(ctx context.Context, equinoxReq api.EquinoxRequest) ([]byte, error) { equinoxReq.Logger.Trace().Msg("ExecuteBytes") diff --git a/internal/client_test.go b/internal/client_test.go index fd1159f..21099b9 100644 --- a/internal/client_test.go +++ b/internal/client_test.go @@ -54,7 +54,7 @@ func TestNewInternalClient(t *testing.T) { require.True(t, internalClient.IsRetryEnabled) } -func TestGetURLWithAuthorizationHash(t *testing.T) { +func TestGetCacheKey(t *testing.T) { t.Parallel() req := &http.Request{ @@ -72,9 +72,9 @@ func TestGetURLWithAuthorizationHash(t *testing.T) { hash := internal.GetCacheKey(equinoxReq) require.Equal(t, "http://example.com/path", hash) - req.Header.Set("Authorization", "7267ee00-5696-47b8-9cae-8db3d49c8c33") + req.Header.Set("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghij") hash = internal.GetCacheKey(equinoxReq) - require.Equal(t, "http://example.com/path-45da11db1ebd17ee0c32aca62e08923ea4f15590058ff1e15661bc13ed33df9d", hash) + require.Equal(t, "http://example.com/path-ec2cc2a7cbc79c8d8def89cb9b9a1bccf4c2efc56a9c8063f9f4ae806f08c4d7", hash) } func TestStatusCodeToError(t *testing.T) {