From 3f00aa9d668dcd57d0113ab75957c7ceded19e5b Mon Sep 17 00:00:00 2001 From: Mingwei Samuel Date: Fri, 23 Oct 2020 18:21:30 -0700 Subject: [PATCH] Regen for Seraphine and lor-match-v1 --- src/consts/champion.rs | 3 ++ src/endpoints.rs | 52 +++++++++++++++++++++++++++- src/meta.rs | 4 ++- src/models.rs | 77 +++++++++++++++++++++++++++++++++++++++--- 4 files changed, 130 insertions(+), 6 deletions(-) diff --git a/src/consts/champion.rs b/src/consts/champion.rs index a9682f3..6911480 100644 --- a/src/consts/champion.rs +++ b/src/consts/champion.rs @@ -232,6 +232,8 @@ pub enum Champion { #[strum(to_string="Sejuani", serialize="Sejuani")] Sejuani = 113, /// Senna (`Senna`, 235). #[strum(to_string="Senna", serialize="Senna")] Senna = 235, + /// Seraphine (`Seraphine`, 147). + #[strum(to_string="Seraphine", serialize="Seraphine")] Seraphine = 147, /// Sett (`Sett`, 875). #[strum(to_string="Sett", serialize="Sett")] Sett = 875, /// Shaco (`Shaco`, 35). @@ -460,6 +462,7 @@ impl Champion { Self::Samira => "Samira", Self::Sejuani => "Sejuani", Self::Senna => "Senna", + Self::Seraphine => "Seraphine", Self::Sett => "Sett", Self::Shaco => "Shaco", Self::Shen => "Shen", diff --git a/src/endpoints.rs b/src/endpoints.rs index c5becbf..7e7dea2 100644 --- a/src/endpoints.rs +++ b/src/endpoints.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version c3b3f5733c36c6f30546aa9ed598c05d39c670be +// Version 5aeaf3fd13c4a91f0fc65318334dd1247b8376cd //! Automatically generated endpoint handles. @@ -86,6 +86,15 @@ impl RiotApi { pub fn lol_status_v3(&self) -> LolStatusV3 { LolStatusV3 { base: self } } + /// Returns a handle for accessing [LorMatchV1](crate::endpoints::LorMatchV1) endpoints. + /// # Riot Developer API Reference + /// `lor-match-v1` + /// + /// Note: this method is automatically generated. + #[inline] + pub fn lor_match_v1(&self) -> LorMatchV1 { + LorMatchV1 { base: self } + } /// Returns a handle for accessing [LorRankedV1](crate::endpoints::LorRankedV1) endpoints. /// # Riot Developer API Reference /// `lor-ranked-v1` @@ -589,6 +598,47 @@ impl<'a> LolStatusV3<'a> { } +/// LorMatchV1 endpoints handle, accessed by calling [`lor_match_v1()`](crate::RiotApi::lor_match_v1) on a [`RiotApi`](crate::RiotApi) instance. +/// # Riot Developer API Reference +/// `lor-match-v1` +/// +/// Note: this struct is automatically generated. +pub struct LorMatchV1<'a> { + base: &'a RiotApi, +} +impl<'a> LorMatchV1<'a> { + /// Get a list of match ids by PUUID + /// # Parameters + /// * `region` - Region to query. + /// * `puuid` + /// # Riot Developer API Reference + /// `lor-match-v1.getMatchIdsByPUUID` + /// + /// Note: this method is automatically generated. + pub fn get_match_ids_by_puuid(&self, region: Region, puuid: &str) + -> impl Future>> + 'a + { + let path_string = format!("/lor/match/v1/matches/by-puuid/{}/ids", puuid); + self.base.get::>("lor-match-v1.getMatchIdsByPUUID", region.into(), path_string, None) + } + + /// Get match by id + /// # Parameters + /// * `region` - Region to query. + /// * `matchId` + /// # Riot Developer API Reference + /// `lor-match-v1.getMatch` + /// + /// Note: this method is automatically generated. + pub fn get_match(&self, region: Region, match_id: &str) + -> impl Future> + 'a + { + let path_string = format!("/lor/match/v1/matches/{}", match_id); + self.base.get::("lor-match-v1.getMatch", region.into(), path_string, None) + } + +} + /// LorRankedV1 endpoints handle, accessed by calling [`lor_ranked_v1()`](crate::RiotApi::lor_ranked_v1) on a [`RiotApi`](crate::RiotApi) instance. /// # Riot Developer API Reference /// `lor-ranked-v1` diff --git a/src/meta.rs b/src/meta.rs index b9bffb3..f4be771 100644 --- a/src/meta.rs +++ b/src/meta.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version c3b3f5733c36c6f30546aa9ed598c05d39c670be +// Version 5aeaf3fd13c4a91f0fc65318334dd1247b8376cd //! Metadata about the Riot API and Riven. //! @@ -40,6 +40,8 @@ lazy_static! { map.insert("/lol/league/v4/leagues/{leagueId}", "league-v4.getLeagueById"); map.insert("/lol/league/v4/masterleagues/by-queue/{queue}", "league-v4.getMasterLeague"); map.insert("/lol/status/v3/shard-data", "lol-status-v3.getShardData"); + map.insert("/lor/match/v1/matches/by-puuid/{puuid}/ids", "lor-match-v1.getMatchIdsByPUUID"); + map.insert("/lor/match/v1/matches/{matchId}", "lor-match-v1.getMatch"); map.insert("/lor/ranked/v1/leaderboards", "lor-ranked-v1.getLeaderboards"); map.insert("/lol/match/v4/matches/by-tournament-code/{tournamentCode}/ids", "match-v4.getMatchIdsByTournamentCode"); map.insert("/lol/match/v4/matches/{matchId}", "match-v4.getMatch"); diff --git a/src/models.rs b/src/models.rs index 61334b0..29a58f4 100644 --- a/src/models.rs +++ b/src/models.rs @@ -7,7 +7,7 @@ /////////////////////////////////////////////// // http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version c3b3f5733c36c6f30546aa9ed598c05d39c670be +// Version 5aeaf3fd13c4a91f0fc65318334dd1247b8376cd //! Data transfer structs. //! @@ -421,6 +421,77 @@ pub mod lol_status_v3 { } } +/// Data structs used by [`LorMatchV1`](crate::endpoints::LorMatchV1). +/// +/// Note: this module is automatically generated. +#[allow(dead_code)] +pub mod lor_match_v1 { + /// Match data object. + #[derive(Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + pub struct Match { + /// Match metadata. + #[serde(rename = "metadata")] + pub metadata: Metadata, + /// Match info. + #[serde(rename = "info")] + pub info: Info, + } + /// Metadata data object. + #[derive(Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + pub struct Metadata { + /// Match data version. + #[serde(rename = "data_version")] + pub data_version: String, + /// Match id. + #[serde(rename = "match_id")] + pub match_id: String, + /// A list of encrypted participant PUUIDs. + #[serde(rename = "participants")] + pub participants: std::vec::Vec, + } + /// Info data object. + #[derive(Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + pub struct Info { + /// (Legal values: Constructed, Expeditions, Tutorial) + #[serde(rename = "game_mode")] + pub game_mode: String, + /// (Legal values: Ranked, Normal, AI, Tutorial, VanillaTrial, Singleton, StandardGauntlet) + #[serde(rename = "game_type")] + pub game_type: String, + #[serde(rename = "game_start_time_utc")] + pub game_start_time_utc: String, + #[serde(rename = "game_version")] + pub game_version: String, + #[serde(rename = "players")] + pub players: std::vec::Vec, + /// Total turns taken by both players. + #[serde(rename = "total_turn_count")] + pub total_turn_count: i32, + } + /// Player data object. + #[derive(Debug)] + #[derive(serde::Serialize, serde::Deserialize)] + pub struct Player { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "deck_id")] + pub deck_id: String, + /// Code for the deck played. Refer to LOR documentation for details on deck codes. + #[serde(rename = "deck_code")] + pub deck_code: String, + #[serde(rename = "factions")] + pub factions: std::vec::Vec, + #[serde(rename = "game_outcome")] + pub game_outcome: String, + /// The order in which the players took turns. + #[serde(rename = "order_of_play")] + pub order_of_play: i32, + } +} + /// Data structs used by [`LorRankedV1`](crate::endpoints::LorRankedV1). /// /// Note: this module is automatically generated. @@ -1452,7 +1523,7 @@ pub mod tft_match_v1 { /// Match id. #[serde(rename = "match_id")] pub match_id: String, - /// A list of encrypted participant PUUIDs. + /// A list of participant PUUIDs. #[serde(rename = "participants")] pub participants: std::vec::Vec, } @@ -1472,7 +1543,6 @@ pub mod tft_match_v1 { /// Game client version. #[serde(rename = "game_version")] pub game_version: String, - /// Participants. #[serde(rename = "participants")] pub participants: std::vec::Vec, /// Please refer to the League of Legends documentation. @@ -1504,7 +1574,6 @@ pub mod tft_match_v1 { /// Number of players the participant eliminated. #[serde(rename = "players_eliminated")] pub players_eliminated: i32, - /// Encrypted PUUID. #[serde(rename = "puuid")] pub puuid: String, /// The number of seconds before the participant was eliminated.