mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 03:16:33 +00:00
Regen for Naafiri, removed champion-mastery-v4 by-puuid endpoints, off-season nullables
This commit is contained in:
parent
d15d43797e
commit
2aa493abfe
6 changed files with 56 additions and 122 deletions
|
@ -97,6 +97,7 @@ newtype_enum! {
|
||||||
/// `MISS_FORTUNE` | "Miss Fortune" | "MissFortune" | 21
|
/// `MISS_FORTUNE` | "Miss Fortune" | "MissFortune" | 21
|
||||||
/// `MORDEKAISER` | "Mordekaiser" | "Mordekaiser" | 82
|
/// `MORDEKAISER` | "Mordekaiser" | "Mordekaiser" | 82
|
||||||
/// `MORGANA` | "Morgana" | "Morgana" | 25
|
/// `MORGANA` | "Morgana" | "Morgana" | 25
|
||||||
|
/// `NAAFIRI` | "Naafiri" | "Naafiri" | 950
|
||||||
/// `NAMI` | "Nami" | "Nami" | 267
|
/// `NAMI` | "Nami" | "Nami" | 267
|
||||||
/// `NASUS` | "Nasus" | "Nasus" | 75
|
/// `NASUS` | "Nasus" | "Nasus" | 75
|
||||||
/// `NAUTILUS` | "Nautilus" | "Nautilus" | 111
|
/// `NAUTILUS` | "Nautilus" | "Nautilus" | 111
|
||||||
|
@ -345,6 +346,8 @@ newtype_enum! {
|
||||||
MORDEKAISER = 82,
|
MORDEKAISER = 82,
|
||||||
/// `25`.
|
/// `25`.
|
||||||
MORGANA = 25,
|
MORGANA = 25,
|
||||||
|
/// `950`.
|
||||||
|
NAAFIRI = 950,
|
||||||
/// `267`.
|
/// `267`.
|
||||||
NAMI = 267,
|
NAMI = 267,
|
||||||
/// `75`.
|
/// `75`.
|
||||||
|
@ -597,6 +600,7 @@ impl Champion {
|
||||||
Self::MISS_FORTUNE => Some("Miss Fortune"),
|
Self::MISS_FORTUNE => Some("Miss Fortune"),
|
||||||
Self::MORDEKAISER => Some("Mordekaiser"),
|
Self::MORDEKAISER => Some("Mordekaiser"),
|
||||||
Self::MORGANA => Some("Morgana"),
|
Self::MORGANA => Some("Morgana"),
|
||||||
|
Self::NAAFIRI => Some("Naafiri"),
|
||||||
Self::NAMI => Some("Nami"),
|
Self::NAMI => Some("Nami"),
|
||||||
Self::NASUS => Some("Nasus"),
|
Self::NASUS => Some("Nasus"),
|
||||||
Self::NAUTILUS => Some("Nautilus"),
|
Self::NAUTILUS => Some("Nautilus"),
|
||||||
|
@ -784,6 +788,7 @@ impl Champion {
|
||||||
Self::MISS_FORTUNE => Some("MissFortune"),
|
Self::MISS_FORTUNE => Some("MissFortune"),
|
||||||
Self::MORDEKAISER => Some("Mordekaiser"),
|
Self::MORDEKAISER => Some("Mordekaiser"),
|
||||||
Self::MORGANA => Some("Morgana"),
|
Self::MORGANA => Some("Morgana"),
|
||||||
|
Self::NAAFIRI => Some("Naafiri"),
|
||||||
Self::NAMI => Some("Nami"),
|
Self::NAMI => Some("Nami"),
|
||||||
Self::NASUS => Some("Nasus"),
|
Self::NASUS => Some("Nasus"),
|
||||||
Self::NAUTILUS => Some("Nautilus"),
|
Self::NAUTILUS => Some("Nautilus"),
|
||||||
|
@ -1009,6 +1014,7 @@ impl std::str::FromStr for Champion {
|
||||||
/* MISS */ [ 'M', 'I', 'S', 'S'] => Ok(Champion::MISS_FORTUNE),
|
/* MISS */ [ 'M', 'I', 'S', 'S'] => Ok(Champion::MISS_FORTUNE),
|
||||||
/* MORD */ [ 'M', 'O', 'R', 'D'] => Ok(Champion::MORDEKAISER),
|
/* MORD */ [ 'M', 'O', 'R', 'D'] => Ok(Champion::MORDEKAISER),
|
||||||
/* MORG */ [ 'M', 'O', 'R', 'G'] => Ok(Champion::MORGANA),
|
/* MORG */ [ 'M', 'O', 'R', 'G'] => Ok(Champion::MORGANA),
|
||||||
|
/* NAAF */ [ 'N', 'A', 'A', 'F'] => Ok(Champion::NAAFIRI),
|
||||||
/* NAMI */ [ 'N', 'A', 'M', 'I'] => Ok(Champion::NAMI),
|
/* NAMI */ [ 'N', 'A', 'M', 'I'] => Ok(Champion::NAMI),
|
||||||
/* NASU */ [ 'N', 'A', 'S', 'U'] => Ok(Champion::NASUS),
|
/* NASU */ [ 'N', 'A', 'S', 'U'] => Ok(Champion::NASUS),
|
||||||
/* NAUT */ [ 'N', 'A', 'U', 'T'] => Ok(Champion::NAUTILUS),
|
/* NAUT */ [ 'N', 'A', 'U', 'T'] => Ok(Champion::NAUTILUS),
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version 54c6fd7144adb63e54515df33a6a557eed0f17ba
|
// Version 7d71fe40a50ce14ad12ed6db791a4d0bae0f810e
|
||||||
|
|
||||||
//! Automatically generated endpoint handles.
|
//! Automatically generated endpoint handles.
|
||||||
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
||||||
|
@ -372,66 +372,6 @@ pub struct ChampionMasteryV4<'a> {
|
||||||
base: &'a RiotApi,
|
base: &'a RiotApi,
|
||||||
}
|
}
|
||||||
impl<'a> ChampionMasteryV4<'a> {
|
impl<'a> ChampionMasteryV4<'a> {
|
||||||
/// Get all champion mastery entries sorted by number of champion points descending.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `route` - Route to query.
|
|
||||||
/// * `encrypted_puuid` (required, in path)
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getAllChampionMasteriesByPUUID" target="_blank">`champion-mastery-v4.getAllChampionMasteriesByPUUID`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_all_champion_masteries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str)
|
|
||||||
-> impl Future<Output = Result<Vec<champion_mastery_v4::ChampionMastery>>> + 'a
|
|
||||||
{
|
|
||||||
let route_str = route.into();
|
|
||||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}", encrypted_puuid));
|
|
||||||
let future = self.base.execute_val::<Vec<champion_mastery_v4::ChampionMastery>>("champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str, request);
|
|
||||||
#[cfg(feature = "tracing")]
|
|
||||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getAllChampionMasteriesByPUUID"));
|
|
||||||
future
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get a champion mastery by puuid and champion ID.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `route` - Route to query.
|
|
||||||
/// * `encrypted_puuid` (required, in path)
|
|
||||||
/// * `champion_id` (required, in path) - Champion ID to retrieve Champion Mastery.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getChampionMasteryByPUUID" target="_blank">`champion-mastery-v4.getChampionMasteryByPUUID`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_champion_mastery_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str, champion_id: &str)
|
|
||||||
-> impl Future<Output = Result<champion_mastery_v4::ChampionMastery>> + 'a
|
|
||||||
{
|
|
||||||
let route_str = route.into();
|
|
||||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/by-champion/{}", encrypted_puuid, champion_id));
|
|
||||||
let future = self.base.execute_val::<champion_mastery_v4::ChampionMastery>("champion-mastery-v4.getChampionMasteryByPUUID", route_str, request);
|
|
||||||
#[cfg(feature = "tracing")]
|
|
||||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryByPUUID"));
|
|
||||||
future
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get specified number of top champion mastery entries sorted by number of champion points descending.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `route` - Route to query.
|
|
||||||
/// * `encrypted_puuid` (required, in path)
|
|
||||||
/// * `count` (optional, in query) - Number of entries to retrieve, defaults to 3.
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getTopChampionMasteriesByPUUID" target="_blank">`champion-mastery-v4.getTopChampionMasteriesByPUUID`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_top_champion_masteries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str, count: Option<i32>)
|
|
||||||
-> impl Future<Output = Result<Vec<champion_mastery_v4::ChampionMastery>>> + 'a
|
|
||||||
{
|
|
||||||
let route_str = route.into();
|
|
||||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/top", encrypted_puuid));
|
|
||||||
let mut request = request; if let Some(count) = count { request = request.query(&[ ("count", count) ]); }
|
|
||||||
let future = self.base.execute_val::<Vec<champion_mastery_v4::ChampionMastery>>("champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str, request);
|
|
||||||
#[cfg(feature = "tracing")]
|
|
||||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getTopChampionMasteriesByPUUID"));
|
|
||||||
future
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get all champion mastery entries sorted by number of champion points descending,
|
/// Get all champion mastery entries sorted by number of champion points descending,
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
/// * `route` - Route to query.
|
/// * `route` - Route to query.
|
||||||
|
@ -492,25 +432,6 @@ impl<'a> ChampionMasteryV4<'a> {
|
||||||
future
|
future
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
|
|
||||||
/// # Parameters
|
|
||||||
/// * `route` - Route to query.
|
|
||||||
/// * `encrypted_puuid` (required, in path)
|
|
||||||
/// # Riot Developer API Reference
|
|
||||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getChampionMasteryScoreByPUUID" target="_blank">`champion-mastery-v4.getChampionMasteryScoreByPUUID`</a>
|
|
||||||
///
|
|
||||||
/// Note: this method is automatically generated.
|
|
||||||
pub fn get_champion_mastery_score_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str)
|
|
||||||
-> impl Future<Output = Result<i32>> + 'a
|
|
||||||
{
|
|
||||||
let route_str = route.into();
|
|
||||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/scores/by-puuid/{}", encrypted_puuid));
|
|
||||||
let future = self.base.execute_val::<i32>("champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str, request);
|
|
||||||
#[cfg(feature = "tracing")]
|
|
||||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryScoreByPUUID"));
|
|
||||||
future
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
|
/// Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
/// * `route` - Route to query.
|
/// * `route` - Route to query.
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version 54c6fd7144adb63e54515df33a6a557eed0f17ba
|
// Version 7d71fe40a50ce14ad12ed6db791a4d0bae0f810e
|
||||||
|
|
||||||
//! Metadata about the Riot API and Riven.
|
//! Metadata about the Riot API and Riven.
|
||||||
//!
|
//!
|
||||||
|
@ -15,18 +15,14 @@
|
||||||
|
|
||||||
/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains
|
/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains
|
||||||
/// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID.
|
/// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID.
|
||||||
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 83] = [
|
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 79] = [
|
||||||
(reqwest::Method::GET, "/riot/account/v1/accounts/by-puuid/{puuid}", "account-v1.getByPuuid"),
|
(reqwest::Method::GET, "/riot/account/v1/accounts/by-puuid/{puuid}", "account-v1.getByPuuid"),
|
||||||
(reqwest::Method::GET, "/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}", "account-v1.getByRiotId"),
|
(reqwest::Method::GET, "/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}", "account-v1.getByRiotId"),
|
||||||
(reqwest::Method::GET, "/riot/account/v1/accounts/me", "account-v1.getByAccessToken"),
|
(reqwest::Method::GET, "/riot/account/v1/accounts/me", "account-v1.getByAccessToken"),
|
||||||
(reqwest::Method::GET, "/riot/account/v1/active-shards/by-game/{game}/by-puuid/{puuid}", "account-v1.getActiveShard"),
|
(reqwest::Method::GET, "/riot/account/v1/active-shards/by-game/{game}/by-puuid/{puuid}", "account-v1.getActiveShard"),
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}", "champion-mastery-v4.getAllChampionMasteriesByPUUID"),
|
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/by-champion/{championId}", "champion-mastery-v4.getChampionMasteryByPUUID"),
|
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/top", "champion-mastery-v4.getTopChampionMasteriesByPUUID"),
|
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}", "champion-mastery-v4.getAllChampionMasteries"),
|
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}", "champion-mastery-v4.getAllChampionMasteries"),
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/by-champion/{championId}", "champion-mastery-v4.getChampionMastery"),
|
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/by-champion/{championId}", "champion-mastery-v4.getChampionMastery"),
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/top", "champion-mastery-v4.getTopChampionMasteries"),
|
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/top", "champion-mastery-v4.getTopChampionMasteries"),
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/scores/by-puuid/{encryptedPUUID}", "champion-mastery-v4.getChampionMasteryScoreByPUUID"),
|
|
||||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/scores/by-summoner/{encryptedSummonerId}", "champion-mastery-v4.getChampionMasteryScore"),
|
(reqwest::Method::GET, "/lol/champion-mastery/v4/scores/by-summoner/{encryptedSummonerId}", "champion-mastery-v4.getChampionMasteryScore"),
|
||||||
(reqwest::Method::GET, "/lol/platform/v3/champion-rotations", "champion-v3.getChampionInfo"),
|
(reqwest::Method::GET, "/lol/platform/v3/champion-rotations", "champion-v3.getChampionInfo"),
|
||||||
(reqwest::Method::GET, "/lol/clash/v1/players/by-puuid/{encryptedPUUID}", "clash-v1.getPlayersByPUUID"),
|
(reqwest::Method::GET, "/lol/clash/v1/players/by-puuid/{encryptedPUUID}", "clash-v1.getPlayersByPUUID"),
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
///////////////////////////////////////////////
|
///////////////////////////////////////////////
|
||||||
|
|
||||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||||
// Version 54c6fd7144adb63e54515df33a6a557eed0f17ba
|
// Version 7d71fe40a50ce14ad12ed6db791a4d0bae0f810e
|
||||||
|
|
||||||
#![allow(missing_docs)]
|
#![allow(missing_docs)]
|
||||||
|
|
||||||
|
@ -269,15 +269,18 @@ pub mod league_v4 {
|
||||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||||
pub struct LeagueList {
|
pub struct LeagueList {
|
||||||
#[serde(rename = "leagueId")]
|
#[serde(rename = "leagueId")]
|
||||||
pub league_id: String,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub league_id: Option<String>,
|
||||||
#[serde(rename = "entries")]
|
#[serde(rename = "entries")]
|
||||||
pub entries: std::vec::Vec<LeagueItem>,
|
pub entries: std::vec::Vec<LeagueItem>,
|
||||||
#[serde(rename = "tier")]
|
#[serde(rename = "tier")]
|
||||||
pub tier: crate::consts::Tier,
|
pub tier: crate::consts::Tier,
|
||||||
#[serde(rename = "name")]
|
#[serde(rename = "name")]
|
||||||
pub name: String,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub name: Option<String>,
|
||||||
#[serde(rename = "queue")]
|
#[serde(rename = "queue")]
|
||||||
pub queue: crate::consts::QueueType,
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
pub queue: Option<crate::consts::QueueType>,
|
||||||
}
|
}
|
||||||
/// LeagueItem data object.
|
/// LeagueItem data object.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
@ -403,9 +406,9 @@ pub mod lol_challenges_v1 {
|
||||||
}
|
}
|
||||||
/// State data object.
|
/// State data object.
|
||||||
/// # Description
|
/// # Description
|
||||||
/// DISABLED - not visible and not calculated,<br>
|
/// DISABLED - not visible and not calculated,<br>
|
||||||
/// HIDDEN - not visible, but calculated,<br>
|
/// HIDDEN - not visible, but calculated,<br>
|
||||||
/// ENABLED - visible and calculated,<br>
|
/// ENABLED - visible and calculated,<br>
|
||||||
/// ARCHIVED - visible, but not calculated
|
/// ARCHIVED - visible, but not calculated
|
||||||
///
|
///
|
||||||
/// Note: This struct is automatically generated
|
/// Note: This struct is automatically generated
|
||||||
|
@ -416,7 +419,7 @@ pub mod lol_challenges_v1 {
|
||||||
}
|
}
|
||||||
/// Tracking data object.
|
/// Tracking data object.
|
||||||
/// # Description
|
/// # Description
|
||||||
/// LIFETIME - stats are incremented without reset,<br>
|
/// LIFETIME - stats are incremented without reset,<br>
|
||||||
/// SEASON - stats are accumulated by season and reset at the beginning of new season
|
/// SEASON - stats are accumulated by season and reset at the beginning of new season
|
||||||
///
|
///
|
||||||
/// Note: This struct is automatically generated
|
/// Note: This struct is automatically generated
|
||||||
|
@ -439,15 +442,15 @@ pub mod lol_challenges_v1 {
|
||||||
}
|
}
|
||||||
/// Level data object.
|
/// Level data object.
|
||||||
/// # Description
|
/// # Description
|
||||||
/// 0 NONE,<br>
|
/// 0 NONE,<br>
|
||||||
/// 1 IRON,<br>
|
/// 1 IRON,<br>
|
||||||
/// 2 BRONZE,<br>
|
/// 2 BRONZE,<br>
|
||||||
/// 3 SILVER,<br>
|
/// 3 SILVER,<br>
|
||||||
/// 4 GOLD,<br>
|
/// 4 GOLD,<br>
|
||||||
/// 5 PLATINUM,<br>
|
/// 5 PLATINUM,<br>
|
||||||
/// 6 DIAMOND,<br>
|
/// 6 DIAMOND,<br>
|
||||||
/// 7 MASTER,<br>
|
/// 7 MASTER,<br>
|
||||||
/// 8 GRANDMASTER,<br>
|
/// 8 GRANDMASTER,<br>
|
||||||
/// 9 CHALLENGER
|
/// 9 CHALLENGER
|
||||||
///
|
///
|
||||||
/// Note: This struct is automatically generated
|
/// Note: This struct is automatically generated
|
||||||
|
@ -1840,7 +1843,7 @@ pub mod match_v5 {
|
||||||
pub real_timestamp: Option<i64>,
|
pub real_timestamp: Option<i64>,
|
||||||
#[serde(rename = "timestamp")]
|
#[serde(rename = "timestamp")]
|
||||||
pub timestamp: i32,
|
pub timestamp: i32,
|
||||||
/// Timeline event type.<br>
|
/// Timeline event type.<br>
|
||||||
/// (Known legal values: ASCENDED_EVENT, BUILDING_KILL, CAPTURE_POINT, CHAMPION_KILL, CHAMPION_SPECIAL_KILL, CHAMPION_TRANSFORM, DRAGON_SOUL_GIVEN, ELITE_MONSTER_KILL, GAME_END, ITEM_DESTROYED, ITEM_PURCHASED, ITEM_SOLD, ITEM_UNDO, LEVEL_UP, PAUSE_END, PAUSE_START, SKILL_LEVEL_UP, TURRET_PLATE_DESTROYED, WARD_KILL, WARD_PLACED)
|
/// (Known legal values: ASCENDED_EVENT, BUILDING_KILL, CAPTURE_POINT, CHAMPION_KILL, CHAMPION_SPECIAL_KILL, CHAMPION_TRANSFORM, DRAGON_SOUL_GIVEN, ELITE_MONSTER_KILL, GAME_END, ITEM_DESTROYED, ITEM_PURCHASED, ITEM_SOLD, ITEM_UNDO, LEVEL_UP, PAUSE_END, PAUSE_START, SKILL_LEVEL_UP, TURRET_PLATE_DESTROYED, WARD_KILL, WARD_PLACED)
|
||||||
#[serde(rename = "type")]
|
#[serde(rename = "type")]
|
||||||
pub r#type: String,
|
pub r#type: String,
|
||||||
|
@ -2313,7 +2316,7 @@ pub mod spectator_v4 {
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||||
pub struct FeaturedGameInfo {
|
pub struct FeaturedGameInfo {
|
||||||
/// The game mode<br>
|
/// The game mode<br>
|
||||||
/// (Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO)
|
/// (Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO)
|
||||||
#[serde(rename = "gameMode")]
|
#[serde(rename = "gameMode")]
|
||||||
pub game_mode: crate::consts::GameMode,
|
pub game_mode: crate::consts::GameMode,
|
||||||
|
@ -2323,7 +2326,7 @@ pub mod spectator_v4 {
|
||||||
/// The ID of the map
|
/// The ID of the map
|
||||||
#[serde(rename = "mapId")]
|
#[serde(rename = "mapId")]
|
||||||
pub map_id: crate::consts::Map,
|
pub map_id: crate::consts::Map,
|
||||||
/// The game type<br>
|
/// The game type<br>
|
||||||
/// (Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME)
|
/// (Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME)
|
||||||
#[serde(rename = "gameType")]
|
#[serde(rename = "gameType")]
|
||||||
pub game_type: crate::consts::GameType,
|
pub game_type: crate::consts::GameType,
|
||||||
|
@ -2502,7 +2505,7 @@ pub mod tft_league_v1 {
|
||||||
pub summoner_name: String,
|
pub summoner_name: String,
|
||||||
#[serde(rename = "queueType")]
|
#[serde(rename = "queueType")]
|
||||||
pub queue_type: crate::consts::QueueType,
|
pub queue_type: crate::consts::QueueType,
|
||||||
/// Only included for the RANKED_TFT_TURBO queueType.<br>
|
/// Only included for the RANKED_TFT_TURBO queueType.<br>
|
||||||
/// (Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY)
|
/// (Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY)
|
||||||
#[serde(rename = "ratedTier")]
|
#[serde(rename = "ratedTier")]
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
|
@ -2890,15 +2893,15 @@ pub mod tournament_stub_v4 {
|
||||||
/// The team size of the game. Valid values are 1-5.
|
/// The team size of the game. Valid values are 1-5.
|
||||||
#[serde(rename = "teamSize")]
|
#[serde(rename = "teamSize")]
|
||||||
pub team_size: i32,
|
pub team_size: i32,
|
||||||
/// The pick type of the game.<br>
|
/// The pick type of the game.<br>
|
||||||
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
|
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
|
||||||
#[serde(rename = "pickType")]
|
#[serde(rename = "pickType")]
|
||||||
pub pick_type: String,
|
pub pick_type: String,
|
||||||
/// The map type of the game.<br>
|
/// The map type of the game.<br>
|
||||||
/// (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
|
/// (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
|
||||||
#[serde(rename = "mapType")]
|
#[serde(rename = "mapType")]
|
||||||
pub map_type: String,
|
pub map_type: String,
|
||||||
/// The spectator type of the game.<br>
|
/// The spectator type of the game.<br>
|
||||||
/// (Legal values: NONE, LOBBYONLY, ALL)
|
/// (Legal values: NONE, LOBBYONLY, ALL)
|
||||||
#[serde(rename = "spectatorType")]
|
#[serde(rename = "spectatorType")]
|
||||||
pub spectator_type: String,
|
pub spectator_type: String,
|
||||||
|
@ -2931,7 +2934,7 @@ pub mod tournament_stub_v4 {
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||||
pub struct ProviderRegistrationParameters {
|
pub struct ProviderRegistrationParameters {
|
||||||
/// The region in which the provider will be running tournaments.<br>
|
/// The region in which the provider will be running tournaments.<br>
|
||||||
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
|
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
|
||||||
#[serde(rename = "region")]
|
#[serde(rename = "region")]
|
||||||
pub region: crate::consts::TournamentRegion,
|
pub region: crate::consts::TournamentRegion,
|
||||||
|
@ -2975,15 +2978,15 @@ pub mod tournament_v4 {
|
||||||
/// The team size of the game. Valid values are 1-5.
|
/// The team size of the game. Valid values are 1-5.
|
||||||
#[serde(rename = "teamSize")]
|
#[serde(rename = "teamSize")]
|
||||||
pub team_size: i32,
|
pub team_size: i32,
|
||||||
/// The pick type of the game.<br>
|
/// The pick type of the game.<br>
|
||||||
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
|
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
|
||||||
#[serde(rename = "pickType")]
|
#[serde(rename = "pickType")]
|
||||||
pub pick_type: String,
|
pub pick_type: String,
|
||||||
/// The map type of the game.<br>
|
/// The map type of the game.<br>
|
||||||
/// (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
|
/// (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
|
||||||
#[serde(rename = "mapType")]
|
#[serde(rename = "mapType")]
|
||||||
pub map_type: String,
|
pub map_type: String,
|
||||||
/// The spectator type of the game.<br>
|
/// The spectator type of the game.<br>
|
||||||
/// (Legal values: NONE, LOBBYONLY, ALL)
|
/// (Legal values: NONE, LOBBYONLY, ALL)
|
||||||
#[serde(rename = "spectatorType")]
|
#[serde(rename = "spectatorType")]
|
||||||
pub spectator_type: String,
|
pub spectator_type: String,
|
||||||
|
@ -3023,7 +3026,7 @@ pub mod tournament_v4 {
|
||||||
/// The tournament code's ID.
|
/// The tournament code's ID.
|
||||||
#[serde(rename = "id")]
|
#[serde(rename = "id")]
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
/// The tournament code's region.<br>
|
/// The tournament code's region.<br>
|
||||||
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
|
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
|
||||||
#[serde(rename = "region")]
|
#[serde(rename = "region")]
|
||||||
pub region: String,
|
pub region: String,
|
||||||
|
@ -3043,15 +3046,15 @@ pub mod tournament_v4 {
|
||||||
#[serde(rename = "allowedSummonerIds")]
|
#[serde(rename = "allowedSummonerIds")]
|
||||||
#[serde(skip_serializing_if = "Option::is_none")]
|
#[serde(skip_serializing_if = "Option::is_none")]
|
||||||
pub allowed_summoner_ids: Option<std::vec::Vec<String>>,
|
pub allowed_summoner_ids: Option<std::vec::Vec<String>>,
|
||||||
/// The pick type<br>
|
/// The pick type<br>
|
||||||
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
|
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
|
||||||
#[serde(rename = "pickType")]
|
#[serde(rename = "pickType")]
|
||||||
pub pick_type: String,
|
pub pick_type: String,
|
||||||
/// The map type<br>
|
/// The map type<br>
|
||||||
/// (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
|
/// (Legal values: SUMMONERS_RIFT, TWISTED_TREELINE, HOWLING_ABYSS)
|
||||||
#[serde(rename = "mapType")]
|
#[serde(rename = "mapType")]
|
||||||
pub map_type: String,
|
pub map_type: String,
|
||||||
/// The spectator type<br>
|
/// The spectator type<br>
|
||||||
/// (Legal values: NONE, LOBBYONLY, ALL)
|
/// (Legal values: NONE, LOBBYONLY, ALL)
|
||||||
#[serde(rename = "spectatorType")]
|
#[serde(rename = "spectatorType")]
|
||||||
pub spectator_type: String,
|
pub spectator_type: String,
|
||||||
|
@ -3084,7 +3087,7 @@ pub mod tournament_v4 {
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||||
pub struct ProviderRegistrationParameters {
|
pub struct ProviderRegistrationParameters {
|
||||||
/// The region in which the provider will be running tournaments.<br>
|
/// The region in which the provider will be running tournaments.<br>
|
||||||
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
|
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR)
|
||||||
#[serde(rename = "region")]
|
#[serde(rename = "region")]
|
||||||
pub region: crate::consts::TournamentRegion,
|
pub region: crate::consts::TournamentRegion,
|
||||||
|
|
|
@ -49,7 +49,9 @@ async_tests! {
|
||||||
leagueexp_get: async {
|
leagueexp_get: async {
|
||||||
let p = RIOT_API.league_exp_v4().get_league_entries(ROUTE, QueueType::RANKED_SOLO_5x5, Tier::CHALLENGER, Division::I, None);
|
let p = RIOT_API.league_exp_v4().get_league_entries(ROUTE, QueueType::RANKED_SOLO_5x5, Tier::CHALLENGER, Division::I, None);
|
||||||
let d = p.await.map_err(|e| e.to_string())?;
|
let d = p.await.map_err(|e| e.to_string())?;
|
||||||
rassert!(!d.is_empty(), "Challenger shouldn't be empty.");
|
if d.is_empty() {
|
||||||
|
eprintln!("Off-season, challenger league is empty.");
|
||||||
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
},
|
},
|
||||||
champion_mastery_v4: async {
|
champion_mastery_v4: async {
|
||||||
|
|
|
@ -25,8 +25,14 @@ pub async fn league_v4_match_v5_latest_combo(route: PlatformRoute) -> Result<(),
|
||||||
.await
|
.await
|
||||||
.map_err(|e| format!("Failed to get challenger league: {}", e))?;
|
.map_err(|e| format!("Failed to get challenger league: {}", e))?;
|
||||||
|
|
||||||
if QueueType::RANKED_SOLO_5x5 != challenger_league.queue {
|
let Some(queue) = challenger_league.queue else {
|
||||||
return Err(format!("Unexpected `queue`: {}", challenger_league.queue));
|
assert!(challenger_league.entries.is_empty());
|
||||||
|
eprintln!("Off-season, challenger league is empty.");
|
||||||
|
return Ok(());
|
||||||
|
};
|
||||||
|
|
||||||
|
if QueueType::RANKED_SOLO_5x5 != queue {
|
||||||
|
return Err(format!("Unexpected `queue`: {:?}", queue));
|
||||||
}
|
}
|
||||||
if challenger_league.entries.is_empty() {
|
if challenger_league.entries.is_empty() {
|
||||||
return Err("Challenger league is unexpectedly empty!".to_owned());
|
return Err("Challenger league is unexpectedly empty!".to_owned());
|
||||||
|
|
Loading…
Reference in a new issue