mirror of https://github.com/MingweiSamuel/Riven
parent
b30342ac47
commit
35d32eeb24
|
@ -300,6 +300,8 @@ pub enum Champion {
|
||||||
#[strum(to_string="Veigar")] Veigar = 45,
|
#[strum(to_string="Veigar")] Veigar = 45,
|
||||||
/// Vel'Koz (`Velkoz`, 161).
|
/// Vel'Koz (`Velkoz`, 161).
|
||||||
#[strum(to_string="Vel'Koz", serialize="Velkoz")] VelKoz = 161,
|
#[strum(to_string="Vel'Koz", serialize="Velkoz")] VelKoz = 161,
|
||||||
|
/// Vex (`Vex`, 711).
|
||||||
|
#[strum(to_string="Vex")] Vex = 711,
|
||||||
/// Vi (`Vi`, 254).
|
/// Vi (`Vi`, 254).
|
||||||
#[strum(to_string="Vi")] Vi = 254,
|
#[strum(to_string="Vi")] Vi = 254,
|
||||||
/// Viego (`Viego`, 234).
|
/// Viego (`Viego`, 234).
|
||||||
|
@ -504,6 +506,7 @@ impl Champion {
|
||||||
Self::Vayne => "Vayne",
|
Self::Vayne => "Vayne",
|
||||||
Self::Veigar => "Veigar",
|
Self::Veigar => "Veigar",
|
||||||
Self::VelKoz => "Velkoz",
|
Self::VelKoz => "Velkoz",
|
||||||
|
Self::Vex => "Vex",
|
||||||
Self::Vi => "Vi",
|
Self::Vi => "Vi",
|
||||||
Self::Viego => "Viego",
|
Self::Viego => "Viego",
|
||||||
Self::Viktor => "Viktor",
|
Self::Viktor => "Viktor",
|
||||||
|
|
124
src/endpoints.rs
124
src/endpoints.rs
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version 12e3bc69894adde9001edb3c64126cd90d4531bd
|
// Version 0715d17267a9bec35845651ad3fb702c5bcbdaa1
|
||||||
|
|
||||||
//! Automatically generated endpoint handles.
|
//! Automatically generated endpoint handles.
|
||||||
|
|
||||||
|
@ -140,15 +140,6 @@ impl RiotApi {
|
||||||
pub fn lor_status_v1(&self) -> LorStatusV1 {
|
pub fn lor_status_v1(&self) -> LorStatusV1 {
|
||||||
LorStatusV1 { base: self }
|
LorStatusV1 { base: self }
|
||||||
}
|
}
|
||||||
/// Returns a handle for accessing [MatchV4](crate::endpoints::MatchV4) endpoints.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/apis#match-v4" target="_blank">`match-v4`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
#[inline]
|
|
||||||
pub fn match_v4(&self) -> MatchV4 {
|
|
||||||
MatchV4 { base: self }
|
|
||||||
}
|
|
||||||
/// Returns a handle for accessing [MatchV5](crate::endpoints::MatchV5) endpoints.
|
/// Returns a handle for accessing [MatchV5](crate::endpoints::MatchV5) endpoints.
|
||||||
/// # Riot Developer API Reference
|
/// # Riot Developer API Reference
|
||||||
/// <a href="https://developer.riotgames.com/apis#match-v5" target="_blank">`match-v5`</a>
|
/// <a href="https://developer.riotgames.com/apis#match-v5" target="_blank">`match-v5`</a>
|
||||||
|
@ -799,117 +790,6 @@ impl<'a> LorStatusV1<'a> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// MatchV4 endpoints handle, accessed by calling [`match_v4()`](crate::RiotApi::match_v4) on a [`RiotApi`](crate::RiotApi) instance.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/apis#match-v4" target="_blank">`match-v4`</a>
|
|
||||||
///
|
|
||||||
/// Note: this struct is automatically generated.
|
|
||||||
pub struct MatchV4<'a> {
|
|
||||||
base: &'a RiotApi,
|
|
||||||
}
|
|
||||||
impl<'a> MatchV4<'a> {
|
|
||||||
/// Get match IDs by tournament code.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `region` - Region to query.
|
|
||||||
/// * `tournamentCode` - The tournament code.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchIdsByTournamentCode" target="_blank">`match-v4.getMatchIdsByTournamentCode`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_match_ids_by_tournament_code(&self, region: Region, tournament_code: &str)
|
|
||||||
-> impl Future<Output = Result<Vec<i64>>> + 'a
|
|
||||||
{
|
|
||||||
let path_string = format!("/lol/match/v4/matches/by-tournament-code/{}/ids", tournament_code);
|
|
||||||
self.base.get::<Vec<i64>>("match-v4.getMatchIdsByTournamentCode", region.into(), path_string, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get match by match ID.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `region` - Region to query.
|
|
||||||
/// * `matchId` - The match ID.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#match-v4/GET_getMatch" target="_blank">`match-v4.getMatch`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_match(&self, region: Region, match_id: i64)
|
|
||||||
-> impl Future<Output = Result<Option<match_v4::Match>>> + 'a
|
|
||||||
{
|
|
||||||
let path_string = format!("/lol/match/v4/matches/{}", match_id);
|
|
||||||
self.base.get_optional::<match_v4::Match>("match-v4.getMatch", region.into(), path_string, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get match by match ID and tournament code.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `region` - Region to query.
|
|
||||||
/// * `tournamentCode` - The tournament code.
|
|
||||||
/// * `matchId` - The match ID.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchByTournamentCode" target="_blank">`match-v4.getMatchByTournamentCode`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_match_by_tournament_code(&self, region: Region, match_id: i64, tournament_code: &str)
|
|
||||||
-> impl Future<Output = Result<match_v4::Match>> + 'a
|
|
||||||
{
|
|
||||||
let path_string = format!("/lol/match/v4/matches/{}/by-tournament-code/{}", match_id, tournament_code);
|
|
||||||
self.base.get::<match_v4::Match>("match-v4.getMatchByTournamentCode", region.into(), path_string, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get matchlist for games played on given account ID and platform ID and filtered using given filter parameters, if any.
|
|
||||||
/// ## Implementation Notes
|
|
||||||
/// A number of optional parameters are provided for filtering. It is up to the caller to ensure that the combination of filter parameters provided is valid for the requested account, otherwise, no matches may be returned.
|
|
||||||
///
|
|
||||||
/// If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned.
|
|
||||||
///
|
|
||||||
/// If beginTime is specified, but not endTime, then endTime defaults to the the current unix timestamp in milliseconds (the maximum time range limitation is not observed in this specific case). If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history returning a 400 due to the maximum time range limitation. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `region` - Region to query.
|
|
||||||
/// * `encryptedAccountId` - The account ID.
|
|
||||||
/// * `champion` (optional) - Set of champion IDs for filtering the matchlist.
|
|
||||||
/// * `queue` (optional) - Set of queue IDs for filtering the matchlist.
|
|
||||||
/// * `season` (optional) - [DEPRECATED] This field should not be considered reliable for the purposes of filtering matches by season.
|
|
||||||
/// * `endTime` (optional) - The end time to use for filtering matchlist specified as epoch milliseconds. If beginTime is specified, but not endTime, then endTime defaults to the the current unix timestamp in milliseconds (the maximum time range limitation is not observed in this specific case). If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history returning a 400 due to the maximum time range limitation. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned.
|
|
||||||
/// * `beginTime` (optional) - The begin time to use for filtering matchlist specified as epoch milliseconds. If beginTime is specified, but not endTime, then endTime defaults to the the current unix timestamp in milliseconds (the maximum time range limitation is not observed in this specific case). If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history returning a 400 due to the maximum time range limitation. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned.
|
|
||||||
/// * `endIndex` (optional) - The end index to use for filtering matchlist. If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned.
|
|
||||||
/// * `beginIndex` (optional) - The begin index to use for filtering matchlist. If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchlist" target="_blank">`match-v4.getMatchlist`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_matchlist(&self, region: Region, encrypted_account_id: &str, begin_time: Option<i64>, begin_index: Option<i32>, champion: Option<&[crate::consts::Champion]>, end_time: Option<i64>, end_index: Option<i32>, queue: Option<&[crate::consts::Queue]>, season: Option<&[crate::consts::Season]>)
|
|
||||||
-> impl Future<Output = Result<Option<match_v4::Matchlist>>> + 'a
|
|
||||||
{
|
|
||||||
let mut query_params = Serializer::new(String::new());
|
|
||||||
if let Some(begin_time) = begin_time { query_params.append_pair("beginTime", &*begin_time.to_string()); };
|
|
||||||
if let Some(begin_index) = begin_index { query_params.append_pair("beginIndex", &*begin_index.to_string()); };
|
|
||||||
if let Some(champion) = champion { query_params.extend_pairs(champion.iter().map(|w| ("champion", Into::<i16>::into(*w).to_string()))); };
|
|
||||||
if let Some(end_time) = end_time { query_params.append_pair("endTime", &*end_time.to_string()); };
|
|
||||||
if let Some(end_index) = end_index { query_params.append_pair("endIndex", &*end_index.to_string()); };
|
|
||||||
if let Some(queue) = queue { query_params.extend_pairs(queue.iter().map(|w| ("queue", Into::<u16>::into(*w).to_string()))); };
|
|
||||||
if let Some(season) = season { query_params.extend_pairs(season.iter().map(|w| ("season", Into::<u8>::into(*w).to_string()))); };
|
|
||||||
let query_string = query_params.finish();
|
|
||||||
let path_string = format!("/lol/match/v4/matchlists/by-account/{}", encrypted_account_id);
|
|
||||||
self.base.get_optional::<match_v4::Matchlist>("match-v4.getMatchlist", region.into(), path_string, Some(query_string))
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get match timeline by match ID.
|
|
||||||
/// ## Implementation Notes
|
|
||||||
/// Not all matches have timeline data.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `region` - Region to query.
|
|
||||||
/// * `matchId` - The match ID.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchTimeline" target="_blank">`match-v4.getMatchTimeline`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_match_timeline(&self, region: Region, match_id: i64)
|
|
||||||
-> impl Future<Output = Result<Option<match_v4::MatchTimeline>>> + 'a
|
|
||||||
{
|
|
||||||
let path_string = format!("/lol/match/v4/timelines/by-match/{}", match_id);
|
|
||||||
self.base.get_optional::<match_v4::MatchTimeline>("match-v4.getMatchTimeline", region.into(), path_string, None)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// MatchV5 endpoints handle, accessed by calling [`match_v5()`](crate::RiotApi::match_v5) on a [`RiotApi`](crate::RiotApi) instance.
|
/// MatchV5 endpoints handle, accessed by calling [`match_v5()`](crate::RiotApi::match_v5) on a [`RiotApi`](crate::RiotApi) instance.
|
||||||
/// # Riot Developer API Reference
|
/// # Riot Developer API Reference
|
||||||
/// <a href="https://developer.riotgames.com/apis#match-v5" target="_blank">`match-v5`</a>
|
/// <a href="https://developer.riotgames.com/apis#match-v5" target="_blank">`match-v5`</a>
|
||||||
|
@ -923,7 +803,7 @@ impl<'a> MatchV5<'a> {
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
/// * `region` - Region to query.
|
/// * `region` - Region to query.
|
||||||
/// * `puuid`
|
/// * `puuid`
|
||||||
/// * `startTime` (optional) - Epoch timestamp in seconds.
|
/// * `startTime` (optional) - Epoch timestamp in seconds. 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.
|
||||||
/// * `endTime` (optional) - Epoch timestamp in seconds.
|
/// * `endTime` (optional) - Epoch timestamp in seconds.
|
||||||
/// * `queue` (optional) - 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` (optional) - 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.
|
||||||
/// * `type` (optional) - 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` (optional) - 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.
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version 12e3bc69894adde9001edb3c64126cd90d4531bd
|
// Version 0715d17267a9bec35845651ad3fb702c5bcbdaa1
|
||||||
|
|
||||||
//! Metadata about the Riot API and Riven.
|
//! Metadata about the Riot API and Riven.
|
||||||
//!
|
//!
|
||||||
|
@ -45,11 +45,6 @@ lazy_static! {
|
||||||
map.insert("/lor/match/v1/matches/{matchId}", "lor-match-v1.getMatch");
|
map.insert("/lor/match/v1/matches/{matchId}", "lor-match-v1.getMatch");
|
||||||
map.insert("/lor/ranked/v1/leaderboards", "lor-ranked-v1.getLeaderboards");
|
map.insert("/lor/ranked/v1/leaderboards", "lor-ranked-v1.getLeaderboards");
|
||||||
map.insert("/lor/status/v1/platform-data", "lor-status-v1.getPlatformData");
|
map.insert("/lor/status/v1/platform-data", "lor-status-v1.getPlatformData");
|
||||||
map.insert("/lol/match/v4/matches/by-tournament-code/{tournamentCode}/ids", "match-v4.getMatchIdsByTournamentCode");
|
|
||||||
map.insert("/lol/match/v4/matches/{matchId}", "match-v4.getMatch");
|
|
||||||
map.insert("/lol/match/v4/matches/{matchId}/by-tournament-code/{tournamentCode}", "match-v4.getMatchByTournamentCode");
|
|
||||||
map.insert("/lol/match/v4/matchlists/by-account/{encryptedAccountId}", "match-v4.getMatchlist");
|
|
||||||
map.insert("/lol/match/v4/timelines/by-match/{matchId}", "match-v4.getMatchTimeline");
|
|
||||||
map.insert("/lol/match/v5/matches/by-puuid/{puuid}/ids", "match-v5.getMatchIdsByPUUID");
|
map.insert("/lol/match/v5/matches/by-puuid/{puuid}/ids", "match-v5.getMatchIdsByPUUID");
|
||||||
map.insert("/lol/match/v5/matches/{matchId}", "match-v5.getMatch");
|
map.insert("/lol/match/v5/matches/{matchId}", "match-v5.getMatch");
|
||||||
map.insert("/lol/match/v5/matches/{matchId}/timeline", "match-v5.getTimeline");
|
map.insert("/lol/match/v5/matches/{matchId}/timeline", "match-v5.getTimeline");
|
||||||
|
|
641
src/models.rs
641
src/models.rs
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version 12e3bc69894adde9001edb3c64126cd90d4531bd
|
// Version 0715d17267a9bec35845651ad3fb702c5bcbdaa1
|
||||||
|
|
||||||
//! Data transfer structs.
|
//! Data transfer structs.
|
||||||
//!
|
//!
|
||||||
|
@ -718,642 +718,6 @@ pub mod lor_status_v1 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Data structs used by [`MatchV4`](crate::endpoints::MatchV4).
|
|
||||||
///
|
|
||||||
/// Note: this module is automatically generated.
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub mod match_v4 {
|
|
||||||
/// Match data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct Match {
|
|
||||||
#[serde(rename = "gameId")]
|
|
||||||
pub game_id: i64,
|
|
||||||
/// Participant identity information. Participant identity information is purposefully excluded for custom games.
|
|
||||||
#[serde(rename = "participantIdentities")]
|
|
||||||
pub participant_identities: std::vec::Vec<ParticipantIdentity>,
|
|
||||||
/// Refer to the Game Constants documentation.
|
|
||||||
#[serde(rename = "queueId")]
|
|
||||||
pub queue_id: crate::consts::Queue,
|
|
||||||
/// Refer to the Game Constants documentation.
|
|
||||||
#[serde(rename = "gameType")]
|
|
||||||
pub game_type: crate::consts::GameType,
|
|
||||||
/// Match duration in seconds.
|
|
||||||
#[serde(rename = "gameDuration")]
|
|
||||||
pub game_duration: i64,
|
|
||||||
/// Team information.
|
|
||||||
#[serde(rename = "teams")]
|
|
||||||
pub teams: std::vec::Vec<TeamStats>,
|
|
||||||
/// Platform where the match was played.
|
|
||||||
#[serde(rename = "platformId")]
|
|
||||||
pub platform_id: String,
|
|
||||||
/// Designates the timestamp when champion select ended and the loading screen appeared, NOT when the game timer was at 0:00.
|
|
||||||
#[serde(rename = "gameCreation")]
|
|
||||||
pub game_creation: i64,
|
|
||||||
/// Refer to the Game Constants documentation.
|
|
||||||
#[serde(rename = "seasonId")]
|
|
||||||
pub season_id: crate::consts::Season,
|
|
||||||
/// The major.minor version typically indicates the patch the match was played on.
|
|
||||||
#[serde(rename = "gameVersion")]
|
|
||||||
pub game_version: String,
|
|
||||||
/// Refer to the Game Constants documentation.
|
|
||||||
#[serde(rename = "mapId")]
|
|
||||||
pub map_id: crate::consts::Map,
|
|
||||||
/// Refer to the Game Constants documentation.
|
|
||||||
#[serde(rename = "gameMode")]
|
|
||||||
pub game_mode: crate::consts::GameMode,
|
|
||||||
/// Participant information.
|
|
||||||
#[serde(rename = "participants")]
|
|
||||||
pub participants: std::vec::Vec<Participant>,
|
|
||||||
}
|
|
||||||
/// ParticipantIdentity data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct ParticipantIdentity {
|
|
||||||
#[serde(rename = "participantId")]
|
|
||||||
pub participant_id: i32,
|
|
||||||
/// Player information not included in the response for custom matches. Custom matches are considered private unless a tournament code was used to create the match.
|
|
||||||
#[serde(rename = "player")]
|
|
||||||
pub player: Player,
|
|
||||||
}
|
|
||||||
/// Player data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct Player {
|
|
||||||
#[serde(rename = "profileIcon")]
|
|
||||||
pub profile_icon: i32,
|
|
||||||
/// Player's original accountId.
|
|
||||||
#[serde(rename = "accountId")]
|
|
||||||
pub account_id: String,
|
|
||||||
#[serde(rename = "matchHistoryUri")]
|
|
||||||
pub match_history_uri: String,
|
|
||||||
/// Player's current accountId when the match was played.
|
|
||||||
#[serde(rename = "currentAccountId")]
|
|
||||||
pub current_account_id: String,
|
|
||||||
/// Player's current platformId when the match was played.
|
|
||||||
#[serde(rename = "currentPlatformId")]
|
|
||||||
pub current_platform_id: String,
|
|
||||||
#[serde(rename = "summonerName")]
|
|
||||||
pub summoner_name: String,
|
|
||||||
/// Player's summonerId (Encrypted)
|
|
||||||
#[serde(rename = "summonerId")]
|
|
||||||
pub summoner_id: Option<String>,
|
|
||||||
/// Player's original platformId.
|
|
||||||
#[serde(rename = "platformId")]
|
|
||||||
pub platform_id: String,
|
|
||||||
}
|
|
||||||
/// TeamStats data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct TeamStats {
|
|
||||||
/// Number of towers the team destroyed.
|
|
||||||
#[serde(rename = "towerKills")]
|
|
||||||
pub tower_kills: i32,
|
|
||||||
/// Number of times the team killed Rift Herald.
|
|
||||||
#[serde(rename = "riftHeraldKills")]
|
|
||||||
pub rift_herald_kills: i32,
|
|
||||||
/// Flag indicating whether or not the team scored the first blood.
|
|
||||||
#[serde(rename = "firstBlood")]
|
|
||||||
pub first_blood: bool,
|
|
||||||
/// Number of inhibitors the team destroyed.
|
|
||||||
#[serde(rename = "inhibitorKills")]
|
|
||||||
pub inhibitor_kills: i32,
|
|
||||||
/// If match queueId has a draft, contains banned champion data, otherwise empty.
|
|
||||||
#[serde(rename = "bans")]
|
|
||||||
pub bans: std::vec::Vec<TeamBans>,
|
|
||||||
/// Flag indicating whether or not the team scored the first Baron kill.
|
|
||||||
#[serde(rename = "firstBaron")]
|
|
||||||
pub first_baron: bool,
|
|
||||||
/// Flag indicating whether or not the team scored the first Dragon kill.
|
|
||||||
#[serde(rename = "firstDragon")]
|
|
||||||
pub first_dragon: bool,
|
|
||||||
/// For Dominion matches, specifies the points the team had at game end.
|
|
||||||
#[serde(rename = "dominionVictoryScore")]
|
|
||||||
pub dominion_victory_score: i32,
|
|
||||||
/// Number of times the team killed Dragon.
|
|
||||||
#[serde(rename = "dragonKills")]
|
|
||||||
pub dragon_kills: i32,
|
|
||||||
/// Number of times the team killed Baron.
|
|
||||||
#[serde(rename = "baronKills")]
|
|
||||||
pub baron_kills: i32,
|
|
||||||
/// Flag indicating whether or not the team destroyed the first inhibitor.
|
|
||||||
#[serde(rename = "firstInhibitor")]
|
|
||||||
pub first_inhibitor: bool,
|
|
||||||
/// Flag indicating whether or not the team destroyed the first tower.
|
|
||||||
#[serde(rename = "firstTower")]
|
|
||||||
pub first_tower: bool,
|
|
||||||
/// Number of times the team killed Vilemaw.
|
|
||||||
#[serde(rename = "vilemawKills")]
|
|
||||||
pub vilemaw_kills: i32,
|
|
||||||
/// Flag indicating whether or not the team scored the first Rift Herald kill.
|
|
||||||
#[serde(rename = "firstRiftHerald")]
|
|
||||||
pub first_rift_herald: bool,
|
|
||||||
/// 100 for blue side. 200 for red side.
|
|
||||||
#[serde(rename = "teamId")]
|
|
||||||
pub team_id: crate::consts::Team,
|
|
||||||
/// String indicating whether or not the team won. There are only two values visibile in public match history.<br>
|
|
||||||
/// (Legal values: Fail, Win)
|
|
||||||
#[serde(rename = "win")]
|
|
||||||
pub win: Option<String>,
|
|
||||||
}
|
|
||||||
/// TeamBans data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct TeamBans {
|
|
||||||
/// Banned championId.
|
|
||||||
#[serde(rename = "championId")]
|
|
||||||
pub champion_id: crate::consts::Champion,
|
|
||||||
/// Turn during which the champion was banned.
|
|
||||||
#[serde(rename = "pickTurn")]
|
|
||||||
pub pick_turn: i32,
|
|
||||||
}
|
|
||||||
/// Participant data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct Participant {
|
|
||||||
#[serde(rename = "participantId")]
|
|
||||||
pub participant_id: i32,
|
|
||||||
#[serde(rename = "championId")]
|
|
||||||
pub champion_id: crate::consts::Champion,
|
|
||||||
/// List of legacy Rune information. Not included for matches played with Runes Reforged.
|
|
||||||
#[serde(rename = "runes")]
|
|
||||||
pub runes: Option<std::vec::Vec<Rune>>,
|
|
||||||
/// Participant statistics.
|
|
||||||
#[serde(rename = "stats")]
|
|
||||||
pub stats: ParticipantStats,
|
|
||||||
/// 100 for blue side. 200 for red side.
|
|
||||||
#[serde(rename = "teamId")]
|
|
||||||
pub team_id: crate::consts::Team,
|
|
||||||
/// Participant timeline data.
|
|
||||||
#[serde(rename = "timeline")]
|
|
||||||
pub timeline: Option<ParticipantTimeline>,
|
|
||||||
/// First Summoner Spell id.
|
|
||||||
#[serde(rename = "spell1Id")]
|
|
||||||
pub spell1_id: i32,
|
|
||||||
/// Second Summoner Spell id.
|
|
||||||
#[serde(rename = "spell2Id")]
|
|
||||||
pub spell2_id: i32,
|
|
||||||
/// Highest ranked tier achieved for the previous season in a specific subset of queueIds, if any, otherwise null. Used to display border in game loading screen. Please refer to the Ranked Info documentation.<br>
|
|
||||||
/// (Legal values: CHALLENGER, MASTER, DIAMOND, PLATINUM, GOLD, SILVER, BRONZE, UNRANKED)
|
|
||||||
#[serde(rename = "highestAchievedSeasonTier")]
|
|
||||||
pub highest_achieved_season_tier: Option<crate::consts::Tier>,
|
|
||||||
/// List of legacy Mastery information. Not included for matches played with Runes Reforged.
|
|
||||||
#[serde(rename = "masteries")]
|
|
||||||
pub masteries: Option<std::vec::Vec<Mastery>>,
|
|
||||||
}
|
|
||||||
/// Rune data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct Rune {
|
|
||||||
#[serde(rename = "runeId")]
|
|
||||||
pub rune_id: i32,
|
|
||||||
#[serde(rename = "rank")]
|
|
||||||
pub rank: i32,
|
|
||||||
}
|
|
||||||
/// ParticipantStats data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct ParticipantStats {
|
|
||||||
#[serde(rename = "item0")]
|
|
||||||
pub item0: i32,
|
|
||||||
#[serde(rename = "item2")]
|
|
||||||
pub item2: i32,
|
|
||||||
#[serde(rename = "totalUnitsHealed")]
|
|
||||||
pub total_units_healed: i32,
|
|
||||||
#[serde(rename = "item1")]
|
|
||||||
pub item1: i32,
|
|
||||||
#[serde(rename = "largestMultiKill")]
|
|
||||||
pub largest_multi_kill: i32,
|
|
||||||
#[serde(rename = "goldEarned")]
|
|
||||||
pub gold_earned: i32,
|
|
||||||
#[serde(rename = "firstInhibitorKill")]
|
|
||||||
pub first_inhibitor_kill: Option<bool>,
|
|
||||||
#[serde(rename = "physicalDamageTaken")]
|
|
||||||
pub physical_damage_taken: i64,
|
|
||||||
#[serde(rename = "nodeNeutralizeAssist")]
|
|
||||||
pub node_neutralize_assist: Option<i32>,
|
|
||||||
#[serde(rename = "totalPlayerScore")]
|
|
||||||
pub total_player_score: Option<i32>,
|
|
||||||
#[serde(rename = "champLevel")]
|
|
||||||
pub champ_level: i32,
|
|
||||||
#[serde(rename = "damageDealtToObjectives")]
|
|
||||||
pub damage_dealt_to_objectives: i64,
|
|
||||||
#[serde(rename = "totalDamageTaken")]
|
|
||||||
pub total_damage_taken: i64,
|
|
||||||
#[serde(rename = "neutralMinionsKilled")]
|
|
||||||
pub neutral_minions_killed: i32,
|
|
||||||
#[serde(rename = "deaths")]
|
|
||||||
pub deaths: i32,
|
|
||||||
#[serde(rename = "tripleKills")]
|
|
||||||
pub triple_kills: i32,
|
|
||||||
#[serde(rename = "magicDamageDealtToChampions")]
|
|
||||||
pub magic_damage_dealt_to_champions: i64,
|
|
||||||
#[serde(rename = "wardsKilled")]
|
|
||||||
pub wards_killed: Option<i32>,
|
|
||||||
#[serde(rename = "pentaKills")]
|
|
||||||
pub penta_kills: i32,
|
|
||||||
#[serde(rename = "damageSelfMitigated")]
|
|
||||||
pub damage_self_mitigated: i64,
|
|
||||||
#[serde(rename = "largestCriticalStrike")]
|
|
||||||
pub largest_critical_strike: i32,
|
|
||||||
#[serde(rename = "nodeNeutralize")]
|
|
||||||
pub node_neutralize: Option<i32>,
|
|
||||||
#[serde(rename = "totalTimeCrowdControlDealt")]
|
|
||||||
pub total_time_crowd_control_dealt: i32,
|
|
||||||
#[serde(rename = "firstTowerKill")]
|
|
||||||
pub first_tower_kill: Option<bool>,
|
|
||||||
#[serde(rename = "magicDamageDealt")]
|
|
||||||
pub magic_damage_dealt: i64,
|
|
||||||
#[serde(rename = "totalScoreRank")]
|
|
||||||
pub total_score_rank: Option<i32>,
|
|
||||||
#[serde(rename = "nodeCapture")]
|
|
||||||
pub node_capture: Option<i32>,
|
|
||||||
#[serde(rename = "wardsPlaced")]
|
|
||||||
pub wards_placed: Option<i32>,
|
|
||||||
#[serde(rename = "totalDamageDealt")]
|
|
||||||
pub total_damage_dealt: i64,
|
|
||||||
#[serde(rename = "timeCCingOthers")]
|
|
||||||
pub time_c_cing_others: i64,
|
|
||||||
#[serde(rename = "magicalDamageTaken")]
|
|
||||||
pub magical_damage_taken: i64,
|
|
||||||
#[serde(rename = "largestKillingSpree")]
|
|
||||||
pub largest_killing_spree: i32,
|
|
||||||
#[serde(rename = "totalDamageDealtToChampions")]
|
|
||||||
pub total_damage_dealt_to_champions: i64,
|
|
||||||
#[serde(rename = "physicalDamageDealtToChampions")]
|
|
||||||
pub physical_damage_dealt_to_champions: i64,
|
|
||||||
#[serde(rename = "neutralMinionsKilledTeamJungle")]
|
|
||||||
pub neutral_minions_killed_team_jungle: Option<i32>,
|
|
||||||
#[serde(rename = "totalMinionsKilled")]
|
|
||||||
pub total_minions_killed: i32,
|
|
||||||
#[serde(rename = "firstInhibitorAssist")]
|
|
||||||
pub first_inhibitor_assist: Option<bool>,
|
|
||||||
#[serde(rename = "visionWardsBoughtInGame")]
|
|
||||||
pub vision_wards_bought_in_game: i32,
|
|
||||||
#[serde(rename = "objectivePlayerScore")]
|
|
||||||
pub objective_player_score: Option<i32>,
|
|
||||||
#[serde(rename = "kills")]
|
|
||||||
pub kills: i32,
|
|
||||||
#[serde(rename = "firstTowerAssist")]
|
|
||||||
pub first_tower_assist: Option<bool>,
|
|
||||||
#[serde(rename = "combatPlayerScore")]
|
|
||||||
pub combat_player_score: Option<i32>,
|
|
||||||
#[serde(rename = "inhibitorKills")]
|
|
||||||
pub inhibitor_kills: Option<i32>,
|
|
||||||
#[serde(rename = "turretKills")]
|
|
||||||
pub turret_kills: Option<i32>,
|
|
||||||
#[serde(rename = "participantId")]
|
|
||||||
pub participant_id: i32,
|
|
||||||
#[serde(rename = "trueDamageTaken")]
|
|
||||||
pub true_damage_taken: i64,
|
|
||||||
#[serde(rename = "firstBloodAssist")]
|
|
||||||
pub first_blood_assist: Option<bool>,
|
|
||||||
#[serde(rename = "nodeCaptureAssist")]
|
|
||||||
pub node_capture_assist: Option<i32>,
|
|
||||||
#[serde(rename = "assists")]
|
|
||||||
pub assists: i32,
|
|
||||||
#[serde(rename = "teamObjective")]
|
|
||||||
pub team_objective: Option<i32>,
|
|
||||||
#[serde(rename = "altarsNeutralized")]
|
|
||||||
pub altars_neutralized: Option<i32>,
|
|
||||||
#[serde(rename = "goldSpent")]
|
|
||||||
pub gold_spent: i32,
|
|
||||||
#[serde(rename = "damageDealtToTurrets")]
|
|
||||||
pub damage_dealt_to_turrets: i64,
|
|
||||||
#[serde(rename = "altarsCaptured")]
|
|
||||||
pub altars_captured: Option<i32>,
|
|
||||||
#[serde(rename = "win")]
|
|
||||||
pub win: bool,
|
|
||||||
#[serde(rename = "totalHeal")]
|
|
||||||
pub total_heal: i64,
|
|
||||||
#[serde(rename = "unrealKills")]
|
|
||||||
pub unreal_kills: i32,
|
|
||||||
#[serde(rename = "visionScore")]
|
|
||||||
pub vision_score: Option<i64>,
|
|
||||||
#[serde(rename = "physicalDamageDealt")]
|
|
||||||
pub physical_damage_dealt: i64,
|
|
||||||
#[serde(rename = "firstBloodKill")]
|
|
||||||
pub first_blood_kill: Option<bool>,
|
|
||||||
#[serde(rename = "longestTimeSpentLiving")]
|
|
||||||
pub longest_time_spent_living: i32,
|
|
||||||
#[serde(rename = "killingSprees")]
|
|
||||||
pub killing_sprees: i32,
|
|
||||||
#[serde(rename = "sightWardsBoughtInGame")]
|
|
||||||
pub sight_wards_bought_in_game: Option<i32>,
|
|
||||||
#[serde(rename = "trueDamageDealtToChampions")]
|
|
||||||
pub true_damage_dealt_to_champions: i64,
|
|
||||||
#[serde(rename = "neutralMinionsKilledEnemyJungle")]
|
|
||||||
pub neutral_minions_killed_enemy_jungle: Option<i32>,
|
|
||||||
#[serde(rename = "doubleKills")]
|
|
||||||
pub double_kills: i32,
|
|
||||||
#[serde(rename = "trueDamageDealt")]
|
|
||||||
pub true_damage_dealt: i64,
|
|
||||||
#[serde(rename = "quadraKills")]
|
|
||||||
pub quadra_kills: i32,
|
|
||||||
#[serde(rename = "item4")]
|
|
||||||
pub item4: i32,
|
|
||||||
#[serde(rename = "item3")]
|
|
||||||
pub item3: i32,
|
|
||||||
#[serde(rename = "item6")]
|
|
||||||
pub item6: i32,
|
|
||||||
#[serde(rename = "item5")]
|
|
||||||
pub item5: i32,
|
|
||||||
#[serde(rename = "playerScore0")]
|
|
||||||
pub player_score0: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore1")]
|
|
||||||
pub player_score1: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore2")]
|
|
||||||
pub player_score2: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore3")]
|
|
||||||
pub player_score3: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore4")]
|
|
||||||
pub player_score4: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore5")]
|
|
||||||
pub player_score5: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore6")]
|
|
||||||
pub player_score6: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore7")]
|
|
||||||
pub player_score7: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore8")]
|
|
||||||
pub player_score8: Option<i32>,
|
|
||||||
#[serde(rename = "playerScore9")]
|
|
||||||
pub player_score9: Option<i32>,
|
|
||||||
/// Primary path keystone rune.
|
|
||||||
#[serde(rename = "perk0")]
|
|
||||||
pub perk0: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk0Var1")]
|
|
||||||
pub perk0_var1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk0Var2")]
|
|
||||||
pub perk0_var2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk0Var3")]
|
|
||||||
pub perk0_var3: Option<i32>,
|
|
||||||
/// Primary path rune.
|
|
||||||
#[serde(rename = "perk1")]
|
|
||||||
pub perk1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk1Var1")]
|
|
||||||
pub perk1_var1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk1Var2")]
|
|
||||||
pub perk1_var2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk1Var3")]
|
|
||||||
pub perk1_var3: Option<i32>,
|
|
||||||
/// Primary path rune.
|
|
||||||
#[serde(rename = "perk2")]
|
|
||||||
pub perk2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk2Var1")]
|
|
||||||
pub perk2_var1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk2Var2")]
|
|
||||||
pub perk2_var2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk2Var3")]
|
|
||||||
pub perk2_var3: Option<i32>,
|
|
||||||
/// Primary path rune.
|
|
||||||
#[serde(rename = "perk3")]
|
|
||||||
pub perk3: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk3Var1")]
|
|
||||||
pub perk3_var1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk3Var2")]
|
|
||||||
pub perk3_var2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk3Var3")]
|
|
||||||
pub perk3_var3: Option<i32>,
|
|
||||||
/// Secondary path rune.
|
|
||||||
#[serde(rename = "perk4")]
|
|
||||||
pub perk4: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk4Var1")]
|
|
||||||
pub perk4_var1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk4Var2")]
|
|
||||||
pub perk4_var2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk4Var3")]
|
|
||||||
pub perk4_var3: Option<i32>,
|
|
||||||
/// Secondary path rune.
|
|
||||||
#[serde(rename = "perk5")]
|
|
||||||
pub perk5: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk5Var1")]
|
|
||||||
pub perk5_var1: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk5Var2")]
|
|
||||||
pub perk5_var2: Option<i32>,
|
|
||||||
/// Post game rune stats.
|
|
||||||
#[serde(rename = "perk5Var3")]
|
|
||||||
pub perk5_var3: Option<i32>,
|
|
||||||
/// Primary rune path
|
|
||||||
#[serde(rename = "perkPrimaryStyle")]
|
|
||||||
pub perk_primary_style: Option<i32>,
|
|
||||||
/// Secondary rune path
|
|
||||||
#[serde(rename = "perkSubStyle")]
|
|
||||||
pub perk_sub_style: Option<i32>,
|
|
||||||
/// Stat rune
|
|
||||||
#[serde(rename = "statPerk0")]
|
|
||||||
pub stat_perk0: Option<i32>,
|
|
||||||
/// Stat rune
|
|
||||||
#[serde(rename = "statPerk1")]
|
|
||||||
pub stat_perk1: Option<i32>,
|
|
||||||
/// Stat rune
|
|
||||||
#[serde(rename = "statPerk2")]
|
|
||||||
pub stat_perk2: Option<i32>,
|
|
||||||
}
|
|
||||||
/// ParticipantTimeline data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct ParticipantTimeline {
|
|
||||||
#[serde(rename = "participantId")]
|
|
||||||
pub participant_id: Option<i32>,
|
|
||||||
/// Creep score difference versus the calculated lane opponent(s) for a specified period.
|
|
||||||
#[serde(rename = "csDiffPerMinDeltas")]
|
|
||||||
pub cs_diff_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
/// Damage taken for a specified period.
|
|
||||||
#[serde(rename = "damageTakenPerMinDeltas")]
|
|
||||||
pub damage_taken_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
/// Participant's calculated role.<br>
|
|
||||||
/// (Legal values: DUO, NONE, SOLO, DUO_CARRY, DUO_SUPPORT)
|
|
||||||
#[serde(rename = "role")]
|
|
||||||
pub role: Option<String>,
|
|
||||||
/// Damage taken difference versus the calculated lane opponent(s) for a specified period.
|
|
||||||
#[serde(rename = "damageTakenDiffPerMinDeltas")]
|
|
||||||
pub damage_taken_diff_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
/// Experience change for a specified period.
|
|
||||||
#[serde(rename = "xpPerMinDeltas")]
|
|
||||||
pub xp_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
/// Experience difference versus the calculated lane opponent(s) for a specified period.
|
|
||||||
#[serde(rename = "xpDiffPerMinDeltas")]
|
|
||||||
pub xp_diff_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
/// Participant's calculated lane. MID and BOT are legacy values.<br>
|
|
||||||
/// (Legal values: MID, MIDDLE, TOP, JUNGLE, BOT, BOTTOM)
|
|
||||||
#[serde(rename = "lane")]
|
|
||||||
pub lane: Option<String>,
|
|
||||||
/// Creeps for a specified period.
|
|
||||||
#[serde(rename = "creepsPerMinDeltas")]
|
|
||||||
pub creeps_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
/// Gold for a specified period.
|
|
||||||
#[serde(rename = "goldPerMinDeltas")]
|
|
||||||
pub gold_per_min_deltas: Option<std::collections::HashMap<String, f64>>,
|
|
||||||
}
|
|
||||||
/// Mastery data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct Mastery {
|
|
||||||
#[serde(rename = "rank")]
|
|
||||||
pub rank: i32,
|
|
||||||
#[serde(rename = "masteryId")]
|
|
||||||
pub mastery_id: i32,
|
|
||||||
}
|
|
||||||
/// Matchlist data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct Matchlist {
|
|
||||||
#[serde(rename = "startIndex")]
|
|
||||||
pub start_index: i32,
|
|
||||||
/// There is a known issue that this field doesn't correctly return the total number of games that match the parameters of the request. Please paginate using beginIndex until you reach the end of a player's matchlist.
|
|
||||||
#[serde(rename = "totalGames")]
|
|
||||||
pub total_games: i32,
|
|
||||||
#[serde(rename = "endIndex")]
|
|
||||||
pub end_index: i32,
|
|
||||||
#[serde(rename = "matches")]
|
|
||||||
pub matches: std::vec::Vec<MatchReference>,
|
|
||||||
}
|
|
||||||
/// MatchReference data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct MatchReference {
|
|
||||||
#[serde(rename = "gameId")]
|
|
||||||
pub game_id: i64,
|
|
||||||
#[serde(rename = "role")]
|
|
||||||
pub role: Option<String>,
|
|
||||||
#[serde(rename = "season")]
|
|
||||||
pub season: i32,
|
|
||||||
#[serde(rename = "platformId")]
|
|
||||||
pub platform_id: String,
|
|
||||||
#[serde(rename = "champion")]
|
|
||||||
pub champion: crate::consts::Champion,
|
|
||||||
#[serde(rename = "queue")]
|
|
||||||
pub queue: crate::consts::Queue,
|
|
||||||
#[serde(rename = "lane")]
|
|
||||||
pub lane: Option<String>,
|
|
||||||
#[serde(rename = "timestamp")]
|
|
||||||
pub timestamp: i64,
|
|
||||||
}
|
|
||||||
/// MatchTimeline data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct MatchTimeline {
|
|
||||||
#[serde(rename = "frames")]
|
|
||||||
pub frames: std::vec::Vec<MatchFrame>,
|
|
||||||
#[serde(rename = "frameInterval")]
|
|
||||||
pub frame_interval: i64,
|
|
||||||
}
|
|
||||||
/// MatchFrame data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct MatchFrame {
|
|
||||||
#[serde(rename = "participantFrames")]
|
|
||||||
pub participant_frames: std::collections::HashMap<String, MatchParticipantFrame>,
|
|
||||||
#[serde(rename = "events")]
|
|
||||||
pub events: std::vec::Vec<MatchEvent>,
|
|
||||||
#[serde(rename = "timestamp")]
|
|
||||||
pub timestamp: i64,
|
|
||||||
}
|
|
||||||
/// MatchParticipantFrame data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct MatchParticipantFrame {
|
|
||||||
#[serde(rename = "participantId")]
|
|
||||||
pub participant_id: i32,
|
|
||||||
#[serde(rename = "minionsKilled")]
|
|
||||||
pub minions_killed: i32,
|
|
||||||
#[serde(rename = "teamScore")]
|
|
||||||
pub team_score: Option<i32>,
|
|
||||||
#[serde(rename = "dominionScore")]
|
|
||||||
pub dominion_score: Option<i32>,
|
|
||||||
#[serde(rename = "totalGold")]
|
|
||||||
pub total_gold: i32,
|
|
||||||
#[serde(rename = "level")]
|
|
||||||
pub level: i32,
|
|
||||||
#[serde(rename = "xp")]
|
|
||||||
pub xp: i32,
|
|
||||||
#[serde(rename = "currentGold")]
|
|
||||||
pub current_gold: i32,
|
|
||||||
#[serde(rename = "position")]
|
|
||||||
pub position: Option<MatchPosition>,
|
|
||||||
#[serde(rename = "jungleMinionsKilled")]
|
|
||||||
pub jungle_minions_killed: i32,
|
|
||||||
}
|
|
||||||
/// MatchPosition data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct MatchPosition {
|
|
||||||
#[serde(rename = "x")]
|
|
||||||
pub x: i32,
|
|
||||||
#[serde(rename = "y")]
|
|
||||||
pub y: i32,
|
|
||||||
}
|
|
||||||
/// MatchEvent data object.
|
|
||||||
#[derive(Debug)]
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
pub struct MatchEvent {
|
|
||||||
#[serde(rename = "laneType")]
|
|
||||||
pub lane_type: Option<String>,
|
|
||||||
#[serde(rename = "skillSlot")]
|
|
||||||
pub skill_slot: Option<i32>,
|
|
||||||
#[serde(rename = "ascendedType")]
|
|
||||||
pub ascended_type: Option<String>,
|
|
||||||
#[serde(rename = "creatorId")]
|
|
||||||
pub creator_id: Option<i32>,
|
|
||||||
#[serde(rename = "afterId")]
|
|
||||||
pub after_id: Option<i32>,
|
|
||||||
#[serde(rename = "eventType")]
|
|
||||||
pub event_type: Option<String>,
|
|
||||||
/// (Legal values: CHAMPION_KILL, WARD_PLACED, WARD_KILL, BUILDING_KILL, ELITE_MONSTER_KILL, ITEM_PURCHASED, ITEM_SOLD, ITEM_DESTROYED, ITEM_UNDO, SKILL_LEVEL_UP, ASCENDED_EVENT, CAPTURE_POINT, PORO_KING_SUMMON)
|
|
||||||
#[serde(rename = "type")]
|
|
||||||
pub r#type: String,
|
|
||||||
#[serde(rename = "levelUpType")]
|
|
||||||
pub level_up_type: Option<String>,
|
|
||||||
#[serde(rename = "wardType")]
|
|
||||||
pub ward_type: Option<String>,
|
|
||||||
#[serde(rename = "participantId")]
|
|
||||||
pub participant_id: Option<i32>,
|
|
||||||
#[serde(rename = "towerType")]
|
|
||||||
pub tower_type: Option<String>,
|
|
||||||
#[serde(rename = "itemId")]
|
|
||||||
pub item_id: Option<i32>,
|
|
||||||
#[serde(rename = "beforeId")]
|
|
||||||
pub before_id: Option<i32>,
|
|
||||||
#[serde(rename = "pointCaptured")]
|
|
||||||
pub point_captured: Option<String>,
|
|
||||||
#[serde(rename = "monsterType")]
|
|
||||||
pub monster_type: Option<String>,
|
|
||||||
#[serde(rename = "monsterSubType")]
|
|
||||||
pub monster_sub_type: Option<String>,
|
|
||||||
#[serde(rename = "teamId")]
|
|
||||||
pub team_id: Option<crate::consts::Team>,
|
|
||||||
#[serde(rename = "position")]
|
|
||||||
pub position: Option<MatchPosition>,
|
|
||||||
#[serde(rename = "killerId")]
|
|
||||||
pub killer_id: Option<i32>,
|
|
||||||
#[serde(rename = "timestamp")]
|
|
||||||
pub timestamp: i64,
|
|
||||||
#[serde(rename = "assistingParticipantIds")]
|
|
||||||
pub assisting_participant_ids: Option<std::vec::Vec<i32>>,
|
|
||||||
#[serde(rename = "buildingType")]
|
|
||||||
pub building_type: Option<String>,
|
|
||||||
#[serde(rename = "victimId")]
|
|
||||||
pub victim_id: Option<i32>,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Data structs used by [`MatchV5`](crate::endpoints::MatchV5).
|
/// Data structs used by [`MatchV5`](crate::endpoints::MatchV5).
|
||||||
///
|
///
|
||||||
/// Note: this module is automatically generated.
|
/// Note: this module is automatically generated.
|
||||||
|
@ -1444,6 +808,7 @@ pub mod match_v5 {
|
||||||
pub champion_id: i32,
|
pub champion_id: i32,
|
||||||
#[serde(rename = "championName")]
|
#[serde(rename = "championName")]
|
||||||
pub champion_name: String,
|
pub champion_name: String,
|
||||||
|
/// This field is currently only utilized for Kayn's transformations. (Legal values: 0 - None, 1 - Slayer, 2 - Assassin)
|
||||||
#[serde(rename = "championTransform")]
|
#[serde(rename = "championTransform")]
|
||||||
pub champion_transform: i32,
|
pub champion_transform: i32,
|
||||||
#[serde(rename = "consumablesPurchased")]
|
#[serde(rename = "consumablesPurchased")]
|
||||||
|
@ -1480,6 +845,7 @@ pub mod match_v5 {
|
||||||
pub gold_earned: i32,
|
pub gold_earned: i32,
|
||||||
#[serde(rename = "goldSpent")]
|
#[serde(rename = "goldSpent")]
|
||||||
pub gold_spent: i32,
|
pub gold_spent: i32,
|
||||||
|
/// 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.
|
||||||
#[serde(rename = "individualPosition")]
|
#[serde(rename = "individualPosition")]
|
||||||
pub individual_position: String,
|
pub individual_position: String,
|
||||||
#[serde(rename = "inhibitorKills")]
|
#[serde(rename = "inhibitorKills")]
|
||||||
|
@ -1588,6 +954,7 @@ pub mod match_v5 {
|
||||||
pub team_early_surrendered: bool,
|
pub team_early_surrendered: bool,
|
||||||
#[serde(rename = "teamId")]
|
#[serde(rename = "teamId")]
|
||||||
pub team_id: i32,
|
pub team_id: i32,
|
||||||
|
/// 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.
|
||||||
#[serde(rename = "teamPosition")]
|
#[serde(rename = "teamPosition")]
|
||||||
pub team_position: String,
|
pub team_position: String,
|
||||||
#[serde(rename = "timeCCingOthers")]
|
#[serde(rename = "timeCCingOthers")]
|
||||||
|
|
|
@ -46,76 +46,77 @@ async_tests!{
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
|
|
||||||
matchlist_get: async {
|
// TODO: MATCH-V4 REMOVED.
|
||||||
let sp = RIOT_API.summoner_v4().get_by_summoner_name(Region::NA, "haha yes");
|
// matchlist_get: async {
|
||||||
let s = sp.await.map_err(|e| e.to_string())?.ok_or("Failed to get \"haha yes\"".to_owned())?;
|
// let sp = RIOT_API.summoner_v4().get_by_summoner_name(Region::NA, "haha yes");
|
||||||
let mp = RIOT_API.match_v4().get_matchlist(Region::NA, &s.account_id, None, Some(2500), None, None, Some(2600), None, None);
|
// let s = sp.await.map_err(|e| e.to_string())?.ok_or("Failed to get \"haha yes\"".to_owned())?;
|
||||||
let m = mp.await.map_err(|e| e.to_string())?.ok_or("Failed to get matchlist".to_owned())?;
|
// let mp = RIOT_API.match_v4().get_matchlist(Region::NA, &s.account_id, None, Some(2500), None, None, Some(2600), None, None);
|
||||||
rassert!(m.matches.len() > 0, "Matchlist should not be empty");
|
// let m = mp.await.map_err(|e| e.to_string())?.ok_or("Failed to get matchlist".to_owned())?;
|
||||||
Ok(())
|
// rassert!(m.matches.len() > 0, "Matchlist should not be empty");
|
||||||
},
|
// Ok(())
|
||||||
|
// },
|
||||||
|
|
||||||
match_get: async {
|
// match_get: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 3190191338);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 3190191338);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_bots: async {
|
// match_get_bots: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 3251803350);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 3251803350);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_odyssey: async {
|
// match_get_odyssey: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 2881976826);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 2881976826);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_aram: async {
|
// match_get_aram: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 2961635718);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 2961635718);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_aram2: async {
|
// match_get_aram2: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 3596184782);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 3596184782);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Match not found.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_urf900: async {
|
// match_get_urf900: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 2963663381);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 2963663381);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_tutorial1: async {
|
// match_get_tutorial1: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 3432145099);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 3432145099);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_tutorial2: async {
|
// match_get_tutorial2: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 3432116214);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 3432116214);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
match_get_tutorial3: async {
|
// match_get_tutorial3: async {
|
||||||
let p = RIOT_API.match_v4().get_match(Region::NA, 3432156790);
|
// let p = RIOT_API.match_v4().get_match(Region::NA, 3432156790);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get match.".to_owned())?;
|
||||||
rassert!(!m.participants.is_empty(), "Match should have participants.");
|
// rassert!(!m.participants.is_empty(), "Match should have participants.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
|
|
||||||
match_gettimeline: async {
|
// match_gettimeline: async {
|
||||||
let p = RIOT_API.match_v4().get_match_timeline(Region::NA, 3190191338);
|
// let p = RIOT_API.match_v4().get_match_timeline(Region::NA, 3190191338);
|
||||||
let m = p.await.map_err(|e| e.to_string())?.ok_or("Match timeline not found.".to_owned())?;
|
// let m = p.await.map_err(|e| e.to_string())?.ok_or("Match timeline not found.".to_owned())?;
|
||||||
rassert!(!m.frames.is_empty(), "Match timeline should have frames.");
|
// rassert!(!m.frames.is_empty(), "Match timeline should have frames.");
|
||||||
Ok(())
|
// Ok(())
|
||||||
},
|
// },
|
||||||
|
|
||||||
|
|
||||||
// Commented out, requires special API key.
|
// Commented out, requires special API key.
|
||||||
|
|
Loading…
Reference in New Issue