val

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

This package is used to interact with all VAL endpoints.

  • ContentV1
  • MatchV1
  • RankedV1
  • StatusV1

Note: this package is automatically generated.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v0.19.0

type Client struct {
	ContentV1 ContentV1
	MatchV1   MatchV1
	RankedV1  RankedV1
	StatusV1  StatusV1
}

func NewVALClient

func NewVALClient(client *internal.Client) *Client

Creates a new VAL Client using the internal.Client provided.

type ContentActV1DTO added in v1.1.0

type ContentActV1DTO struct {
	// 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.ActDto

type ContentItemV1DTO added in v0.17.0

type ContentItemV1DTO struct {
	AssetName string `json:"assetName,omitempty"`
	// This field is only included for maps and game modes. These values are used in the match response.
	AssetPath string `json:"assetPath,omitempty"`
	ID        string `json:"id,omitempty"`
	// This field is excluded from the response when a locale is set
	LocalizedNames ContentLocalizedNamesV1DTO `json:"localizedNames,omitempty"`
	Name           string                     `json:"name,omitempty"`
}

val-content-v1.ContentItemDto

type ContentLocalizedNamesV1DTO added in v1.1.0

type ContentLocalizedNamesV1DTO struct {
	ArAe string `json:"ar-AE,omitempty"`
	DeDe string `json:"de-DE,omitempty"`
	EnGb string `json:"en-GB,omitempty"`
	EnUs string `json:"en-US,omitempty"`
	EsEs string `json:"es-ES,omitempty"`
	EsMx string `json:"es-MX,omitempty"`
	FrFr string `json:"fr-FR,omitempty"`
	IdID string `json:"id-ID,omitempty"`
	ItIt string `json:"it-IT,omitempty"`
	JaJp string `json:"ja-JP,omitempty"`
	KoKr string `json:"ko-KR,omitempty"`
	PlPl string `json:"pl-PL,omitempty"`
	PtBr string `json:"pt-BR,omitempty"`
	RuRu string `json:"ru-RU,omitempty"`
	ThTh string `json:"th-TH,omitempty"`
	TrTr string `json:"tr-TR,omitempty"`
	ViVn string `json:"vi-VN,omitempty"`
	ZhCn string `json:"zh-CN,omitempty"`
	ZhTw string `json:"zh-TW,omitempty"`
}

val-content-v1.LocalizedNamesDto

type ContentV1 added in v0.17.0

type ContentV1 struct {
	// contains filtered or unexported fields
}

Riot API Reference

val-content-v1

func (*ContentV1) Content added in v0.17.0

func (e *ContentV1) Content(ctx context.Context, route PlatformRoute, locale string) (*ContentV1DTO, error)

Get content optionally filtered by locale

Parameters

  • route : Route to query.
  • locale (optional)

Riot API Reference

val-content-v1.getContent

type ContentV1DTO added in v0.17.0

type ContentV1DTO struct {
	Version      string             `json:"version,omitempty"`
	Acts         []ContentActV1DTO  `json:"acts,omitempty"`
	Ceremonies   []ContentItemV1DTO `json:"ceremonies,omitempty"`
	Characters   []ContentItemV1DTO `json:"characters,omitempty"`
	CharmLevels  []ContentItemV1DTO `json:"charmLevels,omitempty"`
	Charms       []ContentItemV1DTO `json:"charms,omitempty"`
	Chromas      []ContentItemV1DTO `json:"chromas,omitempty"`
	Equips       []ContentItemV1DTO `json:"equips,omitempty"`
	GameModes    []ContentItemV1DTO `json:"gameModes,omitempty"`
	Maps         []ContentItemV1DTO `json:"maps,omitempty"`
	PlayerCards  []ContentItemV1DTO `json:"playerCards,omitempty"`
	PlayerTitles []ContentItemV1DTO `json:"playerTitles,omitempty"`
	SkinLevels   []ContentItemV1DTO `json:"skinLevels,omitempty"`
	Skins        []ContentItemV1DTO `json:"skins,omitempty"`
	SprayLevels  []ContentItemV1DTO `json:"sprayLevels,omitempty"`
	Sprays       []ContentItemV1DTO `json:"sprays,omitempty"`
	// Unknown type, this is a placeholder subject to change.
	Totems []string `json:"totems,omitempty"`
}

val-content-v1.ContentDto

type MatchAbilityCastsV1DTO added in v1.1.0

type MatchAbilityCastsV1DTO struct {
	Ability1Casts int32 `json:"ability1Casts,omitempty"`
	Ability2Casts int32 `json:"ability2Casts,omitempty"`
	GrenadeCasts  int32 `json:"grenadeCasts,omitempty"`
	UltimateCasts int32 `json:"ultimateCasts,omitempty"`
}

val-match-v1.AbilityCastsDto

type MatchAbilityV1DTO added in v1.1.0

type MatchAbilityV1DTO struct {
	Ability1Effects string `json:"ability1Effects,omitempty"`
	Ability2Effects string `json:"ability2Effects,omitempty"`
	GrenadeEffects  string `json:"grenadeEffects,omitempty"`
	UltimateEffects string `json:"ultimateEffects,omitempty"`
}

val-match-v1.AbilityDto

type MatchCoachV1DTO added in v1.1.0

type MatchCoachV1DTO struct {
	PUUID  string `json:"puuid,omitempty"`
	TeamID string `json:"teamId,omitempty"`
}

val-match-v1.CoachDto

type MatchDamageV1DTO added in v1.1.0

type MatchDamageV1DTO struct {
	// PUUID
	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.DamageDto

type MatchEconomyV1DTO added in v1.1.0

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"`
}

val-match-v1.EconomyDto

type MatchFinishingDamageV1DTO added in v1.1.0

type MatchFinishingDamageV1DTO struct {
	DamageItem          string `json:"damageItem,omitempty"`
	DamageType          string `json:"damageType,omitempty"`
	IsSecondaryFireMode bool   `json:"isSecondaryFireMode,omitempty"`
}

val-match-v1.FinishingDamageDto

type MatchInfoV1DTO added in v0.17.0

type MatchInfoV1DTO struct {
	CustomGameName     string `json:"customGameName,omitempty"`
	GameMode           string `json:"gameMode,omitempty"`
	MapID              string `json:"mapId,omitempty"`
	MatchID            string `json:"matchId,omitempty"`
	ProvisioningFlowID string `json:"provisioningFlowId,omitempty"`
	QueueID            string `json:"queueId,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.MatchInfoDto

type MatchKillV1DTO added in v1.1.0

type MatchKillV1DTO struct {
	// PUUID
	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"`
}

val-match-v1.KillDto

type MatchLocationV1DTO added in v1.1.0

type MatchLocationV1DTO struct {
	X int32 `json:"x,omitempty"`
	Y int32 `json:"y,omitempty"`
}

val-match-v1.LocationDto

type MatchPlayerLocationsV1DTO added in v1.1.0

type MatchPlayerLocationsV1DTO struct {
	PUUID       string             `json:"puuid,omitempty"`
	Location    MatchLocationV1DTO `json:"location,omitempty"`
	ViewRadians float32            `json:"viewRadians,omitempty"`
}

val-match-v1.PlayerLocationsDto

type MatchPlayerRoundStatsV1DTO added in v1.1.0

type MatchPlayerRoundStatsV1DTO struct {
	Ability MatchAbilityV1DTO  `json:"ability,omitempty"`
	PUUID   string             `json:"puuid,omitempty"`
	Damage  []MatchDamageV1DTO `json:"damage,omitempty"`
	Kills   []MatchKillV1DTO   `json:"kills,omitempty"`
	Economy MatchEconomyV1DTO  `json:"economy,omitempty"`
	Score   int32              `json:"score,omitempty"`
}

val-match-v1.PlayerRoundStatsDto

type MatchPlayerStatsV1DTO added in v1.1.0

type MatchPlayerStatsV1DTO struct {
	AbilityCasts   MatchAbilityCastsV1DTO `json:"abilityCasts,omitempty"`
	Assists        int32                  `json:"assists,omitempty"`
	Deaths         int32                  `json:"deaths,omitempty"`
	Kills          int32                  `json:"kills,omitempty"`
	PlaytimeMillis int32                  `json:"playtimeMillis,omitempty"`
	RoundsPlayed   int32                  `json:"roundsPlayed,omitempty"`
	Score          int32                  `json:"score,omitempty"`
}

val-match-v1.PlayerStatsDto

type MatchPlayerV1DTO added in v0.17.0

type MatchPlayerV1DTO struct {
	CharacterID     string                `json:"characterId,omitempty"`
	GameName        string                `json:"gameName,omitempty"`
	PUUID           string                `json:"puuid,omitempty"`
	PartyID         string                `json:"partyId,omitempty"`
	PlayerCard      string                `json:"playerCard,omitempty"`
	PlayerTitle     string                `json:"playerTitle,omitempty"`
	TagLine         string                `json:"tagLine,omitempty"`
	TeamID          string                `json:"teamId,omitempty"`
	Stats           MatchPlayerStatsV1DTO `json:"stats,omitempty"`
	CompetitiveTier int32                 `json:"competitiveTier,omitempty"`
}

val-match-v1.PlayerDto

type MatchRecentMatchesV1DTO added in v1.1.0

type MatchRecentMatchesV1DTO struct {
	// A list of recent match ids.
	MatchIDs    []string `json:"matchIds,omitempty"`
	CurrentTime int64    `json:"currentTime,omitempty"`
}

val-match-v1.RecentMatchesDto

type MatchRoundResultV1DTO added in v1.1.0

type MatchRoundResultV1DTO struct {
	// PUUID of player
	BombDefuser string `json:"bombDefuser,omitempty"`
	// PUUID of player
	BombPlanter           string                       `json:"bombPlanter,omitempty"`
	PlantSite             string                       `json:"plantSite,omitempty"`
	RoundCeremony         string                       `json:"roundCeremony,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.RoundResultDto

type MatchTeamV1DTO added in v1.1.0

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"`
	Won          bool  `json:"won,omitempty"`
}

val-match-v1.TeamDto

type MatchV1 added in v0.17.0

type MatchV1 struct {
	// contains filtered or unexported fields
}

Riot API Reference

val-match-v1

func (*MatchV1) ByID added in v0.17.0

func (e *MatchV1) ByID(ctx context.Context, route PlatformRoute, matchId string) (*MatchV1DTO, error)

Get match by id

Parameters

  • route : Route to query.
  • matchId

Riot API Reference

val-match-v1.getMatch

func (*MatchV1) ListByPUUID added in v0.17.0

func (e *MatchV1) ListByPUUID(ctx context.Context, route PlatformRoute, puuid string) (*MatchlistV1DTO, error)

Get matchlist for games played by puuid

Parameters

  • route : Route to query.
  • puuid

Riot API Reference

val-match-v1.getMatchlist

func (*MatchV1) Recent added in v0.17.0

func (e *MatchV1) Recent(ctx context.Context, route PlatformRoute, queue string) (*MatchRecentMatchesV1DTO, error)

Get recent matches

Implementation Notes

Returns a list of match ids that have completed in the last 10 minutes for live regions and 12 hours for the esports routing value. NA/LATAM/BR share a match history deployment. As such, recent matches will return a combined list of matches from those three regions. Requests are load balanced so you may see some inconsistencies as matches are added/removed from the list.

Parameters

  • route : Route to query.
  • queue

Riot API Reference

val-match-v1.getRecent

type MatchV1DTO added in v0.17.0

type MatchV1DTO struct {
	Coaches      []MatchCoachV1DTO       `json:"coaches,omitempty"`
	Players      []MatchPlayerV1DTO      `json:"players,omitempty"`
	RoundResults []MatchRoundResultV1DTO `json:"roundResults,omitempty"`
	Teams        []MatchTeamV1DTO        `json:"teams,omitempty"`
	MatchInfo    MatchInfoV1DTO          `json:"matchInfo,omitempty"`
}

val-match-v1.MatchDto

type MatchlistEntryV1DTO added in v0.17.0

type MatchlistEntryV1DTO struct {
	MatchID             string `json:"matchId,omitempty"`
	QueueID             string `json:"queueId,omitempty"`
	GameStartTimeMillis int64  `json:"gameStartTimeMillis,omitempty"`
}

val-match-v1.MatchlistEntryDto

type MatchlistV1DTO added in v0.17.0

type MatchlistV1DTO struct {
	PUUID   string                `json:"puuid,omitempty"`
	History []MatchlistEntryV1DTO `json:"history,omitempty"`
}

val-match-v1.MatchlistDto

type PlatformRoute added in v0.18.0

type PlatformRoute string

Platform routes for Valorant.

const (
	// Asia-Pacific.
	AP PlatformRoute = "ap"
	// Brazil.
	BR PlatformRoute = "br"
	// Special esports platform.
	ESPORTS PlatformRoute = "esports"
	// Europe.
	EU PlatformRoute = "eu"
	// Korea.
	KR PlatformRoute = "kr"
	// Latin America.
	LATAM PlatformRoute = "latam"
	// North America.
	NA PlatformRoute = "na"
)

func (PlatformRoute) String added in v1.0.0

func (route PlatformRoute) String() string

type RankedLeaderboardV1DTO added in v1.1.0

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"`
	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"`
	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.LeaderboardDto

type RankedPlayerV1DTO added in v1.1.0

type RankedPlayerV1DTO struct {
	// This field may be omitted if the player has been anonymized.
	GameName string `json:"gameName,omitempty"`
	// This field may be omitted if the player has been anonymized.
	PUUID string `json:"puuid,omitempty"`
	// This field may be omitted if the player has been anonymized.
	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.PlayerDto

type RankedTierDetailV1DTO added in v1.1.0

type RankedTierDetailV1DTO struct {
	RankedRatingThreshold int64 `json:"rankedRatingThreshold,omitempty"`
	StartingIndex         int64 `json:"startingIndex,omitempty"`
	StartingPage          int64 `json:"startingPage,omitempty"`
}

val-ranked-v1.TierDetailDto

type RankedV1 added in v0.17.0

type RankedV1 struct {
	// contains filtered or unexported fields
}

Riot API Reference

val-ranked-v1

func (*RankedV1) Leaderboard added in v0.17.0

func (e *RankedV1) Leaderboard(ctx context.Context, route PlatformRoute, actId string, size int32, startIndex int32) (*RankedLeaderboardV1DTO, error)

Get leaderboard for the competitive queue

Parameters

  • route : Route to query.
  • actId : Act ids can be found using the val-content API.
  • size (optional) : Defaults to 200. Valid values: 1 to 200.
  • startIndex (optional) : Defaults to 0.

Riot API Reference

val-ranked-v1.getLeaderboard

type StatusContentV1DTO added in v0.17.0

type StatusContentV1DTO struct {
	Content string `json:"content,omitempty"`
	Locale  string `json:"locale,omitempty"`
}

val-status-v1.ContentDto

type StatusPlatformDataV1DTO added in v1.1.0

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"`
}

val-status-v1.PlatformDataDto

type StatusUpdateV1DTO added in v1.1.0

type StatusUpdateV1DTO struct {
	Author    string `json:"author,omitempty"`
	CreatedAt string `json:"created_at,omitempty"`
	UpdatedAt string `json:"updated_at,omitempty"`
	// (Legal values: riotclient, riotstatus, game)
	PublishLocations []string             `json:"publish_locations,omitempty"`
	Translations     []StatusContentV1DTO `json:"translations,omitempty"`
	ID               int32                `json:"id,omitempty"`
	Publish          bool                 `json:"publish,omitempty"`
}

val-status-v1.UpdateDto

type StatusV1 added in v0.17.0

type StatusV1 struct {
	// contains filtered or unexported fields
}

Riot API Reference

val-status-v1

func (*StatusV1) Platform added in v0.17.0

func (e *StatusV1) Platform(ctx context.Context, route PlatformRoute) (*StatusPlatformDataV1DTO, error)

Get VALORANT status for the given platform.

Parameters

  • route : Route to query.

Riot API Reference

val-status-v1.getPlatformData

type StatusV1DTO added in v0.17.0

type StatusV1DTO struct {
	ArchiveAt string `json:"archive_at,omitempty"`
	CreatedAt string `json:"created_at,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"`
	Updates   []StatusUpdateV1DTO  `json:"updates,omitempty"`
	ID        int32                `json:"id,omitempty"`
}

val-status-v1.StatusDto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL