// This file is automatically generated. // Do not directly edit. // Generated on 2019-10-20T06:19:43.832Z // http://www.mingweisamuel.com/riotapi-schema/tool/ // Version 0c74167e0eaaeb6de1c7e8219fecaabcf8386d1f use std::vec::Vec; use reqwest; use url::form_urlencoded::Serializer; use crate::consts::Region; use crate::riot_api::RiotApi; // ChampionMasteryV4 impl<'a> RiotApi<'a> { /// Get all champion mastery entries sorted by number of champion points descending, /// # Official API Reference /// https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getAllChampionMasteries /// # Parameters /// * `region` - Region to query. /// * `encryptedSummonerId` - Summoner ID associated with the player pub async fn champion_mastery_v4_get_all_champion_masteries(&'a self, region: Region, encrypted_summoner_id: &str) -> Result>, reqwest::Error> { let path_string = format!("/lol/champion-mastery/v4/champion-masteries/by-summoner/{}", encrypted_summoner_id); return self.requester_manager.get::>( "champion-mastery-v4.getAllChampionMasteries", region, &*path_string, None).await; // false); } /// Get a champion mastery by player ID and champion ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getChampionMastery /// # Parameters /// * `region` - Region to query. /// * `championId` - Champion ID to retrieve Champion Mastery for /// * `encryptedSummonerId` - Summoner ID associated with the player pub async fn champion_mastery_v4_get_champion_mastery(&'a self, region: Region, encrypted_summoner_id: &str, champion_id: i64) -> Result, reqwest::Error> { let path_string = format!("/lol/champion-mastery/v4/champion-masteries/by-summoner/{}/by-champion/{}", encrypted_summoner_id, champion_id); return self.requester_manager.get::( "champion-mastery-v4.getChampionMastery", region, &*path_string, None).await; // false); } /// Get a player's total champion mastery score, which is the sum of individual champion mastery levels. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#champion-mastery-v4/GET_getChampionMasteryScore /// # Parameters /// * `region` - Region to query. /// * `encryptedSummonerId` - Summoner ID associated with the player pub async fn champion_mastery_v4_get_champion_mastery_score(&'a self, region: Region, encrypted_summoner_id: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/champion-mastery/v4/scores/by-summoner/{}", encrypted_summoner_id); return self.requester_manager.get::( "champion-mastery-v4.getChampionMasteryScore", region, &*path_string, None).await; // false); } } // ChampionV3 impl<'a> RiotApi<'a> { /// Returns champion rotations, including free-to-play and low-level free-to-play rotations (REST) /// # Official API Reference /// https://developer.riotgames.com/api-methods/#champion-v3/GET_getChampionInfo /// # Parameters /// * `region` - Region to query. pub async fn champion_v3_get_champion_info(&'a self, region: Region) -> Result, reqwest::Error> { let path_string = "/lol/platform/v3/champion-rotations"; return self.requester_manager.get::( "champion-v3.getChampionInfo", region, &*path_string, None).await; // false); } } // LeagueExpV4 impl<'a> RiotApi<'a> { /// Get all the league entries. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-exp-v4/GET_getLeagueEntries /// # Parameters /// * `region` - Region to query. /// * `queue` - Note that the queue value must be a valid ranked queue. /// * `tier` /// * `division` /// * `page` (optional) - Starts with page 1. pub async fn league_exp_v4_get_league_entries(&'a self, region: Region, division: &str, tier: &str, queue: &str, page: Option) -> Result>, reqwest::Error> { let mut query_params = Serializer::new(String::new()); if let Some(page) = page { query_params.append_pair("page", &*page.to_string()); }; let query_string = query_params.finish(); let path_string = format!("/lol/league-exp/v4/entries/{}/{}/{}", division, tier, queue); return self.requester_manager.get::>( "league-exp-v4.getLeagueEntries", region, &*path_string, Some(&*query_string)).await; // false); } } // LeagueV4 impl<'a> RiotApi<'a> { /// Get the challenger league for given queue. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-v4/GET_getChallengerLeague /// # Parameters /// * `region` - Region to query. /// * `queue` pub async fn league_v4_get_challenger_league(&'a self, region: Region, queue: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/league/v4/challengerleagues/by-queue/{}", queue); return self.requester_manager.get::( "league-v4.getChallengerLeague", region, &*path_string, None).await; // false); } /// Get league entries in all queues for a given summoner ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-v4/GET_getLeagueEntriesForSummoner /// # Parameters /// * `region` - Region to query. /// * `encryptedSummonerId` pub async fn league_v4_get_league_entries_for_summoner(&'a self, region: Region, encrypted_summoner_id: &str) -> Result>, reqwest::Error> { let path_string = format!("/lol/league/v4/entries/by-summoner/{}", encrypted_summoner_id); return self.requester_manager.get::>( "league-v4.getLeagueEntriesForSummoner", region, &*path_string, None).await; // false); } /// Get all the league entries. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-v4/GET_getLeagueEntries /// # Parameters /// * `region` - Region to query. /// * `division` /// * `tier` /// * `queue` - Note that the queue value must be a valid ranked queue. /// * `page` (optional) - Starts with page 1. pub async fn league_v4_get_league_entries(&'a self, region: Region, queue: &str, tier: &str, division: &str, page: Option) -> Result>, reqwest::Error> { let mut query_params = Serializer::new(String::new()); if let Some(page) = page { query_params.append_pair("page", &*page.to_string()); }; let query_string = query_params.finish(); let path_string = format!("/lol/league/v4/entries/{}/{}/{}", queue, tier, division); return self.requester_manager.get::>( "league-v4.getLeagueEntries", region, &*path_string, Some(&*query_string)).await; // false); } /// Get the grandmaster league of a specific queue. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-v4/GET_getGrandmasterLeague /// # Parameters /// * `region` - Region to query. /// * `queue` pub async fn league_v4_get_grandmaster_league(&'a self, region: Region, queue: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/league/v4/grandmasterleagues/by-queue/{}", queue); return self.requester_manager.get::( "league-v4.getGrandmasterLeague", region, &*path_string, None).await; // false); } /// Get league with given ID, including inactive entries. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-v4/GET_getLeagueById /// # Parameters /// * `region` - Region to query. /// * `leagueId` - The UUID of the league. pub async fn league_v4_get_league_by_id(&'a self, region: Region, league_id: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/league/v4/leagues/{}", league_id); return self.requester_manager.get::( "league-v4.getLeagueById", region, &*path_string, None).await; // false); } /// Get the master league for given queue. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#league-v4/GET_getMasterLeague /// # Parameters /// * `region` - Region to query. /// * `queue` pub async fn league_v4_get_master_league(&'a self, region: Region, queue: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/league/v4/masterleagues/by-queue/{}", queue); return self.requester_manager.get::( "league-v4.getMasterLeague", region, &*path_string, None).await; // false); } } // LolStatusV3 impl<'a> RiotApi<'a> { /// Get League of Legends status for the given shard. /// ## Rate Limit Notes /// Requests to this API are not counted against the application Rate Limits. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#lol-status-v3/GET_getShardData /// # Parameters /// * `region` - Region to query. pub async fn lol_status_v3_get_shard_data(&'a self, region: Region) -> Result, reqwest::Error> { let path_string = "/lol/status/v3/shard-data"; return self.requester_manager.get::( "lol-status-v3.getShardData", region, &*path_string, None).await; // true); } } // MatchV4 impl<'a> RiotApi<'a> { /// Get match IDs by tournament code. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchIdsByTournamentCode /// # Parameters /// * `region` - Region to query. /// * `tournamentCode` - The tournament code. pub async fn match_v4_get_match_ids_by_tournament_code(&'a self, region: Region, tournament_code: &str) -> Result>, reqwest::Error> { let path_string = format!("/lol/match/v4/matches/by-tournament-code/{}/ids", tournament_code); return self.requester_manager.get::>( "match-v4.getMatchIdsByTournamentCode", region, &*path_string, None).await; // false); } /// Get match by match ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#match-v4/GET_getMatch /// # Parameters /// * `region` - Region to query. /// * `matchId` - The match ID. pub async fn match_v4_get_match(&'a self, region: Region, match_id: i64) -> Result, reqwest::Error> { let path_string = format!("/lol/match/v4/matches/{}", match_id); return self.requester_manager.get::( "match-v4.getMatch", region, &*path_string, None).await; // false); } /// Get match by match ID and tournament code. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchByTournamentCode /// # Parameters /// * `region` - Region to query. /// * `tournamentCode` - The tournament code. /// * `matchId` - The match ID. pub async fn match_v4_get_match_by_tournament_code(&'a self, region: Region, match_id: i64, tournament_code: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/match/v4/matches/{}/by-tournament-code/{}", match_id, tournament_code); return self.requester_manager.get::( "match-v4.getMatchByTournamentCode", region, &*path_string, None).await; // false); } /// Get matchlist for games played on given account ID and platform ID and filtered using given filter parameters, if any. /// ## Implementation Notes /// A number of optional parameters are provided for filtering. It is up to the caller to ensure that the combination of filter parameters provided is valid for the requested account, otherwise, no matches may be returned. /// /// If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned. /// /// If beginTime is specified, but not endTime, then endTime defaults to the the current unix timestamp in milliseconds (the maximum time range limitation is not observed in this specific case). If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history returning a 400 due to the maximum time range limitation. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchlist /// # Parameters /// * `region` - Region to query. /// * `encryptedAccountId` - The account ID. /// * `champion` (optional) - Set of champion IDs for filtering the matchlist. /// * `queue` (optional) - Set of queue IDs for filtering the matchlist. /// * `season` (optional) - Set of season IDs for filtering the matchlist. /// * `endTime` (optional) - The end time to use for filtering matchlist specified as epoch milliseconds. If beginTime is specified, but not endTime, then endTime defaults to the the current unix timestamp in milliseconds (the maximum time range limitation is not observed in this specific case). If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history returning a 400 due to the maximum time range limitation. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned. /// * `beginTime` (optional) - The begin time to use for filtering matchlist specified as epoch milliseconds. If beginTime is specified, but not endTime, then endTime defaults to the the current unix timestamp in milliseconds (the maximum time range limitation is not observed in this specific case). If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history returning a 400 due to the maximum time range limitation. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned. /// * `endIndex` (optional) - The end index to use for filtering matchlist. If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned. /// * `beginIndex` (optional) - The begin index to use for filtering matchlist. If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned. pub async fn match_v4_get_matchlist(&'a self, region: Region, encrypted_account_id: &str, champion: Option>, queue: Option>, season: Option>, end_time: Option, begin_time: Option, end_index: Option, begin_index: Option) -> Result, reqwest::Error> { let mut query_params = Serializer::new(String::new()); if let Some(champion) = champion { query_params.extend_pairs(champion.iter().map(|w| ("champion", w.to_string()))); }; if let Some(queue) = queue { query_params.extend_pairs(queue.iter().map(|w| ("queue", w.to_string()))); }; if let Some(season) = season { query_params.extend_pairs(season.iter().map(|w| ("season", w.to_string()))); }; if let Some(end_time) = end_time { query_params.append_pair("endTime", &*end_time.to_string()); }; if let Some(begin_time) = begin_time { query_params.append_pair("beginTime", &*begin_time.to_string()); }; if let Some(end_index) = end_index { query_params.append_pair("endIndex", &*end_index.to_string()); }; if let Some(begin_index) = begin_index { query_params.append_pair("beginIndex", &*begin_index.to_string()); }; let query_string = query_params.finish(); let path_string = format!("/lol/match/v4/matchlists/by-account/{}", encrypted_account_id); return self.requester_manager.get::( "match-v4.getMatchlist", region, &*path_string, Some(&*query_string)).await; // false); } /// Get match timeline by match ID. /// ## Implementation Notes /// Not all matches have timeline data. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchTimeline /// # Parameters /// * `region` - Region to query. /// * `matchId` - The match ID. pub async fn match_v4_get_match_timeline(&'a self, region: Region, match_id: i64) -> Result, reqwest::Error> { let path_string = format!("/lol/match/v4/timelines/by-match/{}", match_id); return self.requester_manager.get::( "match-v4.getMatchTimeline", region, &*path_string, None).await; // false); } } // SpectatorV4 impl<'a> RiotApi<'a> { /// Get current game information for the given summoner ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#spectator-v4/GET_getCurrentGameInfoBySummoner /// # Parameters /// * `region` - Region to query. /// * `encryptedSummonerId` - The ID of the summoner. pub async fn spectator_v4_get_current_game_info_by_summoner(&'a self, region: Region, encrypted_summoner_id: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/spectator/v4/active-games/by-summoner/{}", encrypted_summoner_id); return self.requester_manager.get::( "spectator-v4.getCurrentGameInfoBySummoner", region, &*path_string, None).await; // false); } /// Get list of featured games. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#spectator-v4/GET_getFeaturedGames /// # Parameters /// * `region` - Region to query. pub async fn spectator_v4_get_featured_games(&'a self, region: Region) -> Result, reqwest::Error> { let path_string = "/lol/spectator/v4/featured-games"; return self.requester_manager.get::( "spectator-v4.getFeaturedGames", region, &*path_string, None).await; // false); } } // SummonerV4 impl<'a> RiotApi<'a> { /// Get a summoner by account ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#summoner-v4/GET_getByAccountId /// # Parameters /// * `region` - Region to query. /// * `encryptedAccountId` pub async fn summoner_v4_get_by_account_id(&'a self, region: Region, encrypted_account_id: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/summoner/v4/summoners/by-account/{}", encrypted_account_id); return self.requester_manager.get::( "summoner-v4.getByAccountId", region, &*path_string, None).await; // false); } /// Get a summoner by summoner name. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#summoner-v4/GET_getBySummonerName /// # Parameters /// * `region` - Region to query. /// * `summonerName` - Summoner Name pub async fn summoner_v4_get_by_summoner_name(&'a self, region: Region, summoner_name: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/summoner/v4/summoners/by-name/{}", summoner_name); return self.requester_manager.get::( "summoner-v4.getBySummonerName", region, &*path_string, None).await; // false); } /// Get a summoner by PUUID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#summoner-v4/GET_getByPUUID /// # Parameters /// * `region` - Region to query. /// * `encryptedPUUID` - Summoner ID pub async fn summoner_v4_get_by_puuid(&'a self, region: Region, encrypted_puuid: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/summoner/v4/summoners/by-puuid/{}", encrypted_puuid); return self.requester_manager.get::( "summoner-v4.getByPUUID", region, &*path_string, None).await; // false); } /// Get a summoner by summoner ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#summoner-v4/GET_getBySummonerId /// # Parameters /// * `region` - Region to query. /// * `encryptedSummonerId` - Summoner ID pub async fn summoner_v4_get_by_summoner_id(&'a self, region: Region, encrypted_summoner_id: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/summoner/v4/summoners/{}", encrypted_summoner_id); return self.requester_manager.get::( "summoner-v4.getBySummonerId", region, &*path_string, None).await; // false); } } // ThirdPartyCodeV4 impl<'a> RiotApi<'a> { /// Get third party code for a given summoner ID. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#third-party-code-v4/GET_getThirdPartyCodeBySummonerId /// # Parameters /// * `region` - Region to query. /// * `encryptedSummonerId` pub async fn third_party_code_v4_get_third_party_code_by_summoner_id(&'a self, region: Region, encrypted_summoner_id: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/platform/v4/third-party-code/by-summoner/{}", encrypted_summoner_id); return self.requester_manager.get::( "third-party-code-v4.getThirdPartyCodeBySummonerId", region, &*path_string, None).await; // false); } } // TournamentStubV4 impl<'a> RiotApi<'a> { /// Gets a mock list of lobby events by tournament code. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#tournament-stub-v4/GET_getLobbyEventsByCode /// # Parameters /// * `region` - Region to query. /// * `tournamentCode` - The short code to look up lobby events for pub async fn tournament_stub_v4_get_lobby_events_by_code(&'a self, region: Region, tournament_code: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/tournament-stub/v4/lobby-events/by-code/{}", tournament_code); return self.requester_manager.get::( "tournament-stub-v4.getLobbyEventsByCode", region, &*path_string, None).await; // false); } } // TournamentV4 impl<'a> RiotApi<'a> { /// Returns the tournament code DTO associated with a tournament code string. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#tournament-v4/GET_getTournamentCode /// # Parameters /// * `region` - Region to query. /// * `tournamentCode` - The tournament code string. pub async fn tournament_v4_get_tournament_code(&'a self, region: Region, tournament_code: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/tournament/v4/codes/{}", tournament_code); return self.requester_manager.get::( "tournament-v4.getTournamentCode", region, &*path_string, None).await; // false); } /// Gets a list of lobby events by tournament code. /// # Official API Reference /// https://developer.riotgames.com/api-methods/#tournament-v4/GET_getLobbyEventsByCode /// # Parameters /// * `region` - Region to query. /// * `tournamentCode` - The short code to look up lobby events for pub async fn tournament_v4_get_lobby_events_by_code(&'a self, region: Region, tournament_code: &str) -> Result, reqwest::Error> { let path_string = format!("/lol/tournament/v4/lobby-events/by-code/{}", tournament_code); return self.requester_manager.get::( "tournament-v4.getLobbyEventsByCode", region, &*path_string, None).await; // false); } }