regen for SG2 unification, new clash PUUID endpoint

This commit is contained in:
Mingwei Samuel 2025-01-07 11:03:05 -08:00
parent 19c328e520
commit b897047b5c
4 changed files with 33 additions and 7 deletions

View file

@ -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,

View file

@ -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
/// <a href="https://developer.riotgames.com/api-methods/#clash-v1/GET_getPlayersByPUUID" target="_blank">`clash-v1.getPlayersByPUUID`</a>
///
/// Note: this method is automatically generated.
pub fn get_players_by_puuid(&self, route: PlatformRoute, puuid: &str)
-> impl Future<Output = Result<Vec<clash_v1::Player>>> + '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::<Vec<clash_v1::Player>>("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.

View file

@ -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"),

View file

@ -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<String>,