From b897047b5cdf137379c2ec1fc47c48c83a6f6f5f Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Tue, 7 Jan 2025 11:03:05 -0800 Subject: [PATCH] regen for SG2 unification, new clash PUUID endpoint --- riven/src/consts/route.rs | 8 +++++--- riven/src/endpoints.rs | 23 ++++++++++++++++++++++- riven/src/meta.rs | 5 +++-- riven/src/models.rs | 4 +++- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/riven/src/consts/route.rs b/riven/src/consts/route.rs index 55d2597..ca14e1b 100644 --- a/riven/src/consts/route.rs +++ b/riven/src/consts/route.rs @@ -126,9 +126,10 @@ pub enum PlatformRoute { #[strum(to_string="OC1", serialize="OCE")] OC1 = 24, - /// Philippines + /// Philippines, moved into `sg2` on 2025-01-08. /// /// `32` (riotapi-schema ID/repr) + #[deprecated] #[strum(to_string="PH2", serialize="PH")] PH2 = 32, @@ -137,15 +138,16 @@ pub enum PlatformRoute { /// `25` (riotapi-schema ID/repr) RU = 25, - /// Singapore + /// Singapore, Thailand, Philippines /// /// `33` (riotapi-schema ID/repr) #[strum(to_string="SG2", serialize="SG")] SG2 = 33, - /// Thailand + /// Thailand, moved into `sg2` on 2025-01-08. /// /// `34` (riotapi-schema ID/repr) + #[deprecated] #[strum(to_string="TH2", serialize="TH")] TH2 = 34, diff --git a/riven/src/endpoints.rs b/riven/src/endpoints.rs index 552929d..25da1c9 100644 --- a/riven/src/endpoints.rs +++ b/riven/src/endpoints.rs @@ -8,7 +8,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version dfff73340b38e0d7df45f9c60a9b9a4792ad489e +// Version 3db3221cc1b657c2acddf6ce02428680f38ad9aa //! Automatically generated endpoint handles. #![allow(clippy::let_and_return, clippy::too_many_arguments)] @@ -525,6 +525,27 @@ 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 7a85124..d29a4c0 100644 --- a/riven/src/meta.rs +++ b/riven/src/meta.rs @@ -8,7 +8,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version dfff73340b38e0d7df45f9c60a9b9a4792ad489e +// Version 3db3221cc1b657c2acddf6ce02428680f38ad9aa //! Metadata about the Riot API and Riven. //! @@ -16,7 +16,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); 86] = [ +pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 87] = [ (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"), @@ -26,6 +26,7 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 86] = [ (reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/top", "champion-mastery-v4.getTopChampionMasteriesByPUUID"), (reqwest::Method::GET, "/lol/champion-mastery/v4/scores/by-puuid/{encryptedPUUID}", "champion-mastery-v4.getChampionMasteryScoreByPUUID"), (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 7106ed2..bd07868 100644 --- a/riven/src/models.rs +++ b/riven/src/models.rs @@ -8,7 +8,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version dfff73340b38e0d7df45f9c60a9b9a4792ad489e +// Version 3db3221cc1b657c2acddf6ce02428680f38ad9aa #![allow(missing_docs)] @@ -182,6 +182,8 @@ pub mod clash_v1 { pub struct Player { #[serde(rename = "summonerId")] pub summoner_id: String, + #[serde(rename = "puuid")] + pub puuid: String, #[serde(rename = "teamId")] #[serde(skip_serializing_if = "Option::is_none")] pub team_id: Option,