From 40edebf78b2d0593a36f14fd8a3b73bef02c2ee6 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Fri, 19 Nov 2021 18:53:32 -0800 Subject: [PATCH] Regen for new queue enums, bugged LeagueEntry values --- riven/src/consts/queue.rs | 16 ++++++++++++++-- riven/src/endpoints.rs | 2 +- riven/src/meta.rs | 2 +- riven/src/models.rs | 11 +++++++---- riven/tests/tests_na.rs | 3 ++- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/riven/src/consts/queue.rs b/riven/src/consts/queue.rs index 3c1650a..bb2b7d9 100644 --- a/riven/src/consts/queue.rs +++ b/riven/src/consts/queue.rs @@ -299,6 +299,12 @@ newtype_enum! { /// `1090`. /// Teamfight Tactics games on Convergence CONVERGENCE_TEAMFIGHT_TACTICS = 1090, + /// `1091`. + /// Teamfight Tactics 1v0 games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_1V0 = 1091, + /// `1092`. + /// Teamfight Tactics 2v0 games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_2V0 = 1092, /// `1100`. /// Ranked Teamfight Tactics games on Convergence CONVERGENCE_RANKED_TEAMFIGHT_TACTICS = 1100, @@ -306,8 +312,14 @@ newtype_enum! { /// Teamfight Tactics Tutorial games on Convergence CONVERGENCE_TEAMFIGHT_TACTICS_TUTORIAL = 1110, /// `1111`. - /// Teamfight Tactics 1v0 testing games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_1V0_TESTING = 1111, + /// Teamfight Tactics Simluation games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_SIMLUATION = 1111, + /// `1130`. + /// Ranked Teamfight Tactics (Hyper Roll) games on Convergence + CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_HYPER_ROLL_ = 1130, + /// `1150`. + /// Ranked Teamfight Tactics (Double Up Beta) games on Convergence + CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_BETA_ = 1150, /// `1200`. /// Nexus Blitz games on Nexus Blitz /// Deprecated in patch 9.2 in favor of queueId 1300 diff --git a/riven/src/endpoints.rs b/riven/src/endpoints.rs index d85e724..dc8ffc0 100644 --- a/riven/src/endpoints.rs +++ b/riven/src/endpoints.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version f7d7b8c90243fcb043ffe81c5b08b0925be83bdf +// Version 5998519c2eb30a8c3f88edf1dcf88e2c6f091ba1 //! Automatically generated endpoint handles. #![allow(clippy::let_and_return, clippy::too_many_arguments)] diff --git a/riven/src/meta.rs b/riven/src/meta.rs index 62e2e85..9af003c 100644 --- a/riven/src/meta.rs +++ b/riven/src/meta.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version f7d7b8c90243fcb043ffe81c5b08b0925be83bdf +// Version 5998519c2eb30a8c3f88edf1dcf88e2c6f091ba1 //! Metadata about the Riot API and Riven. //! diff --git a/riven/src/models.rs b/riven/src/models.rs index f624407..7a0eb74 100644 --- a/riven/src/models.rs +++ b/riven/src/models.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version f7d7b8c90243fcb043ffe81c5b08b0925be83bdf +// Version 5998519c2eb30a8c3f88edf1dcf88e2c6f091ba1 //! Data transfer structs. //! @@ -312,7 +312,8 @@ pub mod league_v4 { #[derive(serde::Serialize, serde::Deserialize)] pub struct LeagueEntry { #[serde(rename = "leagueId")] - pub league_id: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub league_id: Option, /// Player's encrypted summonerId. #[serde(rename = "summonerId")] pub summoner_id: String, @@ -321,10 +322,12 @@ pub mod league_v4 { #[serde(rename = "queueType")] pub queue_type: crate::consts::QueueType, #[serde(rename = "tier")] - pub tier: crate::consts::Tier, + #[serde(skip_serializing_if = "Option::is_none")] + pub tier: Option, /// The player's division within a tier. #[serde(rename = "rank")] - pub rank: crate::consts::Division, + #[serde(skip_serializing_if = "Option::is_none")] + pub rank: Option, #[serde(rename = "leaguePoints")] pub league_points: i32, /// Winning team on Summoners Rift. diff --git a/riven/tests/tests_na.rs b/riven/tests/tests_na.rs index dbe803d..397d5cb 100644 --- a/riven/tests/tests_na.rs +++ b/riven/tests/tests_na.rs @@ -53,7 +53,8 @@ async_tests!{ let summoner = summoner_fut.await.map_err(|e| e.to_string())?.ok_or_else(|| "Failed to get \"TheNicoNi\"".to_owned())?; let league_fut = RIOT_API.league_v4().get_league_entries_for_summoner(ROUTE, &*summoner.id); let league = league_fut.await.map_err(|e| e.to_string())?; - let _ = league; + rassert_eq!(1, league.len()); // BRITTLE! + rassert_eq!(league[0].queue_type, QueueType::RANKED_TFT_PAIRS); Ok(()) },