Regen for champion AMBESSA and val-console endpoints

This commit is contained in:
Mingwei Samuel 2024-11-03 21:10:22 -08:00
parent 5946183242
commit a243e93609
6 changed files with 168 additions and 41 deletions

View file

@ -22,6 +22,7 @@ newtype_enum! {
/// `AKALI` | "Akali" | "Akali" | 84
/// `AKSHAN` | "Akshan" | "Akshan" | 166
/// `ALISTAR` | "Alistar" | "Alistar" | 12
/// `AMBESSA` | "Ambessa" | "Ambessa" | 799
/// `AMUMU` | "Amumu" | "Amumu" | 32
/// `ANIVIA` | "Anivia" | "Anivia" | 34
/// `ANNIE` | "Annie" | "Annie" | 1
@ -199,6 +200,8 @@ newtype_enum! {
AKSHAN = 166,
/// `12`.
ALISTAR = 12,
/// `799`.
AMBESSA = 799,
/// `32`.
AMUMU = 32,
/// `34`.
@ -537,6 +540,7 @@ impl Champion {
Self::AKALI => Some("Akali"),
Self::AKSHAN => Some("Akshan"),
Self::ALISTAR => Some("Alistar"),
Self::AMBESSA => Some("Ambessa"),
Self::AMUMU => Some("Amumu"),
Self::ANIVIA => Some("Anivia"),
Self::ANNIE => Some("Annie"),
@ -729,6 +733,7 @@ impl Champion {
Self::AKALI => Some("Akali"),
Self::AKSHAN => Some("Akshan"),
Self::ALISTAR => Some("Alistar"),
Self::AMBESSA => Some("Ambessa"),
Self::AMUMU => Some("Amumu"),
Self::ANIVIA => Some("Anivia"),
Self::ANNIE => Some("Annie"),
@ -951,6 +956,7 @@ impl std::str::FromStr for Champion {
/* AKAL */ [ 'A', 'K', 'A', 'L'] => Ok(Champion::AKALI),
/* AKSH */ [ 'A', 'K', 'S', 'H'] => Ok(Champion::AKSHAN),
/* ALIS */ [ 'A', 'L', 'I', 'S'] => Ok(Champion::ALISTAR),
/* AMBE */ [ 'A', 'M', 'B', 'E'] => Ok(Champion::AMBESSA),
/* AMUM */ [ 'A', 'M', 'U', 'M'] => Ok(Champion::AMUMU),
/* ANIV */ [ 'A', 'N', 'I', 'V'] => Ok(Champion::ANIVIA),
/* ANNI */ [ 'A', 'N', 'N', 'I'] => Ok(Champion::ANNIE),

View file

@ -276,13 +276,31 @@ newtype_enum! {
TWISTED_TREELINE_CO_OP_VS_AI_BEGINNER_BOT = 820,
/// `830`.
/// Co-op vs. AI Intro Bot games on Summoner's Rift
SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT = 830,
///
/// Deprecated in March 2024 in favor of queueId 870
#[deprecated(note="Deprecated in March 2024 in favor of queueId 870")]
SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_DEPRECATED_830 = 830,
/// `840`.
/// Co-op vs. AI Beginner Bot games on Summoner's Rift
SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT = 840,
///
/// Deprecated in March 2024 in favor of queueId 880
#[deprecated(note="Deprecated in March 2024 in favor of queueId 880")]
SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_DEPRECATED_840 = 840,
/// `850`.
/// Co-op vs. AI Intermediate Bot games on Summoner's Rift
SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT = 850,
///
/// Deprecated in March 2024 in favor of queueId 890
#[deprecated(note="Deprecated in March 2024 in favor of queueId 890")]
SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_DEPRECATED_850 = 850,
/// `870`.
/// Co-op vs. AI Intro Bot games on Summoner's Rift
SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT = 870,
/// `880`.
/// Co-op vs. AI Beginner Bot games on Summoner's Rift
SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT = 880,
/// `890`.
/// Co-op vs. AI Intermediate Bot games on Summoner's Rift
SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT = 890,
/// `900`.
/// ARURF games on Summoner's Rift
SUMMONERS_RIFT_ARURF = 900,

View file

@ -50,6 +50,11 @@ pub enum RegionalRoute {
/// `11` (riotapi-schema ID/repr)
ESPORTS = 11,
/// Special Europe esports platform for `account-v1`. Do not confuse with the `esports` Valorant platform route.
///
/// `12` (riotapi-schema ID/repr)
ESPORTSEU = 12,
}
/// Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR).

View file

@ -8,7 +8,7 @@
///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/
// Version db87f38b04ca43dab4aa172bf66ad33bce803528
// Version 91e4e0e66537fdebe7117ee0589a16627335b056
//! Automatically generated endpoint handles.
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
@ -252,6 +252,15 @@ impl RiotApi {
pub fn val_console_match_v1(&self) -> ValConsoleMatchV1 {
ValConsoleMatchV1 { base: self }
}
/// Returns a handle for accessing [ValConsoleRankedV1](crate::endpoints::ValConsoleRankedV1) endpoints.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#val-console-ranked-v1" target="_blank">`val-console-ranked-v1`</a>
///
/// Note: this method is automatically generated.
#[inline]
pub fn val_console_ranked_v1(&self) -> ValConsoleRankedV1 {
ValConsoleRankedV1 { base: self }
}
/// Returns a handle for accessing [ValContentV1](crate::endpoints::ValContentV1) endpoints.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#val-content-v1" target="_blank">`val-content-v1`</a>
@ -2210,6 +2219,43 @@ impl<'a> ValConsoleMatchV1<'a> {
}
/// ValConsoleRankedV1 endpoints handle, accessed by calling [`val_console_ranked_v1()`](crate::RiotApi::val_console_ranked_v1) on a [`RiotApi`](crate::RiotApi) instance.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#val-console-ranked-v1" target="_blank">`val-console-ranked-v1`</a>
///
/// Note: this struct is automatically generated.
#[repr(transparent)]
pub struct ValConsoleRankedV1<'a> {
base: &'a RiotApi,
}
impl<'a> ValConsoleRankedV1<'a> {
/// Get leaderboard for the competitive queue
/// # Parameters
/// * `route` - Route to query.
/// * `act_id` (required, in path) - Act ids can be found using the val-content API.
/// * `platform_type` (required, in query)
/// * `start_index` (optional, in query) - Defaults to 0.
/// * `size` (optional, in query) - Defaults to 200. Valid values: 1 to 200.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/api-methods/#val-console-ranked-v1/GET_getLeaderboard" target="_blank">`val-console-ranked-v1.getLeaderboard`</a>
///
/// Note: this method is automatically generated.
pub fn get_leaderboard(&self, route: ValPlatformRoute, act_id: &str, platform_type: &str, size: Option<i32>, start_index: Option<i32>)
-> impl Future<Output = Result<val_console_ranked_v1::Leaderboard>> + 'a
{
let route_str = route.into();
let request = self.base.request(Method::GET, route_str, &format!("/val/console/ranked/v1/leaderboards/by-act/{}", act_id));
let request = request.query(&[ ("platformType", platform_type) ]);
let request = if let Some(size) = size { request.query(&[ ("size", size) ]) } else { request };
let request = if let Some(start_index) = start_index { request.query(&[ ("startIndex", start_index) ]) } else { request };
let future = self.base.execute_val::<val_console_ranked_v1::Leaderboard>("val-console-ranked-v1.getLeaderboard", route_str, request);
#[cfg(feature = "tracing")]
let future = future.instrument(tracing::info_span!("val-console-ranked-v1.getLeaderboard"));
future
}
}
/// ValContentV1 endpoints handle, accessed by calling [`val_content_v1()`](crate::RiotApi::val_content_v1) on a [`RiotApi`](crate::RiotApi) instance.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#val-content-v1" target="_blank">`val-content-v1`</a>

View file

@ -8,7 +8,7 @@
///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/
// Version db87f38b04ca43dab4aa172bf66ad33bce803528
// Version 91e4e0e66537fdebe7117ee0589a16627335b056
//! 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); 85] = [
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 86] = [
(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"),
@ -96,6 +96,7 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 85] = [
(reqwest::Method::GET, "/val/match/console/v1/matches/{matchId}", "val-console-match-v1.getMatch"),
(reqwest::Method::GET, "/val/match/console/v1/matchlists/by-puuid/{puuid}", "val-console-match-v1.getMatchlist"),
(reqwest::Method::GET, "/val/match/console/v1/recent-matches/by-queue/{queue}", "val-console-match-v1.getRecent"),
(reqwest::Method::GET, "/val/console/ranked/v1/leaderboards/by-act/{actId}", "val-console-ranked-v1.getLeaderboard"),
(reqwest::Method::GET, "/val/content/v1/contents", "val-content-v1.getContent"),
(reqwest::Method::GET, "/val/match/v1/matches/{matchId}", "val-match-v1.getMatch"),
(reqwest::Method::GET, "/val/match/v1/matchlists/by-puuid/{puuid}", "val-match-v1.getMatchlist"),

View file

@ -8,7 +8,7 @@
///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/
// Version db87f38b04ca43dab4aa172bf66ad33bce803528
// Version 91e4e0e66537fdebe7117ee0589a16627335b056
#![allow(missing_docs)]
@ -1262,11 +1262,9 @@ pub mod match_v5 {
#[serde(rename = "riotIdGameName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub riot_id_game_name: Option<String>,
#[serde(rename = "riotIdName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub riot_id_name: Option<String>,
#[serde(rename = "riotIdTagline")]
pub riot_id_tagline: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub riot_id_tagline: Option<String>,
#[serde(rename = "role")]
pub role: String,
#[serde(rename = "sightWardsBoughtInGame")]
@ -1384,6 +1382,10 @@ pub mod match_v5 {
#[serde(rename = "playerAugment6")]
#[serde(skip_serializing_if = "Option::is_none")]
pub player_augment6: Option<i32>,
/// Deprecated, use `riotIdGameName`. This field name was briefly used instead of `riotIdGameName`, prior to patch 14.5.
#[serde(rename = "riotIdName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub riot_id_name: Option<String>,
}
/// Challenges data object.
/// # Description
@ -1725,6 +1727,36 @@ pub mod match_v5 {
#[serde(rename = "soloBaronKills")]
#[serde(skip_serializing_if = "Option::is_none")]
pub solo_baron_kills: Option<i32>,
#[serde(rename = "SWARM_DefeatAatrox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_defeat_aatrox: Option<i32>,
#[serde(rename = "SWARM_DefeatBriar")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_defeat_briar: Option<i32>,
#[serde(rename = "SWARM_DefeatMiniBosses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_defeat_mini_bosses: Option<i32>,
#[serde(rename = "SWARM_EvolveWeapon")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_evolve_weapon: Option<i32>,
#[serde(rename = "SWARM_Have3Passives")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_have3_passives: Option<i32>,
#[serde(rename = "SWARM_KillEnemy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_kill_enemy: Option<i32>,
#[serde(rename = "SWARM_PickupGold")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_pickup_gold: Option<i32>,
#[serde(rename = "SWARM_ReachLevel50")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_reach_level50: Option<i32>,
#[serde(rename = "SWARM_Survive15Min")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_survive15_min: Option<i32>,
#[serde(rename = "SWARM_WinWith5EvolvedWeapons")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_win_with5_evolved_weapons: Option<i32>,
#[serde(rename = "soloKills")]
#[serde(skip_serializing_if = "Option::is_none")]
pub solo_kills: Option<i32>,
@ -1804,36 +1836,6 @@ pub mod match_v5 {
#[serde(rename = "wardTakedownsBefore20M")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ward_takedowns_before20_m: Option<i32>,
#[serde(rename = "SWARM_DefeatAatrox")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_defeat_aatrox: Option<i32>,
#[serde(rename = "SWARM_DefeatBriar")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_defeat_briar: Option<i32>,
#[serde(rename = "SWARM_DefeatMiniBosses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_defeat_mini_bosses: Option<i32>,
#[serde(rename = "SWARM_EvolveWeapon")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_evolve_weapon: Option<i32>,
#[serde(rename = "SWARM_Have3Passives")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_have3_passives: Option<i32>,
#[serde(rename = "SWARM_KillEnemy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_kill_enemy: Option<i32>,
#[serde(rename = "SWARM_PickupGold")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_pickup_gold: Option<i32>,
#[serde(rename = "SWARM_ReachLevel50")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_reach_level50: Option<i32>,
#[serde(rename = "SWARM_Survive15Min")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_survive15_min: Option<i32>,
#[serde(rename = "SWARM_WinWith5EvolvedWeapons")]
#[serde(skip_serializing_if = "Option::is_none")]
pub swarm_win_with5_evolved_weapons: Option<i32>,
}
/// Missions data object.
/// # Description
@ -3069,6 +3071,10 @@ pub mod tft_match_v1 {
pub players_eliminated: i32,
#[serde(rename = "puuid")]
pub puuid: String,
#[serde(rename = "riotIdGameName")]
pub riot_id_game_name: String,
#[serde(rename = "riotIdTagline")]
pub riot_id_tagline: String,
/// The number of seconds before the participant was eliminated.
#[serde(rename = "time_eliminated")]
pub time_eliminated: f32,
@ -4090,6 +4096,51 @@ pub mod val_console_match_v1 {
}
}
/// Data structs used by [`ValConsoleRankedV1`](crate::endpoints::ValConsoleRankedV1).
///
/// Note: this module is automatically generated.
#[allow(dead_code)]
pub mod val_console_ranked_v1 {
/// Leaderboard data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct Leaderboard {
/// The shard for the given leaderboard.
#[serde(rename = "shard")]
pub shard: String,
/// The act id for the given leaderboard. Act ids can be found using the val-content API.
#[serde(rename = "actId")]
pub act_id: String,
/// The total number of players in the leaderboard.
#[serde(rename = "totalPlayers")]
pub total_players: i64,
#[serde(rename = "players")]
pub players: std::vec::Vec<Player>,
}
/// Player data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct Player {
/// This field may be omitted if the player has been anonymized.
#[serde(rename = "puuid")]
pub puuid: String,
/// This field may be omitted if the player has been anonymized.
#[serde(rename = "gameName")]
pub game_name: String,
/// This field may be omitted if the player has been anonymized.
#[serde(rename = "tagLine")]
pub tag_line: String,
#[serde(rename = "leaderboardRank")]
pub leaderboard_rank: i64,
#[serde(rename = "rankedRating")]
pub ranked_rating: i64,
#[serde(rename = "numberOfWins")]
pub number_of_wins: i64,
}
}
/// Data structs used by [`ValContentV1`](crate::endpoints::ValContentV1).
///
/// Note: this module is automatically generated.