Documentation
¶
Index ¶
- Constants
- type BannedChampionDTO
- type ChampionEndpoint
- type ChampionMasteryDTO
- type ChampionMasteryEndpoint
- func (c *ChampionMasteryEndpoint) ChampionScore(region Region, summonerID string, championID int) (*ChampionMasteryDTO, error)
- func (c *ChampionMasteryEndpoint) MasteryScoreSum(region Region, summonerID string) (int, error)
- func (c *ChampionMasteryEndpoint) SummonerMasteries(region Region, summonerID string) (*[]ChampionMasteryDTO, error)
- type ChampionRotationsDTO
- type ChampionTransformation
- type ClashEndpoint
- func (c *ClashEndpoint) ByID(region Region, tournamentID string) (*ClashTournamentDTO, error)
- func (c *ClashEndpoint) ByTeamID(region Region, teamID string) (*ClashTournamentDTO, error)
- func (c *ClashEndpoint) SummonerEntries(region Region, summonerID string) (*[]TournamentPlayerDTO, error)
- func (c *ClashEndpoint) TournamentTeamByID(region Region, teamID string) (*TournamentTeamDto, error)
- func (c *ClashEndpoint) Tournaments(region Region) (*[]ClashTournamentDTO, error)
- type ClashTournamentDTO
- type CurrentGameInfoDTO
- type CurrentGameParticipantDTO
- type FeaturedGameInfoDTO
- type FeaturedGamesDTO
- type GameCustomizationObject
- type GameMode
- type GameType
- type LOLClient
- type LeagueEndpoint
- func (l *LeagueEndpoint) ByID(region Region, leagueID string) (*LeagueListDTO, error)
- func (l *LeagueEndpoint) ChallengerByQueue(region Region, queueType QueueType) (*LeagueListDTO, error)
- func (l *LeagueEndpoint) Entries(region Region, queue QueueType, tier Tier, division api.Division, page int) (*[]LeagueEntryDTO, error)
- func (l *LeagueEndpoint) GrandmasterByQueue(region Region, queueType QueueType) (*LeagueListDTO, error)
- func (l *LeagueEndpoint) MasterByQueue(region Region, queueType QueueType) (*LeagueListDTO, error)
- func (l *LeagueEndpoint) SummonerEntries(region Region, summonerID string) (*[]LeagueEntryDTO, error)
- type LeagueEntryDTO
- type LeagueListDTO
- type LobbyEventDTO
- type LobbyEventDTOWrapper
- type MapType
- type MatchDTO
- type MatchEndpoint
- type MatchTimelineDTO
- type MatchType
- type MatchlistOptions
- type MiniSeriesDTO
- type ObserverDTO
- type ParticipantDTO
- type Perks
- type PickType
- type QueueType
- type Region
- type SpectatorEndpoint
- type SpectatorType
- type StatusEndpoint
- type SummonerDTO
- type SummonerEndpoint
- func (s *SummonerEndpoint) ByAccessToken(region Region, accessToken string) (*SummonerDTO, error)
- func (s *SummonerEndpoint) ByAccountID(region Region, accountID string) (*SummonerDTO, error)
- func (s *SummonerEndpoint) ByID(region Region, PUUID string) (*SummonerDTO, error)
- func (s *SummonerEndpoint) ByName(region Region, summonerName string) (*SummonerDTO, error)
- func (s *SummonerEndpoint) ByPUUID(region Region, PUUID string) (*SummonerDTO, error)
- type Tier
- type TournamentCodeDTO
- type TournamentCodeParametersDTO
- type TournamentCodeUpdateParametersDTO
- type TournamentEndpoint
- func (t *TournamentEndpoint) ByCode(tournamentCode string) (*TournamentCodeDTO, error)
- func (t *TournamentEndpoint) Create(providerID int, name string) (int, error)
- func (t *TournamentEndpoint) CreateCodes(tournamentID int64, count int, options TournamentCodeParametersDTO) ([]string, error)
- func (t *TournamentEndpoint) CreateProvider(region TournamentRegion, callbackURL string) (int, error)
- func (t *TournamentEndpoint) LobbyEvents(tournamentCode string) (*LobbyEventDTOWrapper, error)
- func (t *TournamentEndpoint) Update(tournamentCode string, parameters TournamentCodeUpdateParametersDTO) error
- type TournamentPhaseDto
- type TournamentPlayerDTO
- type TournamentRegion
- type TournamentStubEndpoint
- func (t *TournamentStubEndpoint) Create(providerID int, name string) (int, error)
- func (t *TournamentStubEndpoint) CreateCodes(tournamentID int64, count int, parameters TournamentCodeParametersDTO) ([]string, error)
- func (t *TournamentStubEndpoint) CreateProvider(region TournamentRegion, callbackURL string) (int, error)
- func (t *TournamentStubEndpoint) LobbyEvents(tournamentCode string) (*LobbyEventDTOWrapper, error)
- type TournamentTeamDto
Constants ¶
const ( ChampionURL = "/lol/platform/v3/champion-rotations" ChampionMasteriesURL = "/lol/champion-mastery/v4/champion-masteries/by-summoner/%s" ChampionMasteriesByChampionURL = "/lol/champion-mastery/v4/champion-masteries/by-summoner/%s/by-champion/%d" ChampionMasteriesScoresURL = "/lol/champion-mastery/v4/scores/by-summoner/%s" ClashURL = "/lol/clash/v1/tournaments" ClashTournamentTeamByIDURL = "/lol/clash/v1/teams/%s" ClashSummonerEntriesURL = "/lol/clash/v1/players/by-summoner/%s" ClashByTeamIDURL = "/lol/clash/v1/tournaments/by-team/%s" ClashByIDURL = "/lol/clash/v1/tournaments/%s" StatusURL = "/lol/status/v4/platform-data" MatchListURL = "/lol/match/v5/matches/by-puuid/%s/ids" MatchByIDURL = "/lol/match/v5/matches/%s" MatchTimelineURL = "/lol/match/v5/matches/%s/timeline" SpectatorFeaturedGamesURL = "/lol/spectator/v4/featured-games" SpectatorCurrentGameURL = "/lol/spectator/v4/active-games/by-summoner/%s" SummonerByIDURL = "/lol/summoner/v4/summoners/%s" SummonerByNameURL = "/lol/summoner/v4/summoners/by-name/%s" SummonerByPUUIDURL = "/lol/summoner/v4/summoners/by-puuid/%s" SummonerByAccountIDURL = "/lol/summoner/v4/summoners/by-account/%s" SummonerByAccessTokenURL = "/lol/summoner/v4/summoners/me" LeagueEntriesURL = "/lol/league/v4/entries/%s/%s/%s" LeagueEntriesBySummonerURL = "/lol/league/v4/entries/by-summoner/%s" LeagueByIDURL = "/lol/league/v4/leagues/%s" LeagueChallengerURL = "/lol/league/v4/challengerleagues/by-queue/%s" LeagueGrandmasterURL = "/lol/league/v4/grandmasterleagues/by-queue/%s" LeagueMasterURL = "/lol/league/v4/masterleagues/by-queue/%s" TournamentLobbyEventsURL = "/lol/tournament/v4/lobby-events/by-code/%s" TournamentCodesURL = "/lol/tournament/v4/codes" TournamentByCodeURL = "/lol/tournament/v4/codes/%s" TournamentProvidersURL = "/lol/tournament/v4/providers" TournamentURL = "/lol/tournament/v4/tournaments" TournamentStubLobbyEventsURL = "/lol/tournament-stub/v4/lobby-events/by-code/%s" TournamentStubCodesURL = "/lol/tournament-stub/v4/codes" TournamentStubProvidersURL = "/lol/tournament-stub/v4/providers" TournamentStubURL = "/lol/tournament-stub/v4/tournaments" )
League of Legends endpoints URLs
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BannedChampionDTO ¶ added in v0.6.0
type ChampionEndpoint ¶
type ChampionEndpoint struct {
// contains filtered or unexported fields
}
func (*ChampionEndpoint) Rotations ¶ added in v0.4.0
func (c *ChampionEndpoint) Rotations(region Region) (*ChampionRotationsDTO, error)
Get champion rotations, including free-to-play and low-level free-to-play rotations.
type ChampionMasteryDTO ¶ added in v0.4.0
type ChampionMasteryDTO struct {
// Champion ID for this entry.
ChampionID int `json:"championId"`
// Champion level for specified player and champion combination.
ChampionLevel int `json:"championLevel"`
// Total number of champion points for this player and champion combination - they are used to determine championLevel.
ChampionPoints int `json:"championPoints"`
// Last time this champion was played by this player - in Unix milliseconds time format.
LastPlayTime int64 `json:"lastPlayTime"`
// Number of points earned since current level has been achieved.
ChampionPointsSinceLastLevel int `json:"championPointsSinceLastLevel"`
// Number of points needed to achieve next level. Zero if player reached maximum champion level for this champion.
ChampionPointsUntilNextLevel int `json:"championPointsUntilNextLevel"`
// Is chest granted for this champion or not in current season.
ChestGranted bool `json:"chestGranted"`
// The token earned for this champion at the current championLevel. When the championLevel is advanced the tokensEarned resets to 0.
TokensEarned int `json:"tokensEarned"`
// Summoner ID for this entry. (Encrypted)
SummonerID string `json:"summonerId"`
}
type ChampionMasteryEndpoint ¶ added in v0.4.0
type ChampionMasteryEndpoint struct {
// contains filtered or unexported fields
}
func (*ChampionMasteryEndpoint) ChampionScore ¶ added in v0.4.0
func (c *ChampionMasteryEndpoint) ChampionScore(region Region, summonerID string, championID int) (*ChampionMasteryDTO, error)
Get a champion mastery by player ID and champion ID.
func (*ChampionMasteryEndpoint) MasteryScoreSum ¶ added in v0.6.0
func (c *ChampionMasteryEndpoint) MasteryScoreSum(region Region, summonerID string) (int, error)
Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
func (*ChampionMasteryEndpoint) SummonerMasteries ¶ added in v0.6.0
func (c *ChampionMasteryEndpoint) SummonerMasteries(region Region, summonerID string) (*[]ChampionMasteryDTO, error)
Get all champion mastery entries sorted by number of champion points descending.
type ChampionRotationsDTO ¶ added in v0.4.0
type ChampionRotationsDTO struct {
// List of free champions IDs
FreeChampionIDs []int `json:"freeChampionIds"`
// List of free champions IDs for new players
FreeChampionIDsForNewPlayers []int `json:"freeChampionIdsForNewPlayers"`
// Max new player level
MaxNewPlayerLevel int `json:"maxNewPlayerLevel"`
}
type ChampionTransformation ¶ added in v0.7.2
type ChampionTransformation int8
const ( NoTransformation ChampionTransformation = 0 SlayerTransformation ChampionTransformation = 1 AssassinTransformation ChampionTransformation = 2 )
type ClashEndpoint ¶ added in v0.6.0
type ClashEndpoint struct {
// contains filtered or unexported fields
}
func (*ClashEndpoint) ByID ¶ added in v0.6.0
func (c *ClashEndpoint) ByID(region Region, tournamentID string) (*ClashTournamentDTO, error)
Get tournament by ID.
func (*ClashEndpoint) ByTeamID ¶ added in v0.6.0
func (c *ClashEndpoint) ByTeamID(region Region, teamID string) (*ClashTournamentDTO, error)
Get tournament by team ID.
func (*ClashEndpoint) SummonerEntries ¶ added in v0.6.0
func (c *ClashEndpoint) SummonerEntries(region Region, summonerID string) (*[]TournamentPlayerDTO, error)
Get players by summoner ID.
This endpoint returns a list of active Clash players for a given summoner ID. If a summoner registers for multiple tournaments at the same time (e.g., Saturday and Sunday) then both registrations would appear in this list.
func (*ClashEndpoint) TournamentTeamByID ¶ added in v0.6.0
func (c *ClashEndpoint) TournamentTeamByID(region Region, teamID string) (*TournamentTeamDto, error)
Get team by ID.
func (*ClashEndpoint) Tournaments ¶ added in v0.6.0
func (c *ClashEndpoint) Tournaments(region Region) (*[]ClashTournamentDTO, error)
Get all active or upcoming tournaments.
type ClashTournamentDTO ¶ added in v0.7.0
type ClashTournamentDTO struct {
ID int `json:"id"`
ThemeID int `json:"themeId"`
NameKey string `json:"nameKey"`
NameKeySecondary string `json:"nameKeySecondary"`
// Tournament phase.
Schedule []TournamentPhaseDto `json:"schedule"`
}
type CurrentGameInfoDTO ¶ added in v0.4.0
type CurrentGameInfoDTO struct {
// The ID of the game.
GameID int `json:"gameId"`
// The ID of the map.
MapID int `json:"mapId"`
// The game mode.
GameMode GameMode `json:"gameMode"`
// The game type.
GameType GameType `json:"gameType"`
// The queue type
GameQueueConfigID int `json:"gameQueueConfigId"`
// The participant information.
Participants []CurrentGameParticipantDTO `json:"participants"`
// The observer information.
Observers ObserverDTO `json:"observers"`
// The ID of the platform on which the game is being played.
PlatformID string `json:"platformId"`
// Banned champion information.
BannedChampions []BannedChampionDTO `json:"bannedChampions"`
// The game start time represented in epoch milliseconds.
GameStartTime int `json:"gameStartTime"`
// The amount of time in seconds that has passed since the game started.
GameLength int `json:"gameLength"`
}
type CurrentGameParticipantDTO ¶ added in v0.6.0
type CurrentGameParticipantDTO struct {
// The team ID of this participant, indicating the participant's team.
TeamID int `json:"teamId"`
// The ID of the first summoner spell used by this participant.
Spell1ID int `json:"spell1Id"`
// The ID of the second summoner spell used by this participant.
Spell2ID int `json:"spell2Id"`
// The ID of the champion played by this participant.
ChampionID int `json:"championId"`
// The ID of the profile icon used by this participant.
ProfileIconID int `json:"profileIconId"`
// The encrypted summoner ID of this participant.
SummonerID string `json:"summonerId"`
// The summoner name of this participant.
SummonerName string `json:"summonerName"`
// Flag indicating whether or not this participant is a bot.
Bot bool `json:"bot"`
// List of Game Customizations.
GameCustomizationObjects []GameCustomizationObject `json:"gameCustomizationObjects"`
// Perks/Runes Reforged Information.
Perks Perks `json:"perks"`
}
type FeaturedGameInfoDTO ¶ added in v0.6.0
type FeaturedGameInfoDTO struct {
// The ID of the game.
GameID int `json:"gameId"`
// The ID of the map.
MapID int `json:"mapId"`
// The game mode.
GameMode GameMode `json:"gameMode"`
// The game type.
GameType GameType `json:"gameType"`
// The queue type.
GameQueueConfigID int `json:"gameQueueConfigId"`
// The participant information.
Participants []ParticipantDTO `json:"participants"`
// The observer information.
Observers ObserverDTO `json:"observers"`
// The ID of the platform on which the game is being played.
PlatformID string `json:"platformId"`
// Banned champion information.
BannedChampions []BannedChampionDTO `json:"bannedChampions"`
// The game start time represented in epoch milliseconds.
GameStartTime int `json:"gameStartTime"`
// The amount of time in seconds that has passed since the game started.
GameLength int `json:"gameLength"`
}
type FeaturedGamesDTO ¶ added in v0.3.0
type FeaturedGamesDTO struct {
// The list of featured games.
GameList []FeaturedGameInfoDTO `json:"gameList"`
// The suggested interval to wait before requesting FeaturedGames again.
ClientRefreshInterval int `json:"clientRefreshInterval"`
}
type GameCustomizationObject ¶ added in v0.6.0
type LOLClient ¶
type LOLClient struct {
Champion *ChampionEndpoint
ChampionMasteries *ChampionMasteryEndpoint
Clash *ClashEndpoint
Match *MatchEndpoint
Status *StatusEndpoint
Spectator *SpectatorEndpoint
Summoner *SummonerEndpoint
League *LeagueEndpoint
Tournament *TournamentEndpoint
TournamentStub *TournamentStubEndpoint
// contains filtered or unexported fields
}
func NewLOLClient ¶
func NewLOLClient(client *internal.InternalClient) *LOLClient
Creates a new LOLClient using an InternalClient provided.
type LeagueEndpoint ¶ added in v0.6.0
type LeagueEndpoint struct {
// contains filtered or unexported fields
}
func (*LeagueEndpoint) ByID ¶ added in v0.6.0
func (l *LeagueEndpoint) ByID(region Region, leagueID string) (*LeagueListDTO, error)
Get league with given ID, including inactive entries.
func (*LeagueEndpoint) ChallengerByQueue ¶ added in v0.6.0
func (l *LeagueEndpoint) ChallengerByQueue(region Region, queueType QueueType) (*LeagueListDTO, error)
Get the challenger league for given queue.
func (*LeagueEndpoint) Entries ¶ added in v0.6.0
func (l *LeagueEndpoint) Entries(region Region, queue QueueType, tier Tier, division api.Division, page int) (*[]LeagueEntryDTO, error)
Get all the league entries.
Page defaults to 1.
func (*LeagueEndpoint) GrandmasterByQueue ¶ added in v0.6.0
func (l *LeagueEndpoint) GrandmasterByQueue(region Region, queueType QueueType) (*LeagueListDTO, error)
Get the grandmaster league for given queue.
func (*LeagueEndpoint) MasterByQueue ¶ added in v0.6.0
func (l *LeagueEndpoint) MasterByQueue(region Region, queueType QueueType) (*LeagueListDTO, error)
Get the master league for given queue.
func (*LeagueEndpoint) SummonerEntries ¶ added in v0.6.0
func (l *LeagueEndpoint) SummonerEntries(region Region, summonerID string) (*[]LeagueEntryDTO, error)
Get league entries in all queues for a given summoner ID.
type LeagueEntryDTO ¶ added in v0.6.0
type LeagueEntryDTO struct {
LeagueID string `json:"leagueId"`
QueueType QueueType `json:"queueType"`
Tier Tier `json:"tier"`
// The player's division within a tier.
Rank api.Division `json:"rank"`
// Player's encrypted summonerId.
SummonerID string `json:"summonerId"`
SummonerName string `json:"summonerName"`
LeaguePoints int `json:"leaguePoints"`
// Winning team on Summoners Rift.
Wins int `json:"wins"`
// Losing team on Summoners Rift.
Losses int `json:"losses"`
Veteran bool `json:"veteran"`
Inactive bool `json:"inactive"`
FreshBlood bool `json:"freshBlood"`
HotStreak bool `json:"hotStreak"`
MiniSeries MiniSeriesDTO `json:"miniSeries,omitempty"`
}
type LeagueListDTO ¶ added in v0.6.0
type LeagueListDTO struct {
Tier Tier `json:"tier"`
LeagueID string `json:"leagueId"`
Queue QueueType `json:"queue"`
Name string `json:"name"`
Entries []LeagueEntryDTO `json:"entries"`
}
type LobbyEventDTO ¶ added in v0.6.0
type LobbyEventDTOWrapper ¶ added in v0.6.0
type LobbyEventDTOWrapper struct {
EventList []LobbyEventDTO `json:"eventList"`
}
type MatchDTO ¶ added in v0.4.0
type MatchDTO struct {
// Match metadata.
Metadata struct {
// Match data version.
DataVersion string `json:"dataVersion"`
// Match ID.
MatchID string `json:"matchId"`
// A list of participant PUUIDs.
Participants []string `json:"participants"`
} `json:"metadata"`
// Match info.
Info struct {
// Unix timestamp for when the game is created on the game server (i.e., the loading screen).
GameCreation int64 `json:"gameCreation"`
// 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.
GameDuration int `json:"gameDuration"`
// 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"`
GameID int `json:"gameId"`
// Refer to the Game Constants documentation.
GameMode string `json:"gameMode"`
GameName string `json:"gameName"`
// Unix timestamp for when match starts on the game server.
GameStartTimestamp int64 `json:"gameStartTimestamp"`
GameType string `json:"gameType"`
// The first two parts can be used to determine the patch a game was played on.
GameVersion string `json:"gameVersion"`
// Refer to the Game Constants documentation.
MapID int `json:"mapId"`
Participants []struct {
Assists int `json:"assists"`
BaronKills int `json:"baronKills"`
BountyLevel int `json:"bountyLevel"`
ChampExperience int `json:"champExperience"`
ChampLevel int `json:"champLevel"`
// 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 int `json:"championId"`
ChampionName string `json:"championName"`
// This field is currently only utilized for Kayn's transformations.
ChampionTransform ChampionTransformation `json:"championTransform"`
ConsumablesPurchased int `json:"consumablesPurchased"`
DamageDealtToBuildings int `json:"damageDealtToBuildings"`
DamageDealtToObjectives int `json:"damageDealtToObjectives"`
DamageDealtToTurrets int `json:"damageDealtToTurrets"`
DamageSelfMitigated int `json:"damageSelfMitigated"`
Deaths int `json:"deaths"`
DetectorWardsPlaced int `json:"detectorWardsPlaced"`
DoubleKills int `json:"doubleKills"`
DragonKills int `json:"dragonKills"`
EligibleForProgression bool `json:"eligibleForProgression"`
FirstBloodAssist bool `json:"firstBloodAssist"`
FirstBloodKill bool `json:"firstBloodKill"`
FirstTowerAssist bool `json:"firstTowerAssist"`
FirstTowerKill bool `json:"firstTowerKill"`
GameEndedInEarlySurrender bool `json:"gameEndedInEarlySurrender"`
GameEndedInSurrender bool `json:"gameEndedInSurrender"`
GoldEarned int `json:"goldEarned"`
GoldSpent int `json:"goldSpent"`
// 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"`
InhibitorKills int `json:"inhibitorKills"`
InhibitorTakedowns int `json:"inhibitorTakedowns"`
InhibitorsLost int `json:"inhibitorsLost"`
Item0 int `json:"item0"`
Item1 int `json:"item1"`
Item2 int `json:"item2"`
Item3 int `json:"item3"`
Item4 int `json:"item4"`
Item5 int `json:"item5"`
Item6 int `json:"item6"`
ItemsPurchased int `json:"itemsPurchased"`
KillingSprees int `json:"killingSprees"`
Kills int `json:"kills"`
Lane string `json:"lane"`
LargestCriticalStrike int `json:"largestCriticalStrike"`
LargestKillingSpree int `json:"largestKillingSpree"`
LargestMultiKill int `json:"largestMultiKill"`
LongestTimeSpentLiving int `json:"longestTimeSpentLiving"`
MagicDamageDealt int `json:"magicDamageDealt"`
MagicDamageDealtToChampions int `json:"magicDamageDealtToChampions"`
MagicDamageTaken int `json:"magicDamageTaken"`
NeutralMinionsKilled int `json:"neutralMinionsKilled"`
NexusKills int `json:"nexusKills"`
NexusLost int `json:"nexusLost"`
NexusTakedowns int `json:"nexusTakedowns"`
ObjectivesStolen int `json:"objectivesStolen"`
ObjectivesStolenAssists int `json:"objectivesStolenAssists"`
ParticipantID int `json:"participantId"`
PentaKills int `json:"pentaKills"`
Perks struct {
StatPerks struct {
Defense int `json:"defense"`
Flex int `json:"flex"`
Offense int `json:"offense"`
} `json:"statPerks"`
Styles []struct {
Description string `json:"description"`
Selections []struct {
Perk int `json:"perk"`
Var1 int `json:"var1"`
Var2 int `json:"var2"`
Var3 int `json:"var3"`
} `json:"selections"`
Style int `json:"style"`
} `json:"styles"`
} `json:"perks"`
PhysicalDamageDealt int `json:"physicalDamageDealt"`
PhysicalDamageDealtToChampions int `json:"physicalDamageDealtToChampions"`
PhysicalDamageTaken int `json:"physicalDamageTaken"`
ProfileIcon int `json:"profileIcon"`
PUUID string `json:"puuid"`
QuadraKills int `json:"quadraKills"`
RiotIDName string `json:"riotIdName"`
RiotIDTagline string `json:"riotIdTagline"`
Role string `json:"role"`
SightWardsBoughtInGame int `json:"sightWardsBoughtInGame"`
Spell1Casts int `json:"spell1Casts"`
Spell2Casts int `json:"spell2Casts"`
Spell3Casts int `json:"spell3Casts"`
Spell4Casts int `json:"spell4Casts"`
Summoner1Casts int `json:"summoner1Casts"`
Summoner1ID int `json:"summoner1Id"`
Summoner2Casts int `json:"summoner2Casts"`
Summoner2ID int `json:"summoner2Id"`
SummonerID string `json:"summonerId"`
SummonerLevel int `json:"summonerLevel"`
SummonerName string `json:"summonerName"`
TeamEarlySurrendered bool `json:"teamEarlySurrendered"`
TeamID int `json:"teamId"`
// 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"`
TimeCCingOthers int `json:"timeCCingOthers"`
TimePlayed int `json:"timePlayed"`
TotalDamageDealt int `json:"totalDamageDealt"`
TotalDamageDealtToChampions int `json:"totalDamageDealtToChampions"`
TotalDamageShieldedOnTeammates int `json:"totalDamageShieldedOnTeammates"`
TotalDamageTaken int `json:"totalDamageTaken"`
TotalHeal int `json:"totalHeal"`
TotalHealsOnTeammates int `json:"totalHealsOnTeammates"`
TotalMinionsKilled int `json:"totalMinionsKilled"`
TotalTimeCCDealt int `json:"totalTimeCCDealt"`
TotalTimeSpentDead int `json:"totalTimeSpentDead"`
TotalUnitsHealed int `json:"totalUnitsHealed"`
TripleKills int `json:"tripleKills"`
TrueDamageDealt int `json:"trueDamageDealt"`
TrueDamageDealtToChampions int `json:"trueDamageDealtToChampions"`
TrueDamageTaken int `json:"trueDamageTaken"`
TurretKills int `json:"turretKills"`
TurretTakedowns int `json:"turretTakedowns"`
TurretsLost int `json:"turretsLost"`
UnrealKills int `json:"unrealKills"`
VisionScore int `json:"visionScore"`
VisionWardsBoughtInGame int `json:"visionWardsBoughtInGame"`
WardsKilled int `json:"wardsKilled"`
WardsPlaced int `json:"wardsPlaced"`
Win bool `json:"win"`
} `json:"participants"`
// Platform where the match was played.
PlatformID Region `json:"platformId"`
// Refer to the Game Constants documentation.
QueueID int `json:"queueId"`
Teams []struct {
Bans []interface{} `json:"bans"`
Objectives struct {
Baron struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"baron"`
Champion struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"champion"`
Dragon struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"dragon"`
Inhibitor struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"inhibitor"`
RiftHerald struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"riftHerald"`
Tower struct {
First bool `json:"first"`
Kills int `json:"kills"`
} `json:"tower"`
} `json:"objectives"`
TeamID int `json:"teamId"`
Win bool `json:"win"`
} `json:"teams"`
// 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"`
} `json:"info"`
}
type MatchEndpoint ¶ added in v0.4.0
type MatchEndpoint struct {
// contains filtered or unexported fields
}
func (*MatchEndpoint) ByID ¶ added in v0.4.0
func (m *MatchEndpoint) ByID(matchID string) (*MatchDTO, error)
Get a match by match ID.
func (*MatchEndpoint) List ¶ added in v0.4.0
func (m *MatchEndpoint) List(PUUID string, options *MatchlistOptions) ([]string, error)
Start defaults to 0.
Count defaults to 20.
func (*MatchEndpoint) Timeline ¶ added in v0.4.0
func (m *MatchEndpoint) Timeline(matchID string) (*MatchTimelineDTO, error)
Get a match timeline by match ID.
type MatchTimelineDTO ¶ added in v0.4.0
type MatchTimelineDTO struct {
// Match metadata.
Metadata struct {
// Match data version.
DataVersion string `json:"dataVersion"`
// Match ID.
MatchID string `json:"matchId"`
// A list of participant PUUIDs.
Participants []string `json:"participants"`
} `json:"metadata"`
// Match info.
Info struct {
FrameInterval int `json:"frameInterval"`
Frames []struct {
Events []struct {
RealTimestamp int64 `json:"realTimestamp"`
Timestamp int `json:"timestamp"`
Type string `json:"type"`
} `json:"events"`
ParticipantFrames struct {
Num1 struct {
ChampionStats struct {
AbilityHaste int `json:"abilityHaste"`
AbilityPower int `json:"abilityPower"`
Armor int `json:"armor"`
ArmorPen int `json:"armorPen"`
ArmorPenPercent int `json:"armorPenPercent"`
AttackDamage int `json:"attackDamage"`
AttackSpeed int `json:"attackSpeed"`
BonusArmorPenPercent int `json:"bonusArmorPenPercent"`
BonusMagicPenPercent int `json:"bonusMagicPenPercent"`
CcReduction int `json:"ccReduction"`
CooldownReduction int `json:"cooldownReduction"`
Health int `json:"health"`
HealthMax int `json:"healthMax"`
HealthRegen int `json:"healthRegen"`
Lifesteal int `json:"lifesteal"`
MagicPen int `json:"magicPen"`
MagicPenPercent int `json:"magicPenPercent"`
MagicResist int `json:"magicResist"`
MovementSpeed int `json:"movementSpeed"`
Omnivamp int `json:"omnivamp"`
PhysicalVamp int `json:"physicalVamp"`
Power int `json:"power"`
PowerMax int `json:"powerMax"`
PowerRegen int `json:"powerRegen"`
SpellVamp int `json:"spellVamp"`
} `json:"championStats"`
CurrentGold int `json:"currentGold"`
DamageStats struct {
MagicDamageDone int `json:"magicDamageDone"`
MagicDamageDoneToChampions int `json:"magicDamageDoneToChampions"`
MagicDamageTaken int `json:"magicDamageTaken"`
PhysicalDamageDone int `json:"physicalDamageDone"`
PhysicalDamageDoneToChampions int `json:"physicalDamageDoneToChampions"`
PhysicalDamageTaken int `json:"physicalDamageTaken"`
TotalDamageDone int `json:"totalDamageDone"`
TotalDamageDoneToChampions int `json:"totalDamageDoneToChampions"`
TotalDamageTaken int `json:"totalDamageTaken"`
TrueDamageDone int `json:"trueDamageDone"`
TrueDamageDoneToChampions int `json:"trueDamageDoneToChampions"`
TrueDamageTaken int `json:"trueDamageTaken"`
} `json:"damageStats"`
GoldPerSecond int `json:"goldPerSecond"`
JungleMinionsKilled int `json:"jungleMinionsKilled"`
Level int `json:"level"`
MinionsKilled int `json:"minionsKilled"`
ParticipantID int `json:"participantId"`
Position struct {
X int `json:"x"`
Y int `json:"y"`
} `json:"position"`
TimeEnemySpentControlled int `json:"timeEnemySpentControlled"`
TotalGold int `json:"totalGold"`
Xp int `json:"xp"`
} `json:"1"`
} `json:"participantFrames"`
Timestamp int `json:"timestamp"`
} `json:"frames"`
GameID int `json:"gameId"`
Participants []struct {
ParticipantID int `json:"participantId"`
PUUID string `json:"puuid"`
} `json:"participants"`
} `json:"info"`
}
type MatchlistOptions ¶ added in v0.4.0
type MatchlistOptions struct {
// The matchlist started storing timestamps on June 16th, 2021.
// Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set.
StartTime int `json:"startTime"`
// Epoch timestamp in seconds.
EndTime int `json:"endTime"`
// Filter the list of match ids by a specific queue ID.
// This filter is mutually inclusive of the type filter meaning any match ids returned must match both the queue and type filters.
Queue int `json:"queue"`
// Filter the list of match ids by the type of match.
// This filter is mutually inclusive of the queue filter meaning any match ids returned must match both the queue and type filters.
Type MatchType `json:"type"`
// Defaults to 0. Start index.
Start int `json:"start"`
// Defaults to 20. Valid values: 0 to 100. Number of match ids to return.
Count int `json:"count"`
}
type MiniSeriesDTO ¶ added in v0.6.0
type ObserverDTO ¶ added in v0.6.0
type ObserverDTO struct {
// Key used to decrypt the spectator grid game data for playback.
EncryptionKey string `json:"encryptionKey"`
}
type ParticipantDTO ¶ added in v0.6.0
type ParticipantDTO struct {
// The team ID of this participant, indicating the participant's team.
TeamID int `json:"teamId"`
// The ID of the first summoner spell used by this participant.
Spell1ID int `json:"spell1Id"`
// The ID of the second summoner spell used by this participant.
Spell2ID int `json:"spell2Id"`
// The ID of the champion played by this participant.
ChampionID int `json:"championId"`
// The ID of the profile icon used by this participant.
ProfileIconID int `json:"profileIconId"`
// The summoner name of this participant.
SummonerName string `json:"summonerName"`
// Flag indicating whether or not this participant is a bot.
Bot bool `json:"bot"`
}
type SpectatorEndpoint ¶ added in v0.3.0
type SpectatorEndpoint struct {
// contains filtered or unexported fields
}
func (*SpectatorEndpoint) CurrentGame ¶ added in v0.4.0
func (s *SpectatorEndpoint) CurrentGame(region Region, summonerID string) (*CurrentGameInfoDTO, error)
Get the current game information for the given summoner ID.
func (*SpectatorEndpoint) FeaturedGames ¶ added in v0.3.0
func (s *SpectatorEndpoint) FeaturedGames(region Region) (*FeaturedGamesDTO, error)
Get featured games in a region.
type SpectatorType ¶ added in v0.6.0
type SpectatorType string
const ( NoneSpectator SpectatorType = "NONE" LobbyOnlySpectator SpectatorType = "LOBBYONLY" AllSpectator SpectatorType = "ALL" )
type StatusEndpoint ¶ added in v0.2.2
type StatusEndpoint struct {
// contains filtered or unexported fields
}
func (*StatusEndpoint) PlatformStatus ¶ added in v0.4.0
func (s *StatusEndpoint) PlatformStatus(region Region) (*api.PlatformDataDTO, error)
Get League of Legends status for the given platform.
type SummonerDTO ¶ added in v0.5.0
type SummonerDTO struct {
// Encrypted summoner ID. Max length 63 characters.
ID string `json:"id"`
// Encrypted account ID. Max length 56 characters.
AccountID string `json:"accountId"`
// Encrypted PUUID. Exact length of 78 characters.
PUUID string `json:"puuid"`
// Summoner name.
Name string `json:"name"`
// ID of the summoner icon associated with the summoner.
ProfileIconID int `json:"profileIconId"`
// Date summoner was last modified specified as epoch milliseconds. The following events will update this timestamp: summoner name change, summoner level change, or profile icon change.
RevisionDate int64 `json:"revisionDate"`
// Summoner level associated with the summoner.
SummonerLevel int `json:"summonerLevel"`
}
type SummonerEndpoint ¶ added in v0.5.0
type SummonerEndpoint struct {
// contains filtered or unexported fields
}
func (*SummonerEndpoint) ByAccessToken ¶ added in v0.7.1
func (s *SummonerEndpoint) ByAccessToken(region Region, accessToken string) (*SummonerDTO, error)
Get a summoner by access token.
func (*SummonerEndpoint) ByAccountID ¶ added in v0.5.0
func (s *SummonerEndpoint) ByAccountID(region Region, accountID string) (*SummonerDTO, error)
Get a summoner by summoner account ID.
func (*SummonerEndpoint) ByID ¶ added in v0.5.0
func (s *SummonerEndpoint) ByID(region Region, PUUID string) (*SummonerDTO, error)
Get a summoner by summoner ID.
func (*SummonerEndpoint) ByName ¶ added in v0.5.0
func (s *SummonerEndpoint) ByName(region Region, summonerName string) (*SummonerDTO, error)
Get a summoner by summoner name.
func (*SummonerEndpoint) ByPUUID ¶ added in v0.5.0
func (s *SummonerEndpoint) ByPUUID(region Region, PUUID string) (*SummonerDTO, error)
Get a summoner by summoner PUUID.
type TournamentCodeDTO ¶ added in v0.7.0
type TournamentCodeDTO struct {
// The tournament code.
Code string
// The spectator mode for the tournament code game.
Spectators SpectatorType
// The lobby name for the tournament code game.
LobbyName string
// The metadata for tournament code.
MetaData string
// The password for the tournament code game.
Password string
// The team size for the tournament code game.
TeamSize int
// The provider's ID.
ProviderId int
// The pick mode for tournament code game.
PickType PickType
// The tournament's ID.
TournamentID int
// The tournament code's ID.
ID int
// The tournament code's region.
Region TournamentRegion
// The game map for the tournament code game
Map MapType
// The summonerIds of the participants (Encrypted)
Participants []string
}
type TournamentCodeParametersDTO ¶ added in v0.7.0
type TournamentCodeParametersDTO struct {
// Optional list of encrypted summonerIds 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.
AllowedSummonerIds []string `json:"allowedSummonerIds,omitempty"`
// The map type of the game.
MapType MapType `json:"mapType"`
// Optional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game.
Metadata string `json:"metadata,omitempty"`
// The pick type of the game.
PickType PickType `json:"pickType"`
// The spectator type of the game.
SpectatorType SpectatorType `json:"spectatorType"`
// The team size of the game. Valid values are 1-5.
TeamSize int `json:"teamSize"`
}
type TournamentCodeUpdateParametersDTO ¶ added in v0.7.0
type TournamentCodeUpdateParametersDTO struct {
// Optional list of encrypted summonerIds 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.
AllowedSummonerIds []string `json:"allowedSummonerIds,omitempty"`
// The map type of the game.
MapType MapType `json:"mapType,omitempty"`
// The pick type of the game.
PickType PickType `json:"pickType,omitempty"`
// The spectator type of the game.
SpectatorType SpectatorType `json:"spectatorType,omitempty"`
}
type TournamentEndpoint ¶ added in v0.7.0
type TournamentEndpoint struct {
// contains filtered or unexported fields
}
func (*TournamentEndpoint) ByCode ¶ added in v0.7.0
func (t *TournamentEndpoint) ByCode(tournamentCode string) (*TournamentCodeDTO, error)
Returns the tournament code DTO associated with a tournament code string.
func (*TournamentEndpoint) Create ¶ added in v0.7.0
func (t *TournamentEndpoint) Create(providerID int, name string) (int, error)
Creates a mock tournament and returns its ID.
The provider ID to specify the regional registered provider data to associate this tournament.
The optional name of the tournament.
func (*TournamentEndpoint) CreateCodes ¶ added in v0.7.0
func (t *TournamentEndpoint) CreateCodes(tournamentID int64, count int, options TournamentCodeParametersDTO) ([]string, error)
Create a mock tournament code for the given tournament.
Count defaults to 20 (max 1000).
func (*TournamentEndpoint) CreateProvider ¶ added in v0.7.0
func (t *TournamentEndpoint) CreateProvider(region TournamentRegion, callbackURL string) (int, error)
Creates a mock tournament provider and returns its ID.
Providers will need to call this endpoint first to register their callback URL and their API key with the tournament system before any other tournament provider endpoints will work.
The region in which the provider will be running tournaments.
The provider's callback URL to which tournament game results in this region should be posted. The URL must be well-formed, use the http or https protocol, and use the default port for the protocol (http URLs must use port 80, https URLs must use port 443).
func (*TournamentEndpoint) LobbyEvents ¶ added in v0.7.0
func (t *TournamentEndpoint) LobbyEvents(tournamentCode string) (*LobbyEventDTOWrapper, error)
Gets a mock list of lobby events by tournament code.
func (*TournamentEndpoint) Update ¶ added in v0.7.0
func (t *TournamentEndpoint) Update(tournamentCode string, parameters TournamentCodeUpdateParametersDTO) error
Returns the tournament code DTO associated with a tournament code string.
type TournamentPhaseDto ¶ added in v0.6.0
type TournamentPlayerDTO ¶ added in v0.6.0
type TournamentRegion ¶ added in v0.6.0
type TournamentRegion string
const ( BR TournamentRegion = "BR" EUN TournamentRegion = "EUNE" EUW TournamentRegion = "EUW" JP TournamentRegion = "JP" LAN TournamentRegion = "LAN" LAS TournamentRegion = "LAS" NA TournamentRegion = "NA" OC TournamentRegion = "OCE" PBE TournamentRegion = "PBE" RUSSIA TournamentRegion = "RU" TR TournamentRegion = "TR" )
type TournamentStubEndpoint ¶ added in v0.6.0
type TournamentStubEndpoint struct {
// contains filtered or unexported fields
}
func (*TournamentStubEndpoint) Create ¶ added in v0.7.0
func (t *TournamentStubEndpoint) Create(providerID int, name string) (int, error)
Creates a mock tournament and returns its ID.
The provider ID to specify the regional registered provider data to associate this tournament.
The optional name of the tournament.
func (*TournamentStubEndpoint) CreateCodes ¶ added in v0.6.0
func (t *TournamentStubEndpoint) CreateCodes(tournamentID int64, count int, parameters TournamentCodeParametersDTO) ([]string, error)
Create a mock tournament code for the given tournament.
Count defaults to 20 (max 1000).
func (*TournamentStubEndpoint) CreateProvider ¶ added in v0.7.0
func (t *TournamentStubEndpoint) CreateProvider(region TournamentRegion, callbackURL string) (int, error)
Creates a mock tournament provider and returns its ID.
Providers will need to call this endpoint first to register their callback URL and their API key with the tournament system before any other tournament provider endpoints will work.
The region in which the provider will be running tournaments.
The provider's callback URL to which tournament game results in this region should be posted. The URL must be well-formed, use the http or https protocol, and use the default port for the protocol (http URLs must use port 80, https URLs must use port 443).
func (*TournamentStubEndpoint) LobbyEvents ¶ added in v0.6.0
func (t *TournamentStubEndpoint) LobbyEvents(tournamentCode string) (*LobbyEventDTOWrapper, error)
Gets a mock list of lobby events by tournament code.
type TournamentTeamDto ¶ added in v0.6.0
type TournamentTeamDto struct {
ID string `json:"id"`
TournamentID int `json:"tournamentId"`
Name string `json:"name"`
IconID int `json:"iconId"`
Tier int `json:"tier"`
// Summoner ID of the team captain.
Captain string `json:"captain"`
Abbreviation string `json:"abbreviation"`
// Team members.
Players []TournamentPlayerDTO `json:"players"`
}