mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-25 18:36:31 +00:00
Release 1.15.0
Regen for match-v5 updates and enums.
This commit is contained in:
parent
a55d7769d2
commit
e50c509f17
5 changed files with 24 additions and 20 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "riven"
|
||||
version = "1.14.0"
|
||||
version = "1.15.0"
|
||||
authors = ["Mingwei Samuel <mingwei.samuel@gmail.com>"]
|
||||
repository = "https://github.com/MingweiSamuel/Riven"
|
||||
description = "Riot Games API Library"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version f4a77c89fedf1b9e2d8ff0897e2779ef549aaccf
|
||||
// Version 1f61128ea79f3d07bd47c2f585e9f22905bed753
|
||||
|
||||
//! Automatically generated endpoint handles.
|
||||
|
||||
|
@ -813,13 +813,13 @@ impl<'a> MatchV5<'a> {
|
|||
/// <a href="https://developer.riotgames.com/api-methods/#match-v5/GET_getMatchIdsByPUUID" target="_blank">`match-v5.getMatchIdsByPUUID`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_match_ids_by_puuid(&self, region: Region, puuid: &str, count: Option<i32>, end_time: Option<i64>, queue: Option<i32>, start_time: Option<i64>, start: Option<i32>, r#type: Option<&str>)
|
||||
pub fn get_match_ids_by_puuid(&self, region: Region, puuid: &str, count: Option<i32>, end_time: Option<i64>, queue: Option<crate::consts::Queue>, start_time: Option<i64>, start: Option<i32>, r#type: Option<&str>)
|
||||
-> impl Future<Output = Result<Vec<String>>> + 'a
|
||||
{
|
||||
let mut query_params = Serializer::new(String::new());
|
||||
if let Some(count) = count { query_params.append_pair("count", &*count.to_string()); };
|
||||
if let Some(end_time) = end_time { query_params.append_pair("endTime", &*end_time.to_string()); };
|
||||
if let Some(queue) = queue { query_params.append_pair("queue", &*queue.to_string()); };
|
||||
if let Some(queue) = queue { query_params.append_pair("queue", &*Into::<u16>::into(queue).to_string()); };
|
||||
if let Some(start_time) = start_time { query_params.append_pair("startTime", &*start_time.to_string()); };
|
||||
if let Some(start) = start { query_params.append_pair("start", &*start.to_string()); };
|
||||
if let Some(r#type) = r#type { query_params.append_pair("type", r#type); };
|
||||
|
@ -1019,7 +1019,7 @@ impl<'a> TftLeagueV1<'a> {
|
|||
/// <a href="https://developer.riotgames.com/api-methods/#tft-league-v1/GET_getLeagueEntries" target="_blank">`tft-league-v1.getLeagueEntries`</a>
|
||||
///
|
||||
/// Note: this method is automatically generated.
|
||||
pub fn get_league_entries(&self, region: Region, tier: &str, division: &str, page: Option<i32>)
|
||||
pub fn get_league_entries(&self, region: Region, tier: crate::consts::Tier, division: &str, page: Option<i32>)
|
||||
-> impl Future<Output = Result<Vec<tft_league_v1::LeagueEntry>>> + 'a
|
||||
{
|
||||
let mut query_params = Serializer::new(String::new());
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version f4a77c89fedf1b9e2d8ff0897e2779ef549aaccf
|
||||
// Version 1f61128ea79f3d07bd47c2f585e9f22905bed753
|
||||
|
||||
//! Metadata about the Riot API and Riven.
|
||||
//!
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
///////////////////////////////////////////////
|
||||
|
||||
// http://www.mingweisamuel.com/riotapi-schema/tool/
|
||||
// Version f4a77c89fedf1b9e2d8ff0897e2779ef549aaccf
|
||||
// Version 1f61128ea79f3d07bd47c2f585e9f22905bed753
|
||||
|
||||
//! Data transfer structs.
|
||||
//!
|
||||
|
@ -752,30 +752,33 @@ pub mod match_v5 {
|
|||
#[derive(Debug)]
|
||||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
pub struct Info {
|
||||
/// Unix timestamp for when the game is created (i.e., the loading screen).
|
||||
/// Unix timestamp for when the game is created on the game server (i.e., the loading screen).
|
||||
#[serde(rename = "gameCreation")]
|
||||
pub game_creation: i64,
|
||||
/// Game length in milliseconds.
|
||||
/// Prior to patch 11.20, this field returns the game length in milliseconds calculated from gameEndTimestamp - gameStartTimestamp. Post patch 11.20, this field returns the max timePlayed of any participant in the game in seconds, which makes the behavior of this field consistent with that of match-v4. The best way to handling the change in this field is to treat the value as milliseconds if the gameEndTimestamp field isn't in the response and to treat the value as seconds if gameEndTimestamp is in the response.
|
||||
#[serde(rename = "gameDuration")]
|
||||
pub game_duration: i64,
|
||||
/// Unix timestamp for when match ends on the game server. This timestamp can occasionally be significantly longer than when the match "ends". The most reliable way of determining the timestamp for the end of the match would be to add the max time played of any participant to the gameStartTimestamp. This field was added to match-v5 in patch 11.20 on Oct 5th, 2021.
|
||||
#[serde(rename = "gameEndTimestamp")]
|
||||
pub game_end_timestamp: Option<i64>,
|
||||
#[serde(rename = "gameId")]
|
||||
pub game_id: i64,
|
||||
/// Refer to the Game Constants documentation.
|
||||
#[serde(rename = "gameMode")]
|
||||
pub game_mode: String,
|
||||
pub game_mode: crate::consts::GameMode,
|
||||
#[serde(rename = "gameName")]
|
||||
pub game_name: String,
|
||||
/// Unix timestamp for when match actually starts.
|
||||
/// Unix timestamp for when match starts on the game server.
|
||||
#[serde(rename = "gameStartTimestamp")]
|
||||
pub game_start_timestamp: i64,
|
||||
#[serde(rename = "gameType")]
|
||||
pub game_type: String,
|
||||
pub game_type: crate::consts::GameType,
|
||||
/// The first two parts can be used to determine the patch a game was played on.
|
||||
#[serde(rename = "gameVersion")]
|
||||
pub game_version: String,
|
||||
/// Refer to the Game Constants documentation.
|
||||
#[serde(rename = "mapId")]
|
||||
pub map_id: i32,
|
||||
pub map_id: crate::consts::Map,
|
||||
#[serde(rename = "participants")]
|
||||
pub participants: std::vec::Vec<Participant>,
|
||||
/// Platform where the match was played.
|
||||
|
@ -783,7 +786,7 @@ pub mod match_v5 {
|
|||
pub platform_id: String,
|
||||
/// Refer to the Game Constants documentation.
|
||||
#[serde(rename = "queueId")]
|
||||
pub queue_id: i32,
|
||||
pub queue_id: crate::consts::Queue,
|
||||
#[serde(rename = "teams")]
|
||||
pub teams: std::vec::Vec<Team>,
|
||||
/// Tournament code used to generate the match.
|
||||
|
@ -804,8 +807,9 @@ pub mod match_v5 {
|
|||
pub champ_experience: i32,
|
||||
#[serde(rename = "champLevel")]
|
||||
pub champ_level: i32,
|
||||
/// Prior to patch 11.4, on Feb 9th, 2021, this field returned invalid championIds. We recommend determining the champion based on the championName field.
|
||||
#[serde(rename = "championId")]
|
||||
pub champion_id: i32,
|
||||
pub champion_id: crate::consts::Champion,
|
||||
#[serde(rename = "championName")]
|
||||
pub champion_name: String,
|
||||
/// This field is currently only utilized for Kayn's transformations. (Legal values: 0 - None, 1 - Slayer, 2 - Assassin)
|
||||
|
@ -953,7 +957,7 @@ pub mod match_v5 {
|
|||
#[serde(rename = "teamEarlySurrendered")]
|
||||
pub team_early_surrendered: bool,
|
||||
#[serde(rename = "teamId")]
|
||||
pub team_id: i32,
|
||||
pub team_id: crate::consts::Team,
|
||||
/// Both individualPosition and teamPosition are computed by the game server and are different versions of the most likely position played by a player. The individualPosition is the best guess for which position the player actually played in isolation of anything else. The teamPosition is the best guess for which position the player actually played if we add the constraint that each team must have one top player, one jungle, one middle, etc. Generally the recommendation is to use the teamPosition field over the individualPosition field.
|
||||
#[serde(rename = "teamPosition")]
|
||||
pub team_position: String,
|
||||
|
@ -1061,7 +1065,7 @@ pub mod match_v5 {
|
|||
#[serde(rename = "objectives")]
|
||||
pub objectives: Objectives,
|
||||
#[serde(rename = "teamId")]
|
||||
pub team_id: i32,
|
||||
pub team_id: crate::consts::Team,
|
||||
#[serde(rename = "win")]
|
||||
pub win: bool,
|
||||
}
|
||||
|
@ -1070,7 +1074,7 @@ pub mod match_v5 {
|
|||
#[derive(serde::Serialize, serde::Deserialize)]
|
||||
pub struct Ban {
|
||||
#[serde(rename = "championId")]
|
||||
pub champion_id: i32,
|
||||
pub champion_id: crate::consts::Champion,
|
||||
#[serde(rename = "pickTurn")]
|
||||
pub pick_turn: i32,
|
||||
}
|
||||
|
|
|
@ -114,8 +114,8 @@ function formatQueryParamStringify(name, prop, useOwned = false) {
|
|||
if (prop['x-enum']) {
|
||||
switch (prop.type) {
|
||||
case 'integer':
|
||||
return `${own}Into::<${enumTypeLookup[prop['x-enum']]}>::into(*${name}).to_string()`;
|
||||
default: throw new Error(`Enum not supported: ${JSON.stringify(prop)}.`)
|
||||
return `${own}Into::<${enumTypeLookup[prop['x-enum']]}>::into(${name}).to_string()`;
|
||||
default: // Fall-through.
|
||||
}
|
||||
}
|
||||
switch (prop.type) {
|
||||
|
|
Loading…
Reference in a new issue