Regen, fix issues with tft optional responses/fields

This commit is contained in:
Mingwei Samuel 2020-05-02 12:55:37 -07:00
parent fb0030e754
commit 21579835c0
3 changed files with 25 additions and 18 deletions

View file

@ -7,7 +7,7 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 71bb788ab92c0b03d5dd284402d9514b625fe2a4 // Version e558dafc98b78c830aadeca509f18285e4d11a7a
//! Automatically generated endpoint handles. //! Automatically generated endpoint handles.
@ -261,6 +261,8 @@ pub struct ClashV1<'a> {
} }
impl<'a> ClashV1<'a> { impl<'a> ClashV1<'a> {
/// Get players by summoner ID. /// Get players by summoner ID.
/// ## Implementation Notes
/// This endpoint returns a list of active Clash players for a given summoner ID. 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 /// # Parameters
/// * `region` - Region to query. /// * `region` - Region to query.
/// * `summonerId` /// * `summonerId`
@ -830,10 +832,10 @@ impl<'a> TftLeagueV1<'a> {
/// ///
/// Note: this method is automatically generated. /// Note: this method is automatically generated.
pub fn get_league_by_id(&self, region: Region, league_id: &str) pub fn get_league_by_id(&self, region: Region, league_id: &str)
-> impl Future<Output = Result<tft_league_v1::LeagueList>> + 'a -> impl Future<Output = Result<Option<tft_league_v1::LeagueList>>> + 'a
{ {
let path_string = format!("/tft/league/v1/leagues/{}", league_id); let path_string = format!("/tft/league/v1/leagues/{}", league_id);
self.base.get::<tft_league_v1::LeagueList>("tft-league-v1.getLeagueById", region.into(), path_string, None) self.base.get_optional::<tft_league_v1::LeagueList>("tft-league-v1.getLeagueById", region.into(), path_string, None)
} }
/// Get the master league. /// Get the master league.
@ -889,10 +891,10 @@ impl<'a> TftMatchV1<'a> {
/// ///
/// Note: this method is automatically generated. /// Note: this method is automatically generated.
pub fn get_match(&self, region: Region, match_id: &str) pub fn get_match(&self, region: Region, match_id: &str)
-> impl Future<Output = Result<tft_match_v1::Match>> + 'a -> impl Future<Output = Result<Option<tft_match_v1::Match>>> + 'a
{ {
let path_string = format!("/tft/match/v1/matches/{}", match_id); let path_string = format!("/tft/match/v1/matches/{}", match_id);
self.base.get::<tft_match_v1::Match>("tft-match-v1.getMatch", region.into(), path_string, None) self.base.get_optional::<tft_match_v1::Match>("tft-match-v1.getMatch", region.into(), path_string, None)
} }
} }
@ -930,10 +932,10 @@ impl<'a> TftSummonerV1<'a> {
/// ///
/// Note: this method is automatically generated. /// Note: this method is automatically generated.
pub fn get_by_summoner_name(&self, region: Region, summoner_name: &str) pub fn get_by_summoner_name(&self, region: Region, summoner_name: &str)
-> impl Future<Output = Result<tft_summoner_v1::Summoner>> + 'a -> impl Future<Output = Result<Option<tft_summoner_v1::Summoner>>> + 'a
{ {
let path_string = format!("/tft/summoner/v1/summoners/by-name/{}", summoner_name); let path_string = format!("/tft/summoner/v1/summoners/by-name/{}", summoner_name);
self.base.get::<tft_summoner_v1::Summoner>("tft-summoner-v1.getBySummonerName", region.into(), path_string, None) self.base.get_optional::<tft_summoner_v1::Summoner>("tft-summoner-v1.getBySummonerName", region.into(), path_string, None)
} }
/// Get a summoner by PUUID. /// Get a summoner by PUUID.

View file

@ -7,7 +7,7 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 71bb788ab92c0b03d5dd284402d9514b625fe2a4 // Version e558dafc98b78c830aadeca509f18285e4d11a7a
//! Data transfer structs. //! Data transfer structs.
//! //!
@ -466,7 +466,7 @@ pub mod match_v4 {
pub struct ParticipantIdentity { pub struct ParticipantIdentity {
#[serde(rename = "participantId")] #[serde(rename = "participantId")]
pub participant_id: i32, pub participant_id: i32,
/// Player information. /// Player information not included in the response for custom matches. Custom matches are considered private unless a tournament code was used to create the match.
#[serde(rename = "player")] #[serde(rename = "player")]
pub player: Player, pub player: Player,
} }
@ -1485,7 +1485,7 @@ pub mod tft_match_v1 {
pub tier_current: i32, pub tier_current: i32,
/// Total tiers for the trait. /// Total tiers for the trait.
#[serde(rename = "tier_total")] #[serde(rename = "tier_total")]
pub tier_total: i32, pub tier_total: Option<i32>,
} }
/// Unit data object. /// Unit data object.
#[derive(Debug)] #[derive(Debug)]
@ -1535,25 +1535,25 @@ pub mod tft_summoner_v1 {
pub struct Summoner { pub struct Summoner {
/// ID of the summoner icon associated with the summoner. /// ID of the summoner icon associated with the summoner.
#[serde(rename = "profileIconId")] #[serde(rename = "profileIconId")]
pub profile_icon_id: Option<i32>, pub profile_icon_id: i32,
/// Summoner name. /// Summoner name.
#[serde(rename = "name")] #[serde(rename = "name")]
pub name: Option<String>, pub name: String,
/// Encrypted PUUID. Exact length of 78 characters. /// Encrypted PUUID. Exact length of 78 characters.
#[serde(rename = "puuid")] #[serde(rename = "puuid")]
pub puuid: Option<String>, pub puuid: String,
/// Summoner level associated with the summoner. /// Summoner level associated with the summoner.
#[serde(rename = "summonerLevel")] #[serde(rename = "summonerLevel")]
pub summoner_level: Option<i64>, pub summoner_level: i64,
/// Date summoner was last modified specified as epoch milliseconds. The following events will update this timestamp: profile icon change, playing the tutorial or advanced tutorial, finishing a game, summoner name change /// Date summoner was last modified specified as epoch milliseconds. The following events will update this timestamp: profile icon change, playing the tutorial or advanced tutorial, finishing a game, summoner name change
#[serde(rename = "revisionDate")] #[serde(rename = "revisionDate")]
pub revision_date: Option<i64>, pub revision_date: i64,
/// Encrypted summoner ID. Max length 63 characters. /// Encrypted summoner ID. Max length 63 characters.
#[serde(rename = "id")] #[serde(rename = "id")]
pub id: Option<String>, pub id: String,
/// Encrypted account ID. Max length 56 characters. /// Encrypted account ID. Max length 56 characters.
#[serde(rename = "accountId")] #[serde(rename = "accountId")]
pub account_id: Option<String>, pub account_id: String,
} }
} }

View file

@ -57,7 +57,7 @@ async_tests!{
// Ok(()) // Ok(())
// }, // },
// tftmatchv1_getmatch: async { // tftmatchv1_getmatch: async {
// let p = RIOT_API.tft_match_v1().get_match(Region::AMERICAS, "PBE1_4328907912"); // let p = RIOT_API.tft_match_v1().get_match(Region::EUROPE, "EUW1_4568680990");
// let _m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get TFT match.".to_owned())?; // let _m = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get TFT match.".to_owned())?;
// Ok(()) // Ok(())
// }, // },
@ -66,5 +66,10 @@ async_tests!{
// let _s = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get TFT summoner.".to_owned())?; // let _s = p.await.map_err(|e| e.to_string())?.ok_or("Failed to get TFT summoner.".to_owned())?;
// Ok(()) // Ok(())
// }, // },
// tftsummonerv1_getbyname_none: async {
// let p = RIOT_API.tft_summoner_v1().get_by_summoner_name(Region::EUW, "this summoner does not exist");
// rassert!(p.await.map_err(|e| e.to_string())?.is_none());
// Ok(())
// },
} }
} }