From c7f5c5949576ceaffb088b691a0b7a637b069a31 Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Wed, 15 Nov 2023 11:27:17 -0800 Subject: [PATCH] Regen for new `tournament-v5.getGames` endpoint, `match-v5.Participant` updates --- riven/src/consts/queue.rs | 39 ++++++++++++++ riven/src/endpoints.rs | 31 +++++++++-- riven/src/meta.rs | 5 +- riven/src/models.rs | 110 +++++++++++++++++++++++++++++++++++++- 4 files changed, 179 insertions(+), 6 deletions(-) diff --git a/riven/src/consts/queue.rs b/riven/src/consts/queue.rs index f588e45..375b4bd 100644 --- a/riven/src/consts/queue.rs +++ b/riven/src/consts/queue.rs @@ -14,101 +14,121 @@ newtype_enum! { CUSTOM = 0, /// `2`. /// 5v5 Blind Pick games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 430 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 430")] SUMMONERS_RIFT_5V5_BLIND_PICK_DEPRECATED_2 = 2, /// `4`. /// 5v5 Ranked Solo games on Summoner's Rift + /// /// Deprecated in favor of queueId 420 #[deprecated(note="Deprecated in favor of queueId 420")] SUMMONERS_RIFT_5V5_RANKED_SOLO_DEPRECATED_4 = 4, /// `6`. /// 5v5 Ranked Premade games on Summoner's Rift + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] SUMMONERS_RIFT_5V5_RANKED_PREMADE = 6, /// `7`. /// Co-op vs AI games on Summoner's Rift + /// /// Deprecated in favor of queueId 32 and 33 #[deprecated(note="Deprecated in favor of queueId 32 and 33")] SUMMONERS_RIFT_CO_OP_VS_AI = 7, /// `8`. /// 3v3 Normal games on Twisted Treeline + /// /// Deprecated in patch 7.19 in favor of queueId 460 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 460")] TWISTED_TREELINE_3V3_NORMAL = 8, /// `9`. /// 3v3 Ranked Flex games on Twisted Treeline + /// /// Deprecated in patch 7.19 in favor of queueId 470 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 470")] TWISTED_TREELINE_3V3_RANKED_FLEX_DEPRECATED_9 = 9, /// `14`. /// 5v5 Draft Pick games on Summoner's Rift + /// /// Deprecated in favor of queueId 400 #[deprecated(note="Deprecated in favor of queueId 400")] SUMMONERS_RIFT_5V5_DRAFT_PICK_DEPRECATED_14 = 14, /// `16`. /// 5v5 Dominion Blind Pick games on Crystal Scar + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] CRYSTAL_SCAR_5V5_DOMINION_BLIND_PICK = 16, /// `17`. /// 5v5 Dominion Draft Pick games on Crystal Scar + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] CRYSTAL_SCAR_5V5_DOMINION_DRAFT_PICK = 17, /// `25`. /// Dominion Co-op vs AI games on Crystal Scar + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] CRYSTAL_SCAR_DOMINION_CO_OP_VS_AI = 25, /// `31`. /// Co-op vs AI Intro Bot games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 830 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 830")] SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_DEPRECATED_31 = 31, /// `32`. /// Co-op vs AI Beginner Bot games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 840 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 840")] SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_DEPRECATED_32 = 32, /// `33`. /// Co-op vs AI Intermediate Bot games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 850 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 850")] SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_DEPRECATED_33 = 33, /// `41`. /// 3v3 Ranked Team games on Twisted Treeline + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] TWISTED_TREELINE_3V3_RANKED_TEAM = 41, /// `42`. /// 5v5 Ranked Team games on Summoner's Rift + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] SUMMONERS_RIFT_5V5_RANKED_TEAM = 42, /// `52`. /// Co-op vs AI games on Twisted Treeline + /// /// Deprecated in patch 7.19 in favor of queueId 800 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 800")] TWISTED_TREELINE_CO_OP_VS_AI = 52, /// `61`. /// 5v5 Team Builder games on Summoner's Rift + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] SUMMONERS_RIFT_5V5_TEAM_BUILDER = 61, /// `65`. /// 5v5 ARAM games on Howling Abyss + /// /// Deprecated in patch 7.19 in favor of queueId 450 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 450")] HOWLING_ABYSS_5V5_ARAM_DEPRECATED_65 = 65, /// `67`. /// ARAM Co-op vs AI games on Howling Abyss + /// /// Game mode deprecated #[deprecated(note="Game mode deprecated")] HOWLING_ABYSS_ARAM_CO_OP_VS_AI = 67, /// `70`. /// One for All games on Summoner's Rift + /// /// Deprecated in patch 8.6 in favor of queueId 1020 #[deprecated(note="Deprecated in patch 8.6 in favor of queueId 1020")] SUMMONERS_RIFT_ONE_FOR_ALL_DEPRECATED_70 = 70, @@ -132,21 +152,25 @@ newtype_enum! { SUMMONERS_RIFT_CO_OP_VS_AI_ULTRA_RAPID_FIRE = 83, /// `91`. /// Doom Bots Rank 1 games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 950 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] SUMMONERS_RIFT_DOOM_BOTS_RANK_1 = 91, /// `92`. /// Doom Bots Rank 2 games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 950 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] SUMMONERS_RIFT_DOOM_BOTS_RANK_2 = 92, /// `93`. /// Doom Bots Rank 5 games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 950 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] SUMMONERS_RIFT_DOOM_BOTS_RANK_5 = 93, /// `96`. /// Ascension games on Crystal Scar + /// /// Deprecated in patch 7.19 in favor of queueId 910 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 910")] CRYSTAL_SCAR_ASCENSION_DEPRECATED_96 = 96, @@ -158,6 +182,7 @@ newtype_enum! { BUTCHERS_BRIDGE_5V5_ARAM = 100, /// `300`. /// Legend of the Poro King games on Howling Abyss + /// /// Deprecated in patch 7.19 in favor of queueId 920 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 920")] HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING_DEPRECATED_300 = 300, @@ -169,6 +194,7 @@ newtype_enum! { SUMMONERS_RIFT_BLACK_MARKET_BRAWLERS = 313, /// `315`. /// Nexus Siege games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 940 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 940")] SUMMONERS_RIFT_NEXUS_SIEGE_DEPRECATED_315 = 315, @@ -177,6 +203,7 @@ newtype_enum! { CRYSTAL_SCAR_DEFINITELY_NOT_DOMINION = 317, /// `318`. /// ARURF games on Summoner's Rift + /// /// Deprecated in patch 7.19 in favor of queueId 900 #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 900")] SUMMONERS_RIFT_ARURF_DEPRECATED_318 = 318, @@ -188,6 +215,7 @@ newtype_enum! { SUMMONERS_RIFT_5V5_DRAFT_PICK = 400, /// `410`. /// 5v5 Ranked Dynamic games on Summoner's Rift + /// /// Game mode deprecated in patch 6.22 #[deprecated(note="Game mode deprecated in patch 6.22")] SUMMONERS_RIFT_5V5_RANKED_DYNAMIC = 410, @@ -205,14 +233,21 @@ newtype_enum! { HOWLING_ABYSS_5V5_ARAM = 450, /// `460`. /// 3v3 Blind Pick games on Twisted Treeline + /// /// Deprecated in patch 9.23 #[deprecated(note="Deprecated in patch 9.23")] TWISTED_TREELINE_3V3_BLIND_PICK = 460, /// `470`. /// 3v3 Ranked Flex games on Twisted Treeline + /// /// Deprecated in patch 9.23 #[deprecated(note="Deprecated in patch 9.23")] TWISTED_TREELINE_3V3_RANKED_FLEX_DEPRECATED_470 = 470, + /// `490`. + /// Normal (Quickplay) games on Summoner's Rift + /// + /// https://github.com/RiotGames/developer-relations/issues/846 + SUMMONERS_RIFT_NORMAL_QUICKPLAY_ = 490, /// `600`. /// Blood Hunt Assassin games on Summoner's Rift SUMMONERS_RIFT_BLOOD_HUNT_ASSASSIN = 600, @@ -227,11 +262,13 @@ newtype_enum! { HOWLING_ABYSS_ARAM_CLASH = 720, /// `800`. /// Co-op vs. AI Intermediate Bot games on Twisted Treeline + /// /// Deprecated in patch 9.23 #[deprecated(note="Deprecated in patch 9.23")] TWISTED_TREELINE_CO_OP_VS_AI_INTERMEDIATE_BOT = 800, /// `810`. /// Co-op vs. AI Intro Bot games on Twisted Treeline + /// /// Deprecated in patch 9.23 #[deprecated(note="Deprecated in patch 9.23")] TWISTED_TREELINE_CO_OP_VS_AI_INTRO_BOT = 810, @@ -318,6 +355,7 @@ newtype_enum! { CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_HYPER_ROLL_ = 1130, /// `1150`. /// Ranked Teamfight Tactics (Double Up Workshop) games on Convergence + /// /// Deprecated in patch 12.11 in favor of queueId 1160 #[deprecated(note="Deprecated in patch 12.11 in favor of queueId 1160")] CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_WORKSHOP__DEPRECATED_1150 = 1150, @@ -326,6 +364,7 @@ newtype_enum! { CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_WORKSHOP_ = 1160, /// `1200`. /// Nexus Blitz games on Nexus Blitz + /// /// Deprecated in patch 9.2 in favor of queueId 1300 #[deprecated(note="Deprecated in patch 9.2 in favor of queueId 1300")] NEXUS_BLITZ_DEPRECATED_1200 = 1200, diff --git a/riven/src/endpoints.rs b/riven/src/endpoints.rs index aefd8da..f3bfb0b 100644 --- a/riven/src/endpoints.rs +++ b/riven/src/endpoints.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 95a5cf31a385d91b952e19190af5a828d2e60ed8 +// Version b554b42a14de337810d5a510d533453eaf6de207 //! Automatically generated endpoint handles. #![allow(clippy::let_and_return, clippy::too_many_arguments)] @@ -303,8 +303,8 @@ impl<'a> AccountV1<'a> { /// Get account by riot id /// # Parameters /// * `route` - Route to query. - /// * `tag_line` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. However not all accounts have a gameName and tagLine associated so these fields may not be included in the response. - /// * `game_name` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. However not all accounts have a gameName and tagLine associated so these fields may not be included in the response. + /// * `tag_line` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. + /// * `game_name` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. /// # Riot Developer API Reference /// `account-v1.getByRiotId` /// @@ -2031,6 +2031,31 @@ impl<'a> TournamentV5<'a> { future } + /// Get games details + /// ## Implementation Notes + /// Additional endpoint to get tournament games. From this endpoint, you are able to get participants PUUID (the callback doesn't contain this info). + /// + /// You can also use it to check if the game was recorded and validate callbacks. If the endpoint returns the game, it means a callback was attempted. + /// + /// This will only work for tournament codes created after November 10, 2023. + /// # Parameters + /// * `route` - Route to query. + /// * `tournament_code` (required, in path) + /// # Riot Developer API Reference + /// `tournament-v5.getGames` + /// + /// Note: this method is automatically generated. + pub fn get_games(&self, route: RegionalRoute, tournament_code: &str) + -> impl Future>> + 'a + { + let route_str = route.into(); + let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/games/by-code/{}", tournament_code)); + let future = self.base.execute_val::>("tournament-v5.getGames", route_str, request); + #[cfg(feature = "tracing")] + let future = future.instrument(tracing::info_span!("tournament-v5.getGames")); + future + } + /// Gets a list of lobby events by tournament code. /// # Parameters /// * `route` - Route to query. diff --git a/riven/src/meta.rs b/riven/src/meta.rs index c1e1253..03a82c7 100644 --- a/riven/src/meta.rs +++ b/riven/src/meta.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 95a5cf31a385d91b952e19190af5a828d2e60ed8 +// Version b554b42a14de337810d5a510d533453eaf6de207 //! Metadata about the Riot API and Riven. //! @@ -15,7 +15,7 @@ /// Metadata for endpoints. Each tuple corresponds to one endpoint and contains /// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID. -pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 84] = [ +pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 85] = [ (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/me", "account-v1.getByAccessToken"), @@ -91,6 +91,7 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 84] = [ (reqwest::Method::POST, "/lol/tournament/v5/codes", "tournament-v5.createTournamentCode"), (reqwest::Method::GET, "/lol/tournament/v5/codes/{tournamentCode}", "tournament-v5.getTournamentCode"), (reqwest::Method::PUT, "/lol/tournament/v5/codes/{tournamentCode}", "tournament-v5.updateCode"), + (reqwest::Method::GET, "/lol/tournament/v5/games/by-code/{tournamentCode}", "tournament-v5.getGames"), (reqwest::Method::GET, "/lol/tournament/v5/lobby-events/by-code/{tournamentCode}", "tournament-v5.getLobbyEventsByCode"), (reqwest::Method::POST, "/lol/tournament/v5/providers", "tournament-v5.registerProviderData"), (reqwest::Method::POST, "/lol/tournament/v5/tournaments", "tournament-v5.registerTournament"), diff --git a/riven/src/models.rs b/riven/src/models.rs index 3612726..a027d20 100644 --- a/riven/src/models.rs +++ b/riven/src/models.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 95a5cf31a385d91b952e19190af5a828d2e60ed8 +// Version b554b42a14de337810d5a510d533453eaf6de207 #![allow(missing_docs)] @@ -1323,6 +1323,45 @@ pub mod match_v5 { #[serde(rename = "placement")] #[serde(skip_serializing_if = "Option::is_none")] pub placement: Option, + #[serde(rename = "missions")] + #[serde(skip_serializing_if = "Option::is_none")] + pub missions: Option, + #[serde(rename = "playerScore0")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score0: Option, + #[serde(rename = "playerScore1")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score1: Option, + #[serde(rename = "playerScore10")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score10: Option, + #[serde(rename = "playerScore11")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score11: Option, + #[serde(rename = "playerScore2")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score2: Option, + #[serde(rename = "playerScore3")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score3: Option, + #[serde(rename = "playerScore4")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score4: Option, + #[serde(rename = "playerScore5")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score5: Option, + #[serde(rename = "playerScore6")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score6: Option, + #[serde(rename = "playerScore7")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score7: Option, + #[serde(rename = "playerScore8")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score8: Option, + #[serde(rename = "playerScore9")] + #[serde(skip_serializing_if = "Option::is_none")] + pub player_score9: Option, } /// Perks data object. #[derive(Clone, Debug)] @@ -1839,6 +1878,36 @@ pub mod match_v5 { #[serde(skip_serializing_if = "Option::is_none")] pub ward_takedowns_before20_m: Option, } + /// ParticipantMissions data object. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ParticipantMissions { + #[serde(rename = "playerScore0")] + pub player_score0: i32, + #[serde(rename = "playerScore1")] + pub player_score1: i32, + #[serde(rename = "playerScore10")] + pub player_score10: i32, + #[serde(rename = "playerScore11")] + pub player_score11: i32, + #[serde(rename = "playerScore2")] + pub player_score2: i32, + #[serde(rename = "playerScore3")] + pub player_score3: i32, + #[serde(rename = "playerScore4")] + pub player_score4: i32, + #[serde(rename = "playerScore5")] + pub player_score5: i32, + #[serde(rename = "playerScore6")] + pub player_score6: i32, + #[serde(rename = "playerScore7")] + pub player_score7: i32, + #[serde(rename = "playerScore8")] + pub player_score8: i32, + #[serde(rename = "playerScore9")] + pub player_score9: i32, + } /// MatchTimelineInfoFrameEvent data object. #[derive(Clone, Debug)] #[derive(serde::Serialize, serde::Deserialize)] @@ -3125,6 +3194,45 @@ pub mod tournament_v5 { #[serde(rename = "spectatorType")] pub spectator_type: String, } + /// TournamentGamesV5 data object. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TournamentGamesV5 { + #[serde(rename = "winningTeam")] + pub winning_team: std::vec::Vec, + #[serde(rename = "losingTeam")] + pub losing_team: std::vec::Vec, + /// Tournament Code + #[serde(rename = "shortCode")] + pub short_code: String, + /// Metadata for the TournamentCode + #[serde(rename = "metaData")] + pub meta_data: String, + #[serde(rename = "gameId")] + pub game_id: i64, + #[serde(rename = "gameName")] + pub game_name: String, + #[serde(rename = "gameType")] + pub game_type: String, + /// Game Map ID + #[serde(rename = "gameMap")] + pub game_map: i32, + #[serde(rename = "gameMode")] + pub game_mode: String, + /// Region of the game + #[serde(rename = "region")] + pub region: String, + } + /// TournamentTeamV5 data object. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TournamentTeamV5 { + /// Player Unique UUID (Encrypted) + #[serde(rename = "puuid")] + pub puuid: String, + } /// LobbyEventV5Wrapper data object. #[derive(Clone, Debug)] #[derive(serde::Serialize, serde::Deserialize)]