mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-26 10:56:34 +00:00
Regen for Briar, new champion-mastery-v4.getChampionMasteryByPUUID
endpoint
This commit is contained in:
parent
c58da65298
commit
1ec4c18ae4
4 changed files with 97 additions and 8 deletions
|
@ -33,6 +33,7 @@ newtype_enum! {
|
|||
/// `BLITZCRANK` | "Blitzcrank" | "Blitzcrank" | 53
|
||||
/// `BRAND` | "Brand" | "Brand" | 63
|
||||
/// `BRAUM` | "Braum" | "Braum" | 201
|
||||
/// `BRIAR` | "Briar" | "Briar" | 233
|
||||
/// `CAITLYN` | "Caitlyn" | "Caitlyn" | 51
|
||||
/// `CAMILLE` | "Camille" | "Camille" | 164
|
||||
/// `CASSIOPEIA` | "Cassiopeia" | "Cassiopeia" | 69
|
||||
|
@ -218,6 +219,8 @@ newtype_enum! {
|
|||
BRAND = 63,
|
||||
/// `201`.
|
||||
BRAUM = 201,
|
||||
/// `233`.
|
||||
BRIAR = 233,
|
||||
/// `51`.
|
||||
CAITLYN = 51,
|
||||
/// `164`.
|
||||
|
@ -536,6 +539,7 @@ impl Champion {
|
|||
Self::BLITZCRANK => Some("Blitzcrank"),
|
||||
Self::BRAND => Some("Brand"),
|
||||
Self::BRAUM => Some("Braum"),
|
||||
Self::BRIAR => Some("Briar"),
|
||||
Self::CAITLYN => Some("Caitlyn"),
|
||||
Self::CAMILLE => Some("Camille"),
|
||||
Self::CASSIOPEIA => Some("Cassiopeia"),
|
||||
|
@ -724,6 +728,7 @@ impl Champion {
|
|||
Self::BLITZCRANK => Some("Blitzcrank"),
|
||||
Self::BRAND => Some("Brand"),
|
||||
Self::BRAUM => Some("Braum"),
|
||||
Self::BRIAR => Some("Briar"),
|
||||
Self::CAITLYN => Some("Caitlyn"),
|
||||
Self::CAMILLE => Some("Camille"),
|
||||
Self::CASSIOPEIA => Some("Cassiopeia"),
|
||||
|
@ -943,6 +948,7 @@ impl std::str::FromStr for Champion {
|
|||
/* BLIT */ [ 'B', 'L', 'I', 'T'] => Ok(Champion::BLITZCRANK),
|
||||
/* BRAN */ [ 'B', 'R', 'A', 'N'] => Ok(Champion::BRAND),
|
||||
/* BRAU */ [ 'B', 'R', 'A', 'U'] => Ok(Champion::BRAUM),
|
||||
/* BRIA */ [ 'B', 'R', 'I', 'A'] => Ok(Champion::BRIAR),
|
||||
/* CAIT */ [ 'C', 'A', 'I', 'T'] => Ok(Champion::CAITLYN),
|
||||
/* CAMI */ [ 'C', 'A', 'M', 'I'] => Ok(Champion::CAMILLE),
|
||||
/* CASS */ [ 'C', 'A', 'S', 'S'] => Ok(Champion::CASSIOPEIA),
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 55e76c61b6feb1298719d6f55d89f2229e88e4eb
|
||||
// Version 560d6708a4e0e652fc4b2ada788de0bd6eb546ad
|
||||
|
||||
//! Automatically generated endpoint handles.
|
||||
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
||||
|
@ -372,6 +372,66 @@ pub struct ChampionMasteryV4<'a> {
|
|||
base: &'a RiotApi,
|
||||
}
|
||||
impl<'a> ChampionMasteryV4<'a> {
|
||||
/// Get all champion mastery entries sorted by number of champion points descending.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `encrypted_puuid` (required, in path)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getAllChampionMasteriesByPUUID" target="_blank">`champion-mastery-v4.getAllChampionMasteriesByPUUID`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_all_champion_masteries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str)
|
||||
-> impl Future<Output = Result<Vec<champion_mastery_v4::ChampionMastery>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}", encrypted_puuid));
|
||||
let future = self.base.execute_val::<Vec<champion_mastery_v4::ChampionMastery>>("champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getAllChampionMasteriesByPUUID"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Get a champion mastery by puuid and champion ID.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `encrypted_puuid` (required, in path)
|
||||
/// * `champion_id` (required, in path) - Champion ID to retrieve Champion Mastery.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getChampionMasteryByPUUID" target="_blank">`champion-mastery-v4.getChampionMasteryByPUUID`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_champion_mastery_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str, champion_id: crate::consts::Champion)
|
||||
-> impl Future<Output = Result<champion_mastery_v4::ChampionMastery>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/by-champion/{}", encrypted_puuid, champion_id));
|
||||
let future = self.base.execute_val::<champion_mastery_v4::ChampionMastery>("champion-mastery-v4.getChampionMasteryByPUUID", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryByPUUID"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Get specified number of top champion mastery entries sorted by number of champion points descending.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `encrypted_puuid` (required, in path)
|
||||
/// * `count` (optional, in query) - Number of entries to retrieve, defaults to 3.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getTopChampionMasteriesByPUUID" target="_blank">`champion-mastery-v4.getTopChampionMasteriesByPUUID`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_top_champion_masteries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str, count: Option<i32>)
|
||||
-> impl Future<Output = Result<Vec<champion_mastery_v4::ChampionMastery>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/top", encrypted_puuid));
|
||||
let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request };
|
||||
let future = self.base.execute_val::<Vec<champion_mastery_v4::ChampionMastery>>("champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getTopChampionMasteriesByPUUID"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Get all champion mastery entries sorted by number of champion points descending,
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
|
@ -432,6 +492,25 @@ impl<'a> ChampionMasteryV4<'a> {
|
|||
future
|
||||
}
|
||||
|
||||
/// Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `encrypted_puuid` (required, in path)
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getChampionMasteryScoreByPUUID" target="_blank">`champion-mastery-v4.getChampionMasteryScoreByPUUID`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_champion_mastery_score_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str)
|
||||
-> impl Future<Output = Result<i32>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/scores/by-puuid/{}", encrypted_puuid));
|
||||
let future = self.base.execute_val::<i32>("champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryScoreByPUUID"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Get a player's total champion mastery score, which is the sum of individual champion mastery levels.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
|
@ -498,16 +577,16 @@ impl<'a> ClashV1<'a> {
|
|||
/// 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.
|
||||
/// * `encrypted_puuid` (required, in path)
|
||||
/// * `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, encrypted_puuid: &str)
|
||||
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/{}", encrypted_puuid));
|
||||
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"));
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 55e76c61b6feb1298719d6f55d89f2229e88e4eb
|
||||
// Version 560d6708a4e0e652fc4b2ada788de0bd6eb546ad
|
||||
|
||||
//! Metadata about the Riot API and Riven.
|
||||
//!
|
||||
|
@ -15,17 +15,21 @@
|
|||
|
||||
/// 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); 79] = [
|
||||
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 83] = [
|
||||
(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"),
|
||||
(reqwest::Method::GET, "/riot/account/v1/active-shards/by-game/{game}/by-puuid/{puuid}", "account-v1.getActiveShard"),
|
||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}", "champion-mastery-v4.getAllChampionMasteriesByPUUID"),
|
||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/by-champion/{championId}", "champion-mastery-v4.getChampionMasteryByPUUID"),
|
||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/top", "champion-mastery-v4.getTopChampionMasteriesByPUUID"),
|
||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}", "champion-mastery-v4.getAllChampionMasteries"),
|
||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/by-champion/{championId}", "champion-mastery-v4.getChampionMastery"),
|
||||
(reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-summoner/{encryptedSummonerId}/top", "champion-mastery-v4.getTopChampionMasteries"),
|
||||
(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/{encryptedPUUID}", "clash-v1.getPlayersByPUUID"),
|
||||
(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"),
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 55e76c61b6feb1298719d6f55d89f2229e88e4eb
|
||||
// Version 560d6708a4e0e652fc4b2ada788de0bd6eb546ad
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
|
|
Loading…
Reference in a new issue