From 904a6b083fd6b17b87241f14f03b7391db4275ea Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Wed, 22 Nov 2023 09:40:30 -0800 Subject: [PATCH] Regen for `Hwei`, removal of `clash-v1.getPlayersByPUUID`, and changed/new `match-v5.ParticipantDto.riotIdGameName` field --- riven/src/consts/champion.rs | 6 ++++++ riven/src/endpoints.rs | 23 +---------------------- riven/src/meta.rs | 5 ++--- riven/src/models.rs | 8 ++++++-- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/riven/src/consts/champion.rs b/riven/src/consts/champion.rs index 232b232..862dfff 100644 --- a/riven/src/consts/champion.rs +++ b/riven/src/consts/champion.rs @@ -59,6 +59,7 @@ newtype_enum! { /// `GWEN` | "Gwen" | "Gwen" | 887 /// `HECARIM` | "Hecarim" | "Hecarim" | 120 /// `HEIMERDINGER` | "Heimerdinger" | "Heimerdinger" | 74 + /// `HWEI` | "Hwei" | "Hwei" | 910 /// `ILLAOI` | "Illaoi" | "Illaoi" | 420 /// `IRELIA` | "Irelia" | "Irelia" | 39 /// `IVERN` | "Ivern" | "Ivern" | 427 @@ -271,6 +272,8 @@ newtype_enum! { HECARIM = 120, /// `74`. HEIMERDINGER = 74, + /// `910`. + HWEI = 910, /// `420`. ILLAOI = 420, /// `39`. @@ -565,6 +568,7 @@ impl Champion { Self::GWEN => Some("Gwen"), Self::HECARIM => Some("Hecarim"), Self::HEIMERDINGER => Some("Heimerdinger"), + Self::HWEI => Some("Hwei"), Self::ILLAOI => Some("Illaoi"), Self::IRELIA => Some("Irelia"), Self::IVERN => Some("Ivern"), @@ -754,6 +758,7 @@ impl Champion { Self::GWEN => Some("Gwen"), Self::HECARIM => Some("Hecarim"), Self::HEIMERDINGER => Some("Heimerdinger"), + Self::HWEI => Some("Hwei"), Self::ILLAOI => Some("Illaoi"), Self::IRELIA => Some("Irelia"), Self::IVERN => Some("Ivern"), @@ -976,6 +981,7 @@ impl std::str::FromStr for Champion { /* GWEN */ [ 'G', 'W', 'E', 'N'] => Ok(Champion::GWEN), /* HECA */ [ 'H', 'E', 'C', 'A'] => Ok(Champion::HECARIM), /* HEIM */ [ 'H', 'E', 'I', 'M'] => Ok(Champion::HEIMERDINGER), + /* HWEI */ [ 'H', 'W', 'E', 'I'] => Ok(Champion::HWEI), /* ILLA */ [ 'I', 'L', 'L', 'A'] => Ok(Champion::ILLAOI), /* IREL */ [ 'I', 'R', 'E', 'L'] => Ok(Champion::IRELIA), /* IVER */ [ 'I', 'V', 'E', 'R'] => Ok(Champion::IVERN), diff --git a/riven/src/endpoints.rs b/riven/src/endpoints.rs index f3bfb0b..fe0b5e9 100644 --- a/riven/src/endpoints.rs +++ b/riven/src/endpoints.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version b554b42a14de337810d5a510d533453eaf6de207 +// Version a5a3a5f5d5f2a617a56302a0afac77c745e4fd56 //! Automatically generated endpoint handles. #![allow(clippy::let_and_return, clippy::too_many_arguments)] @@ -572,27 +572,6 @@ pub struct ClashV1<'a> { base: &'a RiotApi, } impl<'a> ClashV1<'a> { - /// Get players by puuid - /// ## Implementation Notes - /// This endpoint returns a list of active Clash players for a given PUUID. If a summoner registers for multiple tournaments at the same time (e.g., Saturday and Sunday) then both registrations would appear in this list. - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `clash-v1.getPlayersByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_players_by_puuid(&self, route: PlatformRoute, puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/players/by-puuid/{}", puuid)); - let future = self.base.execute_val::>("clash-v1.getPlayersByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getPlayersByPUUID")); - future - } - /// Get players by summoner ID. /// ## Implementation Notes /// This endpoint returns a list of active Clash players for a given summoner ID. If a summoner registers for multiple tournaments at the same time (e.g., Saturday and Sunday) then both registrations would appear in this list. diff --git a/riven/src/meta.rs b/riven/src/meta.rs index 03a82c7..bedb73c 100644 --- a/riven/src/meta.rs +++ b/riven/src/meta.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version b554b42a14de337810d5a510d533453eaf6de207 +// Version a5a3a5f5d5f2a617a56302a0afac77c745e4fd56 //! 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); 85] = [ +pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 84] = [ (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"), @@ -29,7 +29,6 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 85] = [ (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/platform/v3/champion-rotations", "champion-v3.getChampionInfo"), - (reqwest::Method::GET, "/lol/clash/v1/players/by-puuid/{puuid}", "clash-v1.getPlayersByPUUID"), (reqwest::Method::GET, "/lol/clash/v1/players/by-summoner/{summonerId}", "clash-v1.getPlayersBySummoner"), (reqwest::Method::GET, "/lol/clash/v1/teams/{teamId}", "clash-v1.getTeamById"), (reqwest::Method::GET, "/lol/clash/v1/tournaments", "clash-v1.getTournaments"), diff --git a/riven/src/models.rs b/riven/src/models.rs index a027d20..b2a5903 100644 --- a/riven/src/models.rs +++ b/riven/src/models.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version b554b42a14de337810d5a510d533453eaf6de207 +// Version a5a3a5f5d5f2a617a56302a0afac77c745e4fd56 #![allow(missing_docs)] @@ -1160,7 +1160,11 @@ pub mod match_v5 { #[serde(rename = "quadraKills")] pub quadra_kills: i32, #[serde(rename = "riotIdName")] - pub riot_id_name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub riot_id_name: Option, + #[serde(rename = "riotIdGameName")] + #[serde(skip_serializing_if = "Option::is_none")] + pub riot_id_game_name: Option, #[serde(rename = "riotIdTagline")] pub riot_id_tagline: String, #[serde(rename = "role")]