mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-26 10:56:34 +00:00
Regen for spectator-tft-v5
This commit is contained in:
parent
9700dde341
commit
ed9eb0094e
3 changed files with 295 additions and 4 deletions
|
@ -8,7 +8,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 879affafe206ccc5b48127e68c0bd466fcc73c84
|
||||
// Version b7bbeb7db6b83260e4a4252fa4f53b8ca5d57ab0
|
||||
|
||||
//! Automatically generated endpoint handles.
|
||||
#![allow(clippy::let_and_return, clippy::too_many_arguments)]
|
||||
|
@ -162,6 +162,15 @@ impl RiotApi {
|
|||
pub fn match_v5(&self) -> MatchV5 {
|
||||
MatchV5 { base: self }
|
||||
}
|
||||
/// Returns a handle for accessing [SpectatorTftV5](crate::endpoints::SpectatorTftV5) endpoints.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#spectator-tft-v5" target="_blank">`spectator-tft-v5`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
#[inline]
|
||||
pub fn spectator_tft_v5(&self) -> SpectatorTftV5 {
|
||||
SpectatorTftV5 { base: self }
|
||||
}
|
||||
/// Returns a handle for accessing [SpectatorV4](crate::endpoints::SpectatorV4) endpoints.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#spectator-v4" target="_blank">`spectator-v4`</a>
|
||||
|
@ -1231,6 +1240,55 @@ impl<'a> MatchV5<'a> {
|
|||
|
||||
}
|
||||
|
||||
/// SpectatorTftV5 endpoints handle, accessed by calling [`spectator_tft_v5()`](crate::RiotApi::spectator_tft_v5) on a [`RiotApi`](crate::RiotApi) instance.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#spectator-tft-v5" target="_blank">`spectator-tft-v5`</a>
|
||||
///
|
||||
/// Note: this struct is automatically generated.
|
||||
#[repr(transparent)]
|
||||
pub struct SpectatorTftV5<'a> {
|
||||
base: &'a RiotApi,
|
||||
}
|
||||
impl<'a> SpectatorTftV5<'a> {
|
||||
/// Get current game information for the given puuid.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// * `encrypted_puuid` (required, in path) - The puuid of the summoner.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#spectator-tft-v5/GET_getCurrentGameInfoByPuuid" target="_blank">`spectator-tft-v5.getCurrentGameInfoByPuuid`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_current_game_info_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str)
|
||||
-> impl Future<Output = Result<Option<spectator_tft_v5::CurrentGameInfo>>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, &format!("/lol/spectator/tft/v5/active-games/by-puuid/{}", encrypted_puuid));
|
||||
let future = self.base.execute_opt::<spectator_tft_v5::CurrentGameInfo>("spectator-tft-v5.getCurrentGameInfoByPuuid", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("spectator-tft-v5.getCurrentGameInfoByPuuid"));
|
||||
future
|
||||
}
|
||||
|
||||
/// Get list of featured games.
|
||||
/// # Parameters
|
||||
/// * `route` - Route to query.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/api-methods/#spectator-tft-v5/GET_getFeaturedGames" target="_blank">`spectator-tft-v5.getFeaturedGames`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_featured_games(&self, route: PlatformRoute)
|
||||
-> impl Future<Output = Result<spectator_tft_v5::FeaturedGames>> + 'a
|
||||
{
|
||||
let route_str = route.into();
|
||||
let request = self.base.request(Method::GET, route_str, "/lol/spectator/tft/v5/featured-games");
|
||||
let future = self.base.execute_val::<spectator_tft_v5::FeaturedGames>("spectator-tft-v5.getFeaturedGames", route_str, request);
|
||||
#[cfg(feature = "tracing")]
|
||||
let future = future.instrument(tracing::info_span!("spectator-tft-v5.getFeaturedGames"));
|
||||
future
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// SpectatorV4 endpoints handle, accessed by calling [`spectator_v4()`](crate::RiotApi::spectator_v4) on a [`RiotApi`](crate::RiotApi) instance.
|
||||
/// # Riot Developer API Reference
|
||||
/// <a href="https://developer.riotgames.com/apis#spectator-v4" target="_blank">`spectator-v4`</a>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 879affafe206ccc5b48127e68c0bd466fcc73c84
|
||||
// Version b7bbeb7db6b83260e4a4252fa4f53b8ca5d57ab0
|
||||
|
||||
//! 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); 82] = [
|
||||
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 84] = [
|
||||
(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"),
|
||||
|
@ -56,6 +56,8 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 82] = [
|
|||
(reqwest::Method::GET, "/lol/match/v5/matches/by-puuid/{puuid}/ids", "match-v5.getMatchIdsByPUUID"),
|
||||
(reqwest::Method::GET, "/lol/match/v5/matches/{matchId}", "match-v5.getMatch"),
|
||||
(reqwest::Method::GET, "/lol/match/v5/matches/{matchId}/timeline", "match-v5.getTimeline"),
|
||||
(reqwest::Method::GET, "/lol/spectator/tft/v5/active-games/by-puuid/{encryptedPUUID}", "spectator-tft-v5.getCurrentGameInfoByPuuid"),
|
||||
(reqwest::Method::GET, "/lol/spectator/tft/v5/featured-games", "spectator-tft-v5.getFeaturedGames"),
|
||||
(reqwest::Method::GET, "/lol/spectator/v4/active-games/by-summoner/{encryptedSummonerId}", "spectator-v4.getCurrentGameInfoBySummoner"),
|
||||
(reqwest::Method::GET, "/lol/spectator/v4/featured-games", "spectator-v4.getFeaturedGames"),
|
||||
(reqwest::Method::GET, "/lol/spectator/v5/active-games/by-summoner/{encryptedPUUID}", "spectator-v5.getCurrentGameInfoByPuuid"),
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version 879affafe206ccc5b48127e68c0bd466fcc73c84
|
||||
// Version b7bbeb7db6b83260e4a4252fa4f53b8ca5d57ab0
|
||||
|
||||
#![allow(missing_docs)]
|
||||
|
||||
|
@ -2267,6 +2267,237 @@ pub mod match_v5 {
|
|||
}
|
||||
}
|
||||
|
||||
/// Data structs used by [`SpectatorTftV5`](crate::endpoints::SpectatorTftV5).
|
||||
///
|
||||
/// Note: this module is automatically generated.
|
||||
#[allow(dead_code)]
|
||||
pub mod spectator_tft_v5 {
|
||||
/// CurrentGameInfo data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct CurrentGameInfo {
|
||||
/// The ID of the game
|
||||
#[serde(rename = "gameId")]
|
||||
pub game_id: i64,
|
||||
/// The game type
|
||||
#[serde(rename = "gameType")]
|
||||
pub game_type: crate::consts::GameType,
|
||||
/// The game start time represented in epoch milliseconds
|
||||
#[serde(rename = "gameStartTime")]
|
||||
pub game_start_time: i64,
|
||||
/// The ID of the map
|
||||
#[serde(rename = "mapId")]
|
||||
pub map_id: crate::consts::Map,
|
||||
/// The amount of time in seconds that has passed since the game started
|
||||
#[serde(rename = "gameLength")]
|
||||
pub game_length: i64,
|
||||
/// The ID of the platform on which the game is being played
|
||||
#[serde(rename = "platformId")]
|
||||
pub platform_id: String,
|
||||
/// The game mode
|
||||
#[serde(rename = "gameMode")]
|
||||
pub game_mode: crate::consts::GameMode,
|
||||
/// Banned champion information
|
||||
#[serde(rename = "bannedChampions")]
|
||||
pub banned_champions: std::vec::Vec<BannedChampion>,
|
||||
/// The queue type (queue types are documented on the Game Constants page)
|
||||
#[serde(rename = "gameQueueConfigId")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub game_queue_config_id: Option<crate::consts::Queue>,
|
||||
/// The observer information
|
||||
#[serde(rename = "observers")]
|
||||
pub observers: Observer,
|
||||
/// The participant information
|
||||
#[serde(rename = "participants")]
|
||||
pub participants: std::vec::Vec<CurrentGameParticipant>,
|
||||
}
|
||||
/// BannedChampion data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct BannedChampion {
|
||||
/// The turn during which the champion was banned
|
||||
#[serde(rename = "pickTurn")]
|
||||
pub pick_turn: i32,
|
||||
/// The ID of the banned champion
|
||||
#[serde(rename = "championId")]
|
||||
pub champion_id: crate::consts::Champion,
|
||||
/// The ID of the team that banned the champion
|
||||
#[serde(rename = "teamId")]
|
||||
pub team_id: crate::consts::Team,
|
||||
}
|
||||
/// Observer data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct Observer {
|
||||
/// Key used to decrypt the spectator grid game data for playback
|
||||
#[serde(rename = "encryptionKey")]
|
||||
pub encryption_key: String,
|
||||
}
|
||||
/// CurrentGameParticipant data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct CurrentGameParticipant {
|
||||
/// The ID of the champion played by this participant
|
||||
#[serde(rename = "championId")]
|
||||
pub champion_id: crate::consts::Champion,
|
||||
/// Perks/Runes Reforged Information
|
||||
#[serde(rename = "perks")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub perks: Option<Perks>,
|
||||
/// The ID of the profile icon used by this participant
|
||||
#[serde(rename = "profileIconId")]
|
||||
pub profile_icon_id: i64,
|
||||
/// Flag indicating whether or not this participant is a bot
|
||||
#[serde(rename = "bot")]
|
||||
pub bot: bool,
|
||||
/// The team ID of this participant, indicating the participant's team
|
||||
#[serde(rename = "teamId")]
|
||||
pub team_id: crate::consts::Team,
|
||||
/// The summoner name of this participant
|
||||
#[serde(rename = "summonerName")]
|
||||
pub summoner_name: String,
|
||||
/// The encrypted summoner ID of this participant
|
||||
#[serde(rename = "summonerId")]
|
||||
pub summoner_id: String,
|
||||
/// The encrypted puuid of this participant
|
||||
#[serde(rename = "puuid")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub puuid: Option<String>,
|
||||
/// The ID of the first summoner spell used by this participant
|
||||
#[serde(rename = "spell1Id")]
|
||||
pub spell1_id: i64,
|
||||
/// The ID of the second summoner spell used by this participant
|
||||
#[serde(rename = "spell2Id")]
|
||||
pub spell2_id: i64,
|
||||
/// List of Game Customizations
|
||||
#[serde(rename = "gameCustomizationObjects")]
|
||||
pub game_customization_objects: std::vec::Vec<GameCustomizationObject>,
|
||||
#[serde(rename = "riotId")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub riot_id: Option<String>,
|
||||
}
|
||||
/// Perks data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct Perks {
|
||||
/// IDs of the perks/runes assigned.
|
||||
#[serde(rename = "perkIds")]
|
||||
pub perk_ids: std::vec::Vec<i64>,
|
||||
/// Primary runes path
|
||||
#[serde(rename = "perkStyle")]
|
||||
pub perk_style: i64,
|
||||
/// Secondary runes path
|
||||
#[serde(rename = "perkSubStyle")]
|
||||
pub perk_sub_style: i64,
|
||||
}
|
||||
/// GameCustomizationObject data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct GameCustomizationObject {
|
||||
/// Category identifier for Game Customization
|
||||
#[serde(rename = "category")]
|
||||
pub category: String,
|
||||
/// Game Customization content
|
||||
#[serde(rename = "content")]
|
||||
pub content: String,
|
||||
}
|
||||
/// FeaturedGames data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct FeaturedGames {
|
||||
/// The list of featured games
|
||||
#[serde(rename = "gameList")]
|
||||
pub game_list: std::vec::Vec<FeaturedGameInfo>,
|
||||
/// The suggested interval to wait before requesting FeaturedGames again
|
||||
#[serde(rename = "clientRefreshInterval")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub client_refresh_interval: Option<i64>,
|
||||
}
|
||||
/// FeaturedGameInfo data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct FeaturedGameInfo {
|
||||
/// The game mode<br>
|
||||
/// (Legal values: TFT)
|
||||
#[serde(rename = "gameMode")]
|
||||
pub game_mode: crate::consts::GameMode,
|
||||
/// The amount of time in seconds that has passed since the game started
|
||||
#[serde(rename = "gameLength")]
|
||||
pub game_length: i64,
|
||||
/// The ID of the map
|
||||
#[serde(rename = "mapId")]
|
||||
pub map_id: crate::consts::Map,
|
||||
/// The game type<br>
|
||||
/// (Legal values: MATCHED)
|
||||
#[serde(rename = "gameType")]
|
||||
pub game_type: crate::consts::GameType,
|
||||
/// Banned champion information
|
||||
#[serde(rename = "bannedChampions")]
|
||||
pub banned_champions: std::vec::Vec<BannedChampion>,
|
||||
/// The ID of the game
|
||||
#[serde(rename = "gameId")]
|
||||
pub game_id: i64,
|
||||
/// The observer information
|
||||
#[serde(rename = "observers")]
|
||||
pub observers: Observer,
|
||||
/// The queue type (queue types are documented on the Game Constants page)
|
||||
#[serde(rename = "gameQueueConfigId")]
|
||||
pub game_queue_config_id: crate::consts::Queue,
|
||||
/// The participant information
|
||||
#[serde(rename = "participants")]
|
||||
pub participants: std::vec::Vec<Participant>,
|
||||
/// The ID of the platform on which the game is being played
|
||||
#[serde(rename = "platformId")]
|
||||
pub platform_id: String,
|
||||
}
|
||||
/// Participant data object.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
|
||||
pub struct Participant {
|
||||
/// Flag indicating whether or not this participant is a bot
|
||||
#[serde(rename = "bot")]
|
||||
pub bot: bool,
|
||||
/// The ID of the second summoner spell used by this participant
|
||||
#[serde(rename = "spell2Id")]
|
||||
pub spell2_id: i64,
|
||||
/// The ID of the profile icon used by this participant
|
||||
#[serde(rename = "profileIconId")]
|
||||
pub profile_icon_id: i64,
|
||||
/// The summoner name of this participant
|
||||
#[serde(rename = "summonerName")]
|
||||
pub summoner_name: String,
|
||||
/// Encrypted summoner ID of this participant
|
||||
#[serde(rename = "summonerId")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub summoner_id: Option<String>,
|
||||
/// Encrypted puuid of this participant
|
||||
#[serde(rename = "puuid")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub puuid: Option<String>,
|
||||
/// The ID of the champion played by this participant
|
||||
#[serde(rename = "championId")]
|
||||
pub champion_id: crate::consts::Champion,
|
||||
/// The team ID of this participant, indicating the participant's team
|
||||
#[serde(rename = "teamId")]
|
||||
pub team_id: crate::consts::Team,
|
||||
/// The ID of the first summoner spell used by this participant
|
||||
#[serde(rename = "spell1Id")]
|
||||
pub spell1_id: i64,
|
||||
#[serde(rename = "riotId")]
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub riot_id: Option<String>,
|
||||
}
|
||||
}
|
||||
|
||||
/// Data structs used by [`SpectatorV4`](crate::endpoints::SpectatorV4).
|
||||
///
|
||||
/// Note: this module is automatically generated.
|
||||
|
|
Loading…
Reference in a new issue