mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-26 10:56:34 +00:00
Regen and fixes for added lol-challenges-v1.getAllChallengePercentiles
and .getChallengePercentiles
tests.
This commit is contained in:
parent
061ce5bd39
commit
03a053d142
7 changed files with 322 additions and 51 deletions
|
@ -38,11 +38,11 @@ pub enum GameMode {
|
|||
DOOMBOTSTEEMO,
|
||||
/// Snowdown Showdown games
|
||||
FIRSTBLOOD,
|
||||
/// Nexus Blitz games, deprecated in patch 9.2 in favor of gameMode NEXUSBLITZ.
|
||||
/// Nexus Blitz games
|
||||
GAMEMODEX,
|
||||
/// Legend of the Poro King games
|
||||
KINGPORO,
|
||||
/// Nexus Blitz games.
|
||||
/// Nexus Blitz games
|
||||
NEXUSBLITZ,
|
||||
/// Dominion/Crystal Scar games
|
||||
ODIN,
|
||||
|
@ -50,6 +50,8 @@ pub enum GameMode {
|
|||
ODYSSEY,
|
||||
/// One for All games
|
||||
ONEFORALL,
|
||||
/// Practice tool training games.
|
||||
PRACTICETOOL,
|
||||
/// PROJECT: Hunters games
|
||||
PROJECT,
|
||||
/// Nexus Siege games
|
||||
|
@ -64,7 +66,7 @@ pub enum GameMode {
|
|||
TUTORIAL_MODULE_2,
|
||||
/// Tutorial: Shop for Gear.
|
||||
TUTORIAL_MODULE_3,
|
||||
/// Ultimate Spellbook games.
|
||||
/// Ultimate Spellbook games
|
||||
ULTBOOK,
|
||||
/// URF games
|
||||
URF,
|
||||
|
|
|
@ -37,6 +37,8 @@ pub enum Tier {
|
|||
IRON = 40,
|
||||
|
||||
/// Unranked, no tier. Repr: `0_u8`.
|
||||
/// Also deserializes from "NONE" returned by `lol-challenges-v1.getChallengePercentiles`.
|
||||
#[serde(alias = "NONE")]
|
||||
UNRANKED = 0,
|
||||
}
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 616004110d2cf4f8bb0b1e0332e079399aea56cc
|
||||
// Version d2e2d8db61e32b60f6722b887694538659c20436
|
||||
|
||||
//! Automatically generated endpoint handles.
|
||||
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
||||
|
@ -80,6 +80,15 @@ impl RiotApi {
|
|||
pub fn league_v4(&self) -> LeagueV4 {
|
||||
LeagueV4 { base: self }
|
||||
}
|
||||
/// Returns a handle for accessing [LolChallengesV1](crate::endpoints::LolChallengesV1) endpoints.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#lol-challenges-v1" target="_blank">`lol-challenges-v1`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
#[inline]
|
||||
pub fn lol_challenges_v1(&self) -> LolChallengesV1 {
|
||||
LolChallengesV1 { base: self }
|
||||
}
|
||||
/// Returns a handle for accessing [LolStatusV3](crate::endpoints::LolStatusV3) endpoints.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#lol-status-v3" target="_blank">`lol-status-v3`</a>
|
||||
|
@ -197,15 +206,6 @@ impl RiotApi {
|
|||
pub fn tft_summoner_v1(&self) -> TftSummonerV1 {
|
||||
TftSummonerV1 { base: self }
|
||||
}
|
||||
/// Returns a handle for accessing [ThirdPartyCodeV4](crate::endpoints::ThirdPartyCodeV4) endpoints.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#third-party-code-v4" target="_blank">`third-party-code-v4`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
#[inline]
|
||||
pub fn third_party_code_v4(&self) -> ThirdPartyCodeV4 {
|
||||
ThirdPartyCodeV4 { base: self }
|
||||
}
|
||||
/// Returns a handle for accessing [TournamentStubV4](crate::endpoints::TournamentStubV4) endpoints.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#tournament-stub-v4" target="_blank">`tournament-stub-v4`</a>
|
||||
|
@ -726,6 +726,133 @@ impl<'a> LeagueV4<'a> {
|
|||
|
||||
}
|
||||
|
||||
/// LolChallengesV1 endpoints handle, accessed by calling [`lol_challenges_v1()`](crate::RiotApi::lol_challenges_v1) on a [`RiotApi`](crate::RiotApi) instance.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#lol-challenges-v1" target="_blank">`lol-challenges-v1`</a>
|
||||
///
|
||||
/// Note: this struct is automatically generated.
|
||||
#[repr(transparent)]
|
||||
pub struct LolChallengesV1<'a> {
|
||||
base: &'a RiotApi,
|
||||
}
|
||||
impl<'a> LolChallengesV1<'a> {
|
||||
/// List of all basic challenge configuration information (includes all translations for names and descriptions)
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#lol-challenges-v1/GET_getAllChallengeConfigs" target="_blank">`lol-challenges-v1.getAllChallengeConfigs`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_all_challenge_configs(&self, route: PlatformRoute)
|
||||
-> impl Future<Output = Result<Vec<lol_challenges_v1::ChallengeConfigInfo>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, "/lol/challenges/v1/challenges/config");
|
||||
let future = self.base.execute_val::<Vec<lol_challenges_v1::ChallengeConfigInfo>>("lol-challenges-v1.getAllChallengeConfigs", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengeConfigs"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Map of level to percentile of players who have achieved it - keys: ChallengeId -> Season -> Level -> percentile of players who achieved it
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#lol-challenges-v1/GET_getAllChallengePercentiles" target="_blank">`lol-challenges-v1.getAllChallengePercentiles`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_all_challenge_percentiles(&self, route: PlatformRoute)
|
||||
-> impl Future<Output = Result<std::collections::HashMap<i64, std::collections::HashMap<crate::consts::Tier, f64>>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, "/lol/challenges/v1/challenges/percentiles");
|
||||
let future = self.base.execute_val::<std::collections::HashMap<i64, std::collections::HashMap<crate::consts::Tier, f64>>>("lol-challenges-v1.getAllChallengePercentiles", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengePercentiles"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Get challenge configuration (REST)
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `challenge_id` (required, in path)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#lol-challenges-v1/GET_getChallengeConfigs" target="_blank">`lol-challenges-v1.getChallengeConfigs`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_challenge_configs(&self, route: PlatformRoute, challenge_id: i64)
|
||||
-> impl Future<Output = Result<Option<lol_challenges_v1::ChallengeConfigInfo>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/config", challenge_id));
|
||||
let future = self.base.execute_opt::<lol_challenges_v1::ChallengeConfigInfo>("lol-challenges-v1.getChallengeConfigs", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeConfigs"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Return top players for each level. Level must be MASTER, GRANDMASTER or CHALLENGER.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `level` (required, in path)
|
||||
/// * `challenge_id` (required, in path)
|
||||
/// * `limit` (optional, in query)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#lol-challenges-v1/GET_getChallengeLeaderboards" target="_blank">`lol-challenges-v1.getChallengeLeaderboards`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_challenge_leaderboards(&self, route: PlatformRoute, challenge_id: i64, level: &str, limit: Option<i32>)
|
||||
-> impl Future<Output = Result<Option<Vec<lol_challenges_v1::ApexPlayerInfo>>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/leaderboards/by-level/{}", challenge_id, level));
|
||||
let mut request = request; if let Some(limit) = limit { request = request.query(&[ ("limit", limit) ]); }
|
||||
let future = self.base.execute_opt::<Vec<lol_challenges_v1::ApexPlayerInfo>>("lol-challenges-v1.getChallengeLeaderboards", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeLeaderboards"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Map of level to percentile of players who have achieved it
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `challenge_id` (required, in path)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#lol-challenges-v1/GET_getChallengePercentiles" target="_blank">`lol-challenges-v1.getChallengePercentiles`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_challenge_percentiles(&self, route: PlatformRoute, challenge_id: i64)
|
||||
-> impl Future<Output = Result<Option<std::collections::HashMap<crate::consts::Tier, f64>>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/percentiles", challenge_id));
|
||||
let future = self.base.execute_opt::<std::collections::HashMap<crate::consts::Tier, f64>>("lol-challenges-v1.getChallengePercentiles", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengePercentiles"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Returns player information with list of all progressed challenges (REST)
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `puuid` (required, in path)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#lol-challenges-v1/GET_getPlayerData" target="_blank">`lol-challenges-v1.getPlayerData`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_player_data(&self, route: PlatformRoute, puuid: &str)
|
||||
-> impl Future<Output = Result<lol_challenges_v1::PlayerInfo>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/player-data/{}", puuid));
|
||||
let future = self.base.execute_val::<lol_challenges_v1::PlayerInfo>("lol-challenges-v1.getPlayerData", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("lol-challenges-v1.getPlayerData"));
|
||||
future
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// LolStatusV3 endpoints handle, accessed by calling [`lol_status_v3()`](crate::RiotApi::lol_status_v3) on a [`RiotApi`](crate::RiotApi) instance.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#lol-status-v3" target="_blank">`lol-status-v3`</a>
|
||||
|
@ -1380,17 +1507,23 @@ impl<'a> TftMatchV1<'a> {
|
|||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `puuid` (required, in path)
|
||||
/// * `count` (optional, in query) - Defaults to 20.
|
||||
/// * `start` (optional, in query) - Defaults to 0. Start index.
|
||||
/// * `end_time` (optional, in query) - Epoch timestamp in seconds.
|
||||
/// * `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set.
|
||||
/// * `count` (optional, in query) - Defaults to 20. Number of match ids to return.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#tft-match-v1/GET_getMatchIdsByPUUID" target="_blank">`tft-match-v1.getMatchIdsByPUUID`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_match_ids_by_puuid(&self, route: RegionalRoute, puuid: &str, count: Option<i32>)
|
||||
pub fn get_match_ids_by_puuid(&self, route: RegionalRoute, puuid: &str, count: Option<i32>, end_time: Option<i64>, start: Option<i32>, start_time: Option<i64>)
|
||||
-> impl Future<Output = Result<Vec<String>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/tft/match/v1/matches/by-puuid/{}/ids", puuid));
|
||||
let mut request = request; if let Some(count) = count { request = request.query(&[ ("count", count) ]); }
|
||||
let mut request = request; if let Some(end_time) = end_time { request = request.query(&[ ("endTime", end_time) ]); }
|
||||
let mut request = request; if let Some(start) = start { request = request.query(&[ ("start", start) ]); }
|
||||
let mut request = request; if let Some(start_time) = start_time { request = request.query(&[ ("startTime", start_time) ]); }
|
||||
let future = self.base.execute_val::<Vec<String>>("tft-match-v1.getMatchIdsByPUUID", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("tft-match-v1.getMatchIdsByPUUID"));
|
||||
|
@ -1526,37 +1659,6 @@ impl<'a> TftSummonerV1<'a> {
|
|||
|
||||
}
|
||||
|
||||
/// ThirdPartyCodeV4 endpoints handle, accessed by calling [`third_party_code_v4()`](crate::RiotApi::third_party_code_v4) on a [`RiotApi`](crate::RiotApi) instance.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#third-party-code-v4" target="_blank">`third-party-code-v4`</a>
|
||||
///
|
||||
/// Note: this struct is automatically generated.
|
||||
#[repr(transparent)]
|
||||
pub struct ThirdPartyCodeV4<'a> {
|
||||
base: &'a RiotApi,
|
||||
}
|
||||
impl<'a> ThirdPartyCodeV4<'a> {
|
||||
/// Get third party code for a given summoner ID.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `encrypted_summoner_id` (required, in path)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#third-party-code-v4/GET_getThirdPartyCodeBySummonerId" target="_blank">`third-party-code-v4.getThirdPartyCodeBySummonerId`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_third_party_code_by_summoner_id(&self, route: PlatformRoute, encrypted_summoner_id: &str)
|
||||
-> impl Future<Output = Result<String>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/platform/v4/third-party-code/by-summoner/{}", encrypted_summoner_id));
|
||||
let future = self.base.execute_val::<String>("third-party-code-v4.getThirdPartyCodeBySummonerId", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("third-party-code-v4.getThirdPartyCodeBySummonerId"));
|
||||
future
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// TournamentStubV4 endpoints handle, accessed by calling [`tournament_stub_v4()`](crate::RiotApi::tournament_stub_v4) on a [`RiotApi`](crate::RiotApi) instance.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#tournament-stub-v4" target="_blank">`tournament-stub-v4`</a>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 616004110d2cf4f8bb0b1e0332e079399aea56cc
|
||||
// Version d2e2d8db61e32b60f6722b887694538659c20436
|
||||
|
||||
//! 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); 70] = [
|
||||
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 75] = [
|
||||
(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"),
|
||||
|
@ -36,6 +36,12 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 70] = [
|
|||
(reqwest::Method::GET, "/lol/league/v4/grandmasterleagues/by-queue/{queue}", "league-v4.getGrandmasterLeague"),
|
||||
(reqwest::Method::GET, "/lol/league/v4/leagues/{leagueId}", "league-v4.getLeagueById"),
|
||||
(reqwest::Method::GET, "/lol/league/v4/masterleagues/by-queue/{queue}", "league-v4.getMasterLeague"),
|
||||
(reqwest::Method::GET, "/lol/challenges/v1/challenges/config", "lol-challenges-v1.getAllChallengeConfigs"),
|
||||
(reqwest::Method::GET, "/lol/challenges/v1/challenges/percentiles", "lol-challenges-v1.getAllChallengePercentiles"),
|
||||
(reqwest::Method::GET, "/lol/challenges/v1/challenges/{challengeId}/config", "lol-challenges-v1.getChallengeConfigs"),
|
||||
(reqwest::Method::GET, "/lol/challenges/v1/challenges/{challengeId}/leaderboards/by-level/{level}", "lol-challenges-v1.getChallengeLeaderboards"),
|
||||
(reqwest::Method::GET, "/lol/challenges/v1/challenges/{challengeId}/percentiles", "lol-challenges-v1.getChallengePercentiles"),
|
||||
(reqwest::Method::GET, "/lol/challenges/v1/player-data/{puuid}", "lol-challenges-v1.getPlayerData"),
|
||||
(reqwest::Method::GET, "/lol/status/v3/shard-data", "lol-status-v3.getShardData"),
|
||||
(reqwest::Method::GET, "/lol/status/v4/platform-data", "lol-status-v4.getPlatformData"),
|
||||
(reqwest::Method::GET, "/lor/deck/v1/decks/me", "lor-deck-v1.getDecks"),
|
||||
|
@ -69,7 +75,6 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 70] = [
|
|||
(reqwest::Method::GET, "/tft/summoner/v1/summoners/by-puuid/{encryptedPUUID}", "tft-summoner-v1.getByPUUID"),
|
||||
(reqwest::Method::GET, "/tft/summoner/v1/summoners/me", "tft-summoner-v1.getByAccessToken"),
|
||||
(reqwest::Method::GET, "/tft/summoner/v1/summoners/{encryptedSummonerId}", "tft-summoner-v1.getBySummonerId"),
|
||||
(reqwest::Method::GET, "/lol/platform/v4/third-party-code/by-summoner/{encryptedSummonerId}", "third-party-code-v4.getThirdPartyCodeBySummonerId"),
|
||||
(reqwest::Method::POST, "/lol/tournament-stub/v4/codes", "tournament-stub-v4.createTournamentCode"),
|
||||
(reqwest::Method::GET, "/lol/tournament-stub/v4/lobby-events/by-code/{tournamentCode}", "tournament-stub-v4.getLobbyEventsByCode"),
|
||||
(reqwest::Method::POST, "/lol/tournament-stub/v4/providers", "tournament-stub-v4.registerProviderData"),
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 616004110d2cf4f8bb0b1e0332e079399aea56cc
|
||||
// Version d2e2d8db61e32b60f6722b887694538659c20436
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
|
@ -366,6 +366,134 @@ pub mod league_v4 {
|
|||
}
|
||||
}
|
||||
|
||||
/// Data structs used by [`LolChallengesV1`](crate::endpoints::LolChallengesV1).
|
||||
///
|
||||
/// Note: this module is automatically generated.
|
||||
#[allow(dead_code)]
|
||||
pub mod lol_challenges_v1 {
|
||||
/// ChallengeConfigInfo data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct ChallengeConfigInfo {
|
||||
#[serde(rename = "id")]
|
||||
pub id: i64,
|
||||
#[serde(rename = "localizedNames")]
|
||||
pub localized_names: std::collections::HashMap<String, std::collections::HashMap<String, String>>,
|
||||
#[serde(rename = "state")]
|
||||
pub state: State,
|
||||
#[serde(rename = "tracking")]
|
||||
pub tracking: Tracking,
|
||||
#[serde(rename = "startTimestamp")]
|
||||
pub start_timestamp: i64,
|
||||
#[serde(rename = "endTimestamp")]
|
||||
pub end_timestamp: i64,
|
||||
#[serde(rename = "leaderboard")]
|
||||
pub leaderboard: bool,
|
||||
#[serde(rename = "thresholds")]
|
||||
pub thresholds: std::collections::HashMap<String, f64>,
|
||||
}
|
||||
/// State data object.
|
||||
/// # Description
|
||||
/// DISABLED - not visible and not calculated,<br>
|
||||
/// HIDDEN - not visible, but calculated,<br>
|
||||
/// ENABLED - visible and calculated,<br>
|
||||
/// ARCHIVED - visible, but not calculated
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct State {
|
||||
}
|
||||
/// Tracking data object.
|
||||
/// # Description
|
||||
/// LIFETIME - stats are incremented without reset,<br>
|
||||
/// SEASON - stats are accumulated by season and reset at the beginning of new season
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct Tracking {
|
||||
}
|
||||
/// ApexPlayerInfo data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct ApexPlayerInfo {
|
||||
#[serde(rename = "puuid")]
|
||||
pub puuid: String,
|
||||
#[serde(rename = "value")]
|
||||
pub value: f64,
|
||||
#[serde(rename = "position")]
|
||||
pub position: i32,
|
||||
}
|
||||
/// Level data object.
|
||||
/// # Description
|
||||
/// 0 NONE,<br>
|
||||
/// 1 IRON,<br>
|
||||
/// 2 BRONZE,<br>
|
||||
/// 3 SILVER,<br>
|
||||
/// 4 GOLD,<br>
|
||||
/// 5 PLATINUM,<br>
|
||||
/// 6 DIAMOND,<br>
|
||||
/// 7 MASTER,<br>
|
||||
/// 8 GRANDMASTER,<br>
|
||||
/// 9 CHALLENGER
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct Level {
|
||||
}
|
||||
/// PlayerInfo data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct PlayerInfo {
|
||||
#[serde(rename = "challenges")]
|
||||
pub challenges: std::vec::Vec<ChallengeInfo>,
|
||||
#[serde(rename = "preferences")]
|
||||
pub preferences: PlayerClientPreferences,
|
||||
#[serde(rename = "totalPoints")]
|
||||
pub total_points: ChallengePoints,
|
||||
#[serde(rename = "categoryPoints")]
|
||||
pub category_points: std::collections::HashMap<String, ChallengePoints>,
|
||||
}
|
||||
/// ChallengeInfo data object.
|
||||
/// # Description
|
||||
/// UNKNOWN TYPE.
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct ChallengeInfo {
|
||||
}
|
||||
/// PlayerClientPreferences data object.
|
||||
/// # Description
|
||||
/// UNKNOWN TYPE.
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct PlayerClientPreferences {
|
||||
}
|
||||
/// ChallengePoints data object.
|
||||
/// # Description
|
||||
/// UNKNOWN TYPE.
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct ChallengePoints {
|
||||
}
|
||||
}
|
||||
|
||||
/// Data structs used by [`LolStatusV3`](crate::endpoints::LolStatusV3).
|
||||
///
|
||||
/// Note: this module is automatically generated.
|
||||
|
|
|
@ -40,7 +40,7 @@ pub mod {{= dotUtils.changeCase.snakeCase(endpoint) }} {
|
|||
/// {{= schemaName }} data object.
|
||||
{{? schema.description }}
|
||||
/// # Description
|
||||
/// {{= schema.description }}
|
||||
/// {{= schema.description.split('\n').map(x => x.trim()).join('<br>\r\n /// ') }}
|
||||
///
|
||||
/// Note: This struct is automatically generated
|
||||
{{?}}
|
||||
|
|
32
riven/tests/tests_la1.rs
Normal file
32
riven/tests/tests_la1.rs
Normal file
|
@ -0,0 +1,32 @@
|
|||
#![cfg_attr(feature = "nightly", feature(custom_test_frameworks))]
|
||||
#![cfg_attr(feature = "nightly", test_runner(my_runner))]
|
||||
|
||||
mod async_tests;
|
||||
mod testutils;
|
||||
use testutils::RIOT_API;
|
||||
|
||||
use colored::*;
|
||||
|
||||
use riven::consts::*;
|
||||
|
||||
const ROUTE: PlatformRoute = PlatformRoute::LA1;
|
||||
|
||||
async_tests! {
|
||||
my_runner {
|
||||
lol_challenges_v1_check_percentiles: async {
|
||||
// Check all percentiles.
|
||||
let percentiles = RIOT_API.lol_challenges_v1().get_all_challenge_percentiles(ROUTE)
|
||||
.await.map_err(|e| e.to_string())?;
|
||||
rassert!(!percentiles.is_empty());
|
||||
|
||||
// Spot-check 10% of the challenge IDs.
|
||||
for &challenge_id in percentiles.keys().step_by(10) {
|
||||
RIOT_API.lol_challenges_v1().get_challenge_percentiles(ROUTE, challenge_id)
|
||||
.await.map_err(|e| format!("Failed to get challenge with id {}\n{}", challenge_id, e))?
|
||||
.ok_or_else(|| format!("Challenge with id {} returned 404", challenge_id))?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
},
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue