Regen for `tournament-stub-v5` and `val-content-v1.ContentDto.totem`

pull/62/head
Mingwei Samuel 2023-09-21 23:43:22 -07:00
parent daf18c476c
commit 512a7e9020
3 changed files with 273 additions and 4 deletions

View File

@ -7,7 +7,7 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 560d6708a4e0e652fc4b2ada788de0bd6eb546ad // Version e4a5ce3f63911af22ef752e7f5844f4cc4086f0b
//! Automatically generated endpoint handles. //! Automatically generated endpoint handles.
#![allow(clippy::let_and_return, clippy::too_many_arguments)] #![allow(clippy::let_and_return, clippy::too_many_arguments)]
@ -224,6 +224,15 @@ impl RiotApi {
pub fn tournament_stub_v4(&self) -> TournamentStubV4 { pub fn tournament_stub_v4(&self) -> TournamentStubV4 {
TournamentStubV4 { base: self } TournamentStubV4 { base: self }
} }
/// Returns a handle for accessing [TournamentStubV5](crate::endpoints::TournamentStubV5) endpoints.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#tournament-stub-v5" target="_blank">`tournament-stub-v5`</a>
///
/// Note: this method is automatically generated.
#[inline]
pub fn tournament_stub_v5(&self) -> TournamentStubV5 {
TournamentStubV5 { base: self }
}
/// Returns a handle for accessing [TournamentV4](crate::endpoints::TournamentV4) endpoints. /// Returns a handle for accessing [TournamentV4](crate::endpoints::TournamentV4) endpoints.
/// # Riot Developer API Reference /// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#tournament-v4" target="_blank">`tournament-v4`</a> /// <a href="https://developer.riotgames.com/apis#tournament-v4" target="_blank">`tournament-v4`</a>
@ -1932,6 +1941,119 @@ impl<'a> TournamentStubV4<'a> {
} }
/// TournamentStubV5 endpoints handle, accessed by calling [`tournament_stub_v5()`](crate::RiotApi::tournament_stub_v5) on a [`RiotApi`](crate::RiotApi) instance.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#tournament-stub-v5" target="_blank">`tournament-stub-v5`</a>
///
/// Note: this struct is automatically generated.
#[repr(transparent)]
pub struct TournamentStubV5<'a> {
base: &'a RiotApi,
}
impl<'a> TournamentStubV5<'a> {
/// Create a tournament code for the given tournament - Stub method
/// # Parameters
/// * `route` - Route to query.
/// * `count` (optional, in query) - The number of codes to create (max 1000)
/// * `tournament_id` (required, in query) - The tournament ID
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/api-methods/#tournament-stub-v5/POST_createTournamentCode" target="_blank">`tournament-stub-v5.createTournamentCode`</a>
///
/// Note: this method is automatically generated.
pub fn create_tournament_code(&self, route: RegionalRoute, body: &tournament_stub_v5::TournamentCodeParametersV5, tournament_id: i64, count: Option<i32>)
-> impl Future<Output = Result<Vec<String>>> + 'a
{
let route_str = route.into();
let request = self.base.request(Method::POST, route_str, "/lol/tournament-stub/v5/codes");
let request = request.query(&[ ("tournamentId", tournament_id) ]);
let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request };
let request = request.body(serde_json::ser::to_vec(body).unwrap());
let future = self.base.execute_val::<Vec<String>>("tournament-stub-v5.createTournamentCode", route_str, request);
#[cfg(feature = "tracing")]
let future = future.instrument(tracing::info_span!("tournament-stub-v5.createTournamentCode"));
future
}
/// Returns the tournament code DTO associated with a tournament code string - Stub Method
/// # Parameters
/// * `route` - Route to query.
/// * `tournament_code` (required, in path) - The tournament code string.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/api-methods/#tournament-stub-v5/GET_getTournamentCode" target="_blank">`tournament-stub-v5.getTournamentCode`</a>
///
/// Note: this method is automatically generated.
pub fn get_tournament_code(&self, route: RegionalRoute, tournament_code: &str)
-> impl Future<Output = Result<tournament_stub_v5::TournamentCodeV5>> + 'a
{
let route_str = route.into();
let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament-stub/v5/codes/{}", tournament_code));
let future = self.base.execute_val::<tournament_stub_v5::TournamentCodeV5>("tournament-stub-v5.getTournamentCode", route_str, request);
#[cfg(feature = "tracing")]
let future = future.instrument(tracing::info_span!("tournament-stub-v5.getTournamentCode"));
future
}
/// Gets a list of lobby events by tournament code - Stub method
/// # Parameters
/// * `route` - Route to query.
/// * `tournament_code` (required, in path) - The short code to look up lobby events for
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/api-methods/#tournament-stub-v5/GET_getLobbyEventsByCode" target="_blank">`tournament-stub-v5.getLobbyEventsByCode`</a>
///
/// Note: this method is automatically generated.
pub fn get_lobby_events_by_code(&self, route: RegionalRoute, tournament_code: &str)
-> impl Future<Output = Result<tournament_stub_v5::LobbyEventV5Wrapper>> + 'a
{
let route_str = route.into();
let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament-stub/v5/lobby-events/by-code/{}", tournament_code));
let future = self.base.execute_val::<tournament_stub_v5::LobbyEventV5Wrapper>("tournament-stub-v5.getLobbyEventsByCode", route_str, request);
#[cfg(feature = "tracing")]
let future = future.instrument(tracing::info_span!("tournament-stub-v5.getLobbyEventsByCode"));
future
}
/// Creates a tournament provider and returns its ID - Stub method
/// ## Implementation Notes
/// Providers will need to call this endpoint first to register their callback URL and their API key with the tournament system before any other tournament provider endpoints will work.
/// # Parameters
/// * `route` - Route to query.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/api-methods/#tournament-stub-v5/POST_registerProviderData" target="_blank">`tournament-stub-v5.registerProviderData`</a>
///
/// Note: this method is automatically generated.
pub fn register_provider_data(&self, route: RegionalRoute, body: &tournament_stub_v5::ProviderRegistrationParametersV5)
-> impl Future<Output = Result<i32>> + 'a
{
let route_str = route.into();
let request = self.base.request(Method::POST, route_str, "/lol/tournament-stub/v5/providers");
let request = request.body(serde_json::ser::to_vec(body).unwrap());
let future = self.base.execute_val::<i32>("tournament-stub-v5.registerProviderData", route_str, request);
#[cfg(feature = "tracing")]
let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerProviderData"));
future
}
/// Creates a tournament and returns its ID - Stub method
/// # Parameters
/// * `route` - Route to query.
/// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/api-methods/#tournament-stub-v5/POST_registerTournament" target="_blank">`tournament-stub-v5.registerTournament`</a>
///
/// Note: this method is automatically generated.
pub fn register_tournament(&self, route: RegionalRoute, body: &tournament_stub_v5::TournamentRegistrationParametersV5)
-> impl Future<Output = Result<i32>> + 'a
{
let route_str = route.into();
let request = self.base.request(Method::POST, route_str, "/lol/tournament-stub/v5/tournaments");
let request = request.body(serde_json::ser::to_vec(body).unwrap());
let future = self.base.execute_val::<i32>("tournament-stub-v5.registerTournament", route_str, request);
#[cfg(feature = "tracing")]
let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerTournament"));
future
}
}
/// TournamentV4 endpoints handle, accessed by calling [`tournament_v4()`](crate::RiotApi::tournament_v4) on a [`RiotApi`](crate::RiotApi) instance. /// TournamentV4 endpoints handle, accessed by calling [`tournament_v4()`](crate::RiotApi::tournament_v4) on a [`RiotApi`](crate::RiotApi) instance.
/// # Riot Developer API Reference /// # Riot Developer API Reference
/// <a href="https://developer.riotgames.com/apis#tournament-v4" target="_blank">`tournament-v4`</a> /// <a href="https://developer.riotgames.com/apis#tournament-v4" target="_blank">`tournament-v4`</a>

View File

@ -7,7 +7,7 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 560d6708a4e0e652fc4b2ada788de0bd6eb546ad // Version e4a5ce3f63911af22ef752e7f5844f4cc4086f0b
//! Metadata about the Riot API and Riven. //! Metadata about the Riot API and Riven.
//! //!
@ -15,7 +15,7 @@
/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains /// Metadata for endpoints. Each tuple corresponds to one endpoint and contains
/// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID. /// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID.
pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 83] = [ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 88] = [
(reqwest::Method::GET, "/riot/account/v1/accounts/by-puuid/{puuid}", "account-v1.getByPuuid"), (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/by-riot-id/{gameName}/{tagLine}", "account-v1.getByRiotId"),
(reqwest::Method::GET, "/riot/account/v1/accounts/me", "account-v1.getByAccessToken"), (reqwest::Method::GET, "/riot/account/v1/accounts/me", "account-v1.getByAccessToken"),
@ -87,6 +87,11 @@ pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 83] = [
(reqwest::Method::GET, "/lol/tournament-stub/v4/lobby-events/by-code/{tournamentCode}", "tournament-stub-v4.getLobbyEventsByCode"), (reqwest::Method::GET, "/lol/tournament-stub/v4/lobby-events/by-code/{tournamentCode}", "tournament-stub-v4.getLobbyEventsByCode"),
(reqwest::Method::POST, "/lol/tournament-stub/v4/providers", "tournament-stub-v4.registerProviderData"), (reqwest::Method::POST, "/lol/tournament-stub/v4/providers", "tournament-stub-v4.registerProviderData"),
(reqwest::Method::POST, "/lol/tournament-stub/v4/tournaments", "tournament-stub-v4.registerTournament"), (reqwest::Method::POST, "/lol/tournament-stub/v4/tournaments", "tournament-stub-v4.registerTournament"),
(reqwest::Method::POST, "/lol/tournament-stub/v5/codes", "tournament-stub-v5.createTournamentCode"),
(reqwest::Method::GET, "/lol/tournament-stub/v5/codes/{tournamentCode}", "tournament-stub-v5.getTournamentCode"),
(reqwest::Method::GET, "/lol/tournament-stub/v5/lobby-events/by-code/{tournamentCode}", "tournament-stub-v5.getLobbyEventsByCode"),
(reqwest::Method::POST, "/lol/tournament-stub/v5/providers", "tournament-stub-v5.registerProviderData"),
(reqwest::Method::POST, "/lol/tournament-stub/v5/tournaments", "tournament-stub-v5.registerTournament"),
(reqwest::Method::POST, "/lol/tournament/v4/codes", "tournament-v4.createTournamentCode"), (reqwest::Method::POST, "/lol/tournament/v4/codes", "tournament-v4.createTournamentCode"),
(reqwest::Method::GET, "/lol/tournament/v4/codes/{tournamentCode}", "tournament-v4.getTournamentCode"), (reqwest::Method::GET, "/lol/tournament/v4/codes/{tournamentCode}", "tournament-v4.getTournamentCode"),
(reqwest::Method::PUT, "/lol/tournament/v4/codes/{tournamentCode}", "tournament-v4.updateCode"), (reqwest::Method::PUT, "/lol/tournament/v4/codes/{tournamentCode}", "tournament-v4.updateCode"),

View File

@ -7,7 +7,7 @@
/////////////////////////////////////////////// ///////////////////////////////////////////////
// http://www.mingweisamuel.com/riotapi-schema/tool/ // http://www.mingweisamuel.com/riotapi-schema/tool/
// Version 560d6708a4e0e652fc4b2ada788de0bd6eb546ad // Version e4a5ce3f63911af22ef752e7f5844f4cc4086f0b
#![allow(missing_docs)] #![allow(missing_docs)]
@ -2501,6 +2501,10 @@ pub mod tft_league_v1 {
#[derive(serde::Serialize, serde::Deserialize)] #[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct LeagueEntry { pub struct LeagueEntry {
/// Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted)
#[serde(rename = "puuid")]
#[serde(skip_serializing_if = "Option::is_none")]
pub puuid: Option<String>,
/// Not included for the RANKED_TFT_TURBO queueType. /// Not included for the RANKED_TFT_TURBO queueType.
#[serde(rename = "leagueId")] #[serde(rename = "leagueId")]
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
@ -2964,6 +2968,140 @@ pub mod tournament_stub_v4 {
} }
} }
/// Data structs used by [`TournamentStubV5`](crate::endpoints::TournamentStubV5).
///
/// Note: this module is automatically generated.
#[allow(dead_code)]
pub mod tournament_stub_v5 {
/// TournamentCodeParametersV5 data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct TournamentCodeParametersV5 {
/// Optional list of encrypted puuids in order to validate the players eligible to join the lobby. NOTE: We currently do not enforce participants at the team level, but rather the aggregate of teamOne and teamTwo. We may add the ability to enforce at the team level in the future.
#[serde(rename = "allowedParticipants")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_participants: Option<std::vec::Vec<String>>,
/// Optional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game.
#[serde(rename = "metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<String>,
/// The team size of the game. Valid values are 1-5.
#[serde(rename = "teamSize")]
pub team_size: i32,
/// The pick type of the game.<br>
/// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT)
#[serde(rename = "pickType")]
pub pick_type: String,
/// The map type of the game.<br>
/// (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS)
#[serde(rename = "mapType")]
pub map_type: String,
/// The spectator type of the game.<br>
/// (Legal values: NONE, LOBBYONLY, ALL)
#[serde(rename = "spectatorType")]
pub spectator_type: String,
/// Checks if allowed participants are enough to make full teams.
#[serde(rename = "enoughPlayers")]
pub enough_players: bool,
}
/// TournamentCodeV5 data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct TournamentCodeV5 {
/// The tournament code.
#[serde(rename = "code")]
pub code: String,
/// The spectator mode for the tournament code game.
#[serde(rename = "spectators")]
pub spectators: String,
/// The lobby name for the tournament code game.
#[serde(rename = "lobbyName")]
pub lobby_name: String,
/// The metadata for tournament code.
#[serde(rename = "metaData")]
pub meta_data: String,
/// The password for the tournament code game.
#[serde(rename = "password")]
pub password: String,
/// The team size for the tournament code game.
#[serde(rename = "teamSize")]
pub team_size: i32,
/// The provider's ID.
#[serde(rename = "providerId")]
pub provider_id: i32,
/// The pick mode for tournament code game.
#[serde(rename = "pickType")]
pub pick_type: String,
/// The tournament's ID.
#[serde(rename = "tournamentId")]
pub tournament_id: i32,
/// The tournament code's ID.
#[serde(rename = "id")]
pub id: i32,
/// The tournament code's region.<br>
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR)
#[serde(rename = "region")]
pub region: String,
/// The game map for the tournament code game
#[serde(rename = "map")]
pub map: String,
/// The puuids of the participants (Encrypted)
#[serde(rename = "participants")]
pub participants: std::vec::Vec<String>,
}
/// LobbyEventV5Wrapper data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct LobbyEventV5Wrapper {
#[serde(rename = "eventList")]
pub event_list: std::vec::Vec<LobbyEventV5>,
}
/// LobbyEventV5 data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct LobbyEventV5 {
/// Timestamp from the event
#[serde(rename = "timestamp")]
pub timestamp: String,
/// The type of event that was triggered
#[serde(rename = "eventType")]
pub event_type: String,
/// The puuid that triggered the event (Encrypted)
#[serde(rename = "puuid")]
pub puuid: String,
}
/// ProviderRegistrationParametersV5 data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct ProviderRegistrationParametersV5 {
/// The region in which the provider will be running tournaments.<br>
/// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR)
#[serde(rename = "region")]
pub region: String,
/// The provider's callback URL to which tournament game results in this region should be posted. The URL must be well-formed, use the http or https protocol, and use the default port for the protocol (http URLs must use port 80, https URLs must use port 443).
#[serde(rename = "url")]
pub url: String,
}
/// TournamentRegistrationParametersV5 data object.
#[derive(Clone, Debug)]
#[derive(serde::Serialize, serde::Deserialize)]
#[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))]
pub struct TournamentRegistrationParametersV5 {
/// The provider ID to specify the regional registered provider data to associate this tournament.
#[serde(rename = "providerId")]
pub provider_id: i32,
/// The optional name of the tournament.
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
}
/// Data structs used by [`TournamentV4`](crate::endpoints::TournamentV4). /// Data structs used by [`TournamentV4`](crate::endpoints::TournamentV4).
/// ///
/// Note: this module is automatically generated. /// Note: this module is automatically generated.
@ -3160,6 +3298,10 @@ pub mod val_content_v1 {
#[serde(rename = "ceremonies")] #[serde(rename = "ceremonies")]
#[serde(skip_serializing_if = "Option::is_none")] #[serde(skip_serializing_if = "Option::is_none")]
pub ceremonies: Option<std::vec::Vec<ContentItem>>, pub ceremonies: Option<std::vec::Vec<ContentItem>>,
/// Unknown type, this is a placeholder subject to change.
#[serde(rename = "totems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub totems: Option<std::vec::Vec<String>>,
} }
/// ContentItem data object. /// ContentItem data object.
#[derive(Clone, Debug)] #[derive(Clone, Debug)]