diff --git a/.cargo/config.toml b/.cargo/config.toml index d21a242b..bdfbb24d 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,3 +1,7 @@ +[build] +rustflags = [ "--cfg", "riven_autogen" ] + [env] RUST_BACKTRACE = "full" RUST_LOG = "info,riven=debug" +RIVEN_AUTOGEN_DEVMODE = "none" diff --git a/.gitignore b/.gitignore index 36afc4e7..eef879b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ /target -**/*.rs.bk /doc -apikey.txt - +/apikey.txt diff --git a/Cargo.lock b/Cargo.lock index 934bc429..adbfddeb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -505,6 +505,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "http" version = "0.2.12" @@ -743,6 +749,7 @@ checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown", + "serde", ] [[package]] @@ -813,6 +820,22 @@ version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +[[package]] +name = "macro_rules_attribute" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a82271f7bc033d84bbca59a3ce3e4159938cb08a9c3aebbe54d215131518a13" +dependencies = [ + "macro_rules_attribute-proc_macro", + "paste", +] + +[[package]] +name = "macro_rules_attribute-proc_macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dd856d451cc0da70e2ef2ce95a18e39a93b7558bedf10201ad28503f918568" + [[package]] name = "memchr" version = "2.7.4" @@ -1007,6 +1030,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1037,6 +1066,16 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +[[package]] +name = "prettyplease" +version = "0.2.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ccf34da56fc294e7d4ccf69a85992b7dfb826b7cf57bac6a70bba3494cc08a" +dependencies = [ + "proc-macro2", + "syn 2.0.96", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -1174,12 +1213,18 @@ dependencies = [ "fake_instant", "futures", "gloo-timers", + "heck 0.5.0", "hyper", + "indexmap", "log", + "macro_rules_attribute", "memo-map", "metrics", "num_enum", "parking_lot", + "prettyplease", + "proc-macro2", + "quote", "reqwest", "serde", "serde_derive", @@ -1188,6 +1233,7 @@ dependencies = [ "slab", "strum", "strum_macros", + "syn 2.0.96", "tokio", "tokio-shared-rt", "tracing", @@ -1429,7 +1475,7 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro2", "quote", "syn 1.0.109", diff --git a/README.md b/README.md index 24741f87..72cdfa17 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,6 @@ instance, setting the desired config values, and passing that to [`RiotApi::new` (instead of just the API key). For example, you can configure the number of times Riven retries using [`RiotApiConfig::set_retries(...)`](https://docs.rs/riven/latest/riven/struct.RiotApiConfig.html#method.set_retries). - ## Semantic Versioning This package follows semantic versioning to an extent. However, the Riot API @@ -165,6 +164,23 @@ version. (`major.minor.patch`) Parts of Riven that do not depend on Riot API changes do follow semantic versioning. +## Auto-Updating + +Riven may be configured to automatically update its generated code from the latest version of the +[riotapi-schema](https://github.com/MingweiSamuel/riotapi-schema). This requires an internet +connection, violates semantic versioning, and may break your build. To enable auto-updating, set +the `riven_autogen` cfg option for `rustc` (not a cargo feature). + +If the build configuration doesn't change, then the generated code will be cached and not +subsequently update. To change the build configuration and force an update you can set the +`RIVEN_AUTOGEN_NONCE` environment variable to a new value. + +For example, setting `RIVEN_AUTOGEN_NONCE` to the current date will trigger an update once a day, +assuming the build configuration otherwise doesn't change: +```bash +RUSTFLAGS="--cfg riven_autogen" RIVEN_AUTOGEN_NONCE="$(date +%Y-%m-%d)" cargo build +``` + ## Additional Help Feel free to [make an issue](https://github.com/MingweiSamuel/Riven/issues/new) @@ -172,17 +188,25 @@ if you are have any questions or trouble with Riven. # Development -NodeJS is used to generate code for Riven. The -[`riven/srcgen`](https://github.com/MingweiSamuel/Riven/tree/v/2.x.x/riven/srcgen) -folder contains the code and [doT.js](https://olado.github.io/doT/index.html) -templates. `index.js` lists the JSON files downloaded and used to generate the -code. - -To set up the srcgen, you will first need to install NodeJS. Then enter the -`riven/srcgen` folder and run `npm ci` (or `npm install`) to install -dependencies. - -To run the srcgen use `node riven/srcgen` from the repository root. +Riven is a regular cargo package for the most part, and can be built directly from the repository +source code without additional consideration. However source files with names matching `*.gen.rs` +have been automatically generated by the `riven/build` build script. The build script is set up to +be skipped by default; to actually update the generated files run `./srcgen.bash`. + +## Build Script Configuration + +The the `riven_autogen` cfg option (for `rustc`, not a cargo feature) enables the build script. If +unset, the build script is not even compiled, which ensures fast builds when Riven is used as a +dependency. If set, the build script will be compiled but the actual behavior depends on the +`RIVEN_AUTOGEN_DEVMODE` environment variable. If unset or set to `"outdir"`, will behave as in the +[auto-update](#auto-updating) section above, generating files to `OUT_DIR` to be used by Riven +instead of the checked-in `src` files. If set to `"src"`, the build script will overwrite the files +in `src` directly (this is what `./autogen_src.bash` does). If set to `"none"`, the build script +will be built but will not generate any files. This is the default for the repository, set in +`.cargo/config.toml`, to avoids extraneous updates. + +The build script will not generally re-run after the initial build, unless the `RIVEN_AUTOGEN_NONCE` +environment variable changes, or something else in the build configuration changes. ## Testing diff --git a/autogen_src.bash b/autogen_src.bash new file mode 100755 index 00000000..9b79a730 --- /dev/null +++ b/autogen_src.bash @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -euxo pipefail + +RIVEN_AUTOGEN_NONCE="$(date)" RIVEN_AUTOGEN_DEVMODE="src" cargo rustc -p riven diff --git a/riven/Cargo.toml b/riven/Cargo.toml index 607d79ed..cbed1eda 100644 --- a/riven/Cargo.toml +++ b/riven/Cargo.toml @@ -8,9 +8,10 @@ readme = "../README.md" license = "MIT" edition = "2018" rust-version = "1.71.1" -include = [ "/src/**", "/../README.md" ] +include = [ "/src", "/build", "/../README.md" ] keywords = [ "riot-games", "riot", "league", "league-of-legends" ] categories = [ "api-bindings", "web-programming::http-client", "wasm" ] +build = "build/main.rs" [lib] crate-type = [ "cdylib", "rlib" ] @@ -58,6 +59,7 @@ eserde = { optional = true, version = "0.1.6", features = [ "json" ] } futures = "0.3.0" log = "0.4.8" memo-map = "0.3.0" +macro_rules_attribute = "0.2.0" metrics = { optional = true, version = "0.24.0" } num_enum = "0.5.0" parking_lot = "0.12.0" @@ -95,6 +97,19 @@ console_log = "1.0" wasm-bindgen = "0.2.70" wasm-bindgen-test = "0.3" +[target.'cfg(riven_autogen)'.build-dependencies] +heck = "0.5.0" +indexmap = { version = "2.0.0", features = [ "serde" ] } +prettyplease = "0.2.30" +proc-macro2 = "1.0.93" +quote = "1.0.38" +reqwest = { version = "0.11.2", default-features = false, features = [ "gzip" ] } +serde = { version = "1.0.85", features = [ "derive" ] } +serde_derive = "1.0.85" +serde_json = "1.0.1" +syn = "2.0.96" +tokio = { version = "1.20.0", default-features = false, features = [ "rt", "sync" ] } + [target.'cfg(docsrs_deps)'.dependencies] eserde = { version = "0.1.6", features = [ "json" ] } gloo-timers = { version = "0.3", features = [ "futures" ] } diff --git a/riven/build/autogen/champion.rs b/riven/build/autogen/champion.rs new file mode 100644 index 00000000..58f4d2c1 --- /dev/null +++ b/riven/build/autogen/champion.rs @@ -0,0 +1,181 @@ +use std::collections::BTreeMap; + +use heck::ToShoutySnakeCase; +use proc_macro2::{Ident, Literal, Span}; +use quote::quote; +use syn::{parse_quote, File}; + +#[derive(Debug, serde::Deserialize)] +#[allow(dead_code)] +pub struct Champion { + pub id: i16, + pub name: String, + pub alias: String, + pub square_portrait_path: Option, + pub roles: Vec, +} +impl Champion { + fn ident(&self) -> Ident { + Ident::new(&self.alias.to_shouty_snake_case(), Span::call_site()) + } +} + +pub fn champion(champions: &[Champion]) -> File { + let champions = champions.iter().filter(|&champion| 0 <= champion.id); + + let newtype_enum = { + let doc_rows = champions.clone().map(|champion| { + let id = champion.id; + let name = &champion.name; + let alias = &champion.alias; + format!("`{}` | {} | {} | {}", id, name, alias, id) + }); + + let variants = champions.clone().map(|champion| { + let doc = format!("`{}`", champion.id); + let ident = champion.ident(); + let id = Literal::i16_unsuffixed(champion.id); + quote! { + #[doc = #doc] + #ident = #id, + } + }); + + quote! { + #[macro_rules_attribute::apply(newtype_enum)] + #[repr(i16)] + /// A League of Legends champion. + /// + /// This newtype acts as a C-like enum; each variant corresponds to an + /// integer value. Using a newtype allows _unknown_ variants to be + /// represented. This is important when Riot adds new champions. + /// + /// Field | Name | Identifier | Id + /// ---|---|---|--- + /// `NONE` | None (no ban) | | -1 + #( #[doc = #doc_rows ] )* + pub enum Champion { + /// `-1`, none. Appears when a champion ban is not used in champ select. + NONE = -1, + #( #variants )* + } + } + }; + + let champion_impl = { + let name_cases = champions.clone().map(|champion| { + let ident = champion.ident(); + let name = &champion.name; + quote! { + Self::#ident => Some(#name), + } + }); + let identifier_doc_rows = champions + .clone() + .filter(|champion| { + champion.alias + != champion + .name + .replace(|c| char::is_ascii_alphanumeric(&c), "") + }) + .map(|champion| { + let id = champion.id; + let name = &champion.name; + let alias = &champion.alias; + format!("`{}` | {} | {} | {}", id, name, alias, id) + }); + let identifier_cases = champions.clone().map(|champion| { + let ident = champion.ident(); + let alias = &champion.alias; + quote! { + Self::#ident => Some(#alias), + } + }); + + quote! { + impl Champion { + /// The champion's name (`en_US` localization). + pub const fn name(self) -> Option<&'static str> { + match self { + #( #name_cases )* + _ => None, + } + } + + /// The champion's identifier key. Somtimes called "key", "identifier", or "alias". + /// This is mainly used in DDragon paths. + /// + /// This is generally the `en_US` name with spaces and punctuation removed, + /// capitalization preserved, however the follow are exceptions: + /// + /// Field | Name | Identifier | Id + /// ---|---|---|--- + #( #[doc = #identifier_doc_rows] )* + pub const fn identifier(self) -> Option<&'static str> { + match self { + #( #identifier_cases )* + _ => None, + } + } + } + } + }; + + let champion_parse = { + let cases: BTreeMap = champions + .flat_map(|champion| { + IntoIterator::into_iter([&champion.alias, &champion.name]).flat_map(move |s| { + // e.g. `CHOG` for `Cho'Gath`. + let chars_full = s.chars().filter(|c| c.is_ascii_alphanumeric()); + // e.g. `CHO` for `Cho'Gath`. + let chars_first = s.chars().take_while(|c| c.is_ascii_alphanumeric()); + + IntoIterator::into_iter([ + Box::new(chars_full) as Box>, + Box::new(chars_first), + ]) + .map(move |chars| { + let str: String = chars + .map(|c| c.to_ascii_uppercase()) + .chain(std::iter::repeat('\0')) + .take(4) + .collect(); + (str, champion) + }) + }) + }) + .collect(); + let cases = cases.into_iter().map(|(s, champion)| { + let ident = champion.ident(); + let chars = s.chars().map(Literal::character); + quote! { + [#( #chars ),*] => Ok(Champion::#ident), + } + }); + + quote! { + impl std::str::FromStr for Champion { + type Err = ParseChampionError; + fn from_str(s: &str) -> Result { + let mut chars = ['\0'; 4]; + s.chars() + .take(4) + .filter(|c| c.is_ascii_alphanumeric()) + .map(|c| c.to_ascii_uppercase()) + .enumerate() + .for_each(|(i, c)| chars[i] = c); + match chars { + #( #cases )* + unknown => Err(ParseChampionError(unknown)), + } + } + } + } + }; + + parse_quote! { + #newtype_enum + #champion_impl + #champion_parse + } +} diff --git a/riven/build/autogen/endpoints.rs b/riven/build/autogen/endpoints.rs new file mode 100644 index 00000000..e8ce7480 --- /dev/null +++ b/riven/build/autogen/endpoints.rs @@ -0,0 +1,393 @@ +use std::borrow::Cow; + +use heck::{ToPascalCase, ToSnakeCase}; +use indexmap::IndexMap; +use proc_macro2::{Span, TokenStream}; +use quote::quote; +use syn::{parse_quote, File, Ident, PatType}; + +use super::spec::{ + normalize_prop_name, prop_to_type, Operation, Parameter, RequestBody, SchemaEnum, Spec, +}; +use super::CODEGEN_NOTE; + +pub fn endpoints(spec: &Spec) -> File { + let mut endpoint_groups = IndexMap::<_, Vec<_>>::new(); + for (path, path_info) in spec.paths.iter() { + let endpoint = path_info.x_endpoint.as_deref().unwrap(); + endpoint_groups + .entry(endpoint) + .or_default() + .push((path, path_info)); + } + + let impl_riot_api = { + let methods = endpoint_groups.keys().map(|&endpoint| { + let method = Ident::new(&endpoint.to_snake_case(), Span::call_site()); + let ty = Ident::new(&endpoint.to_pascal_case(), Span::call_site()); + let doc0 = format!( + "Returns a handle for accessing [`{}`](crate::endpoints::{}) endpoints.", + endpoint, ty + ); + let doc1 = format!( + "`{0}`", + endpoint + ); + quote! { + #[doc = #doc0] + /// + /// # Riot Developer API Reference + #[doc = #doc1] + /// + #[doc = #CODEGEN_NOTE] + #[inline] + pub fn #method(&self) -> #ty<'_> { + #ty { base: self } + } + } + }); + + quote! { + impl RiotApi { + #( #methods )* + } + } + }; + + let endpoint_structs = endpoint_groups.keys().map(|endpoint| { + let method = Ident::new(&endpoint.to_snake_case(), Span::call_site()); + let ty = Ident::new(&endpoint.to_pascal_case(), Span::call_site()); + + let doc0 = format!( + "{0} endpoints handle, accessed by calling [`{1}()`](crate::RiotApi::{1}) on a [`RiotApi`] instance.", + endpoint, method, + ); + let doc1 = format!("`{0}`", endpoint); + + quote! { + #[doc = #doc0] + /// + /// # Riot Developer API Reference + #[doc = #doc1] + /// + #[doc = #CODEGEN_NOTE] + #[repr(transparent)] + pub struct #ty<'a> { + base: &'a RiotApi, + } + } + }); + + let endpoint_impls = endpoint_groups.iter().map(|(endpoint, methods)| { + let ty = Ident::new(&endpoint.to_pascal_case(), Span::call_site()); + + let methods = methods + .iter() + .flat_map(|&(path, path_info)| { + path_info + .iter_operations() + .map(move |(verb, op)| (path, verb, op)) + }) + .map(|(path, verb, op)| { + let op_id = &*op.operation_id; + let method = Ident::new(&op_id.split_once('.').unwrap().1.to_snake_case(), Span::call_site()); + + let ok_resp = &op.responses.ok; + let is_rso = op + .security + .as_deref() + .is_some_and(|secs| secs.iter().any(|sec| sec.contains_key("rso"))); + + // Return type checks. + let mut parse_type = None; + let mut return_type = parse_quote!(()); + let mut return_optional = false; + if let Some(ok_content) = &ok_resp.content { + let json_info = ok_content + .get("application/json") + .expect("Expected JSON response under `application/json` content type."); + + return_type = prop_to_type(&json_info.schema, false, true); + parse_type = Some(return_type.clone()); + + return_optional = op.x_nullable_404.unwrap_or_default(); + if return_optional { + return_type = parse_quote!(Option::<#return_type>); + } + } + + // Rustdoc description. + let desc_docs = op + .description + .lines() + .map(str::trim); + + let mut method_builder = ArgsBuilder::with_route(op); + if is_rso { + method_builder.add_rso(); + } + + let all_params = op.parameters.as_deref().unwrap_or_default(); + // Path params. + let mut path_params = all_params + .iter() + .filter(|p| "path" == p.r#in) + .collect::>(); + // Important: sort path params by their position in the path. + path_params + .sort_unstable_by_key(|p| path.find(&format!("{{{}}}", p.name)).unwrap()); + path_params.iter().for_each(|param| { + method_builder.add_param(param); + }); + // Body param. + if let Some(body) = &op.request_body { + method_builder.add_body(body); + } + // Required and optional query params. + let req_query_params = all_params + .iter() + .filter(|p| "query" == p.r#in && p.required); + let opt_query_params = all_params + .iter() + .filter(|p| "query" == p.r#in && !p.required); + req_query_params.into_iter().chain(opt_query_params).for_each(|param| { + method_builder.add_param(param); + }); + // Header params. + if all_params.iter().any(|p| "header" == p.r#in) { + panic!("Header params are not implemented: {:?}", all_params); + } + + let path_argument = path_argument(path, path_params); + + let rso_docs = is_rso.then(|| quote! { + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + }); + let doc_link = format!("`{}`", op.external_docs.url, op_id); + + let ArgsBuilder { arg_docs, arg_inputs, arg_code } = method_builder; + + let verb_ident = Ident::new(&verb.to_ascii_uppercase(), Span::call_site()); + + let exec_fn = if ok_resp.content.is_some() { + if return_optional { + quote! { execute_opt } + } else { + quote! { execute_val } + } + } else { + quote! { execute } + }; + + quote! { + #( #[doc = #desc_docs] )* + /// + /// # Parameters + #( #[doc = #arg_docs] )* + /// + #rso_docs + /// # Riot Developer API Reference + #[doc = #doc_link] + /// + #[doc = #CODEGEN_NOTE] + pub fn #method(&self, #( #arg_inputs ),*) -> impl 'a + Future> + { + let route_str = route.into(); + let request = self.base.request(Method::#verb_ident, route_str, #path_argument); + #( #arg_code )* + let future = self.base.#exec_fn::<#parse_type>(#op_id, route_str, request); + #[cfg(feature = "tracing")] + let future = future.instrument(tracing::info_span!(#op_id, route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, #op_id, route_str); + future + } + } + }); + + quote! { + #[doc = #CODEGEN_NOTE] + impl<'a> #ty<'a> { + #( #methods )* + } + } + }); + + parse_quote! { + use std::future::Future; + use std::vec::Vec; + + #[cfg(feature="metrics")] + use crate::metrics; + + #[cfg(feature="tracing")] + use tracing::Instrument; + use reqwest::Method; + + use crate::Result; + use crate::consts::{ RegionalRoute, PlatformRoute, ValPlatformRoute }; + use crate::riot_api::RiotApi; + + #impl_riot_api + + #( #endpoint_structs )* + + #( #endpoint_impls )* + } +} + +#[derive(Default)] +pub struct ArgsBuilder { + pub arg_docs: Vec>, + pub arg_inputs: Vec, + pub arg_code: Vec, +} +impl ArgsBuilder { + pub fn with_route(op: &Operation) -> Self { + let mut this = Self::default(); + this.arg_inputs.push({ + let route_ty = Ident::new( + &format!("{}Route", op.x_route_enum.to_pascal_case()), + Span::call_site(), + ); + parse_quote!(route: #route_ty) + }); + this.arg_docs.push("- `route` - Route to query.".into()); + this + } + + pub fn add_rso(&mut self) { + self.arg_docs + .push("- `access_token` - RSO access token.".into()); + self.arg_inputs + .push(parse_quote!(access_token: impl std::fmt::Display)); + self.arg_code.push(quote! { + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, "") + } + }); + } + + pub fn add_body(&mut self, body: &RequestBody) { + let name = &parse_quote!(body); + let json_info = body.content.get("application/json").unwrap(); + let ty = prop_to_type(&json_info.schema, !body.required, false); + // Docs. + self.push_doc_line("body", body.required, "body", &body.description); + // Args. + self.arg_inputs.push(parse_quote!(#name: &#ty)); + // Code. + let body_code = quote! { + request + .body(serde_json::ser::to_vec(#name).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json") + }; + self.push_code_optional(name, body_code, body.required); + } + + pub fn add_param(&mut self, param: &Parameter) { + let required = param.required || "path" == param.r#in; + let key = &*param.name; + let name = &normalize_prop_name(key, None); + let ty = prop_to_type(¶m.schema, !required, false); + // Docs. + self.push_doc_line(name, required, ¶m.r#in, ¶m.description); + // Args. + self.arg_inputs.push(parse_quote!(#name: #ty)); + // Code (path params are handled separately). + if "path" != param.r#in { + let param_code = match ¶m.schema.schema_enum() { + Some(SchemaEnum::Array { .. }) => quote! { + request.query(&*#name + .iter() + .map(|w| (#key, w)) + .collect::<::std::vec::Vec<_>>()) + }, + Some(SchemaEnum::Object { .. }) => { + panic!("object not expected in query param: `{:?}`.", param.name) + } + Some(_other) => quote! { + request.query(&[(#key, #name)]) + }, + None => panic!("schema not expected in query param: `{:?}`.", param.name), + }; + self.push_code_optional(name, param_code, required); + } + } + + fn push_code_optional(&mut self, name: &Ident, mut code: TokenStream, required: bool) { + if !required { + code = quote! { + if let Some(#name) = #name { + #code + } else { + request + } + }; + } + self.arg_code.push(quote! { + let request = #code; + }); + } + + fn push_doc_line( + &mut self, + name: impl std::fmt::Display, + required: bool, + r#in: &str, + description: &Option, + ) { + let mut doc_line = format!( + "- `{}` ({}, in {})", + name, + if required { "required" } else { "optional" }, + r#in + ); + if let Some(description) = description { + doc_line.push_str(" - "); + doc_line.push_str(description); + if !description.ends_with(['.', '!', '?']) { + doc_line.push('.'); + } + } + self.arg_docs.push(doc_line.into()); + } +} + +fn path_argument(path: &String, path_params: Vec<&Parameter>) -> TokenStream { + if path_params.is_empty() { + quote!(#path) + } else { + // Replaces `{someName}` with `{}` for the format string. + let path = path + .chars() + .filter({ + let mut active = true; + move |c| match c { + '{' => { + active = false; + true + } + '}' => { + active = true; + true + } + _ => active, + } + }) + .collect::(); + let path_param_idents = path_params + .iter() + .map(|p| normalize_prop_name(&p.name, None)); + quote! { + &format!( + #path, + #( #path_param_idents ),* + ) + } + } +} diff --git a/riven/build/autogen/enum_unknown.rs b/riven/build/autogen/enum_unknown.rs new file mode 100644 index 00000000..a40df801 --- /dev/null +++ b/riven/build/autogen/enum_unknown.rs @@ -0,0 +1,63 @@ +use proc_macro2::Span; +use quote::quote; +use syn::{parse_quote, File, Ident}; + +#[derive(Debug, serde::Deserialize)] +pub struct EnumString { + #[serde(rename = "x-name")] + pub x_name: String, + #[serde(rename = "x-desc")] + pub x_desc: String, + #[serde(rename = "x-deprecated")] + pub x_deprecated: Option, + pub notes: Option, +} + +/// Enum with `UNKNOWN(String)` variant for new/unknown values. +pub fn enum_unknown(variants: &[EnumString], ident: Ident, repr: Ident, description: &str) -> File { + let variants = variants.iter().map( + |EnumString { + x_name, + x_desc, + x_deprecated, + notes, + }| { + let docs = x_desc.lines().map(str::trim); + let notes_attr = notes.as_deref().map(|notes| { + quote! { + /// + #[doc = #notes] + } + }); + let deprecated_attr = x_deprecated.unwrap_or_default().then(|| { + let notes = notes.as_deref().map(|notes| quote!(note = #notes)); + quote!(#[deprecated(#notes)]) + }); + let key = Ident::new(x_name, Span::call_site()); + quote! { + #( #[doc = #docs] )* + #notes_attr + #deprecated_attr + #key, + } + }, + ); + + parse_quote! { + use strum_macros::{ EnumString, EnumVariantNames, IntoStaticStr }; + + #[doc = #description] + #[derive(Debug, Clone, PartialEq, Eq, Hash)] + #[derive(EnumString, EnumVariantNames, IntoStaticStr)] + #[repr(#repr)] + pub enum #ident { + /// Catch-all variant for new/unknown values. + #[strum(default)] + UNKNOWN(String), + + #( #variants )* + } + + serde_strum_unknown!(#ident); + } +} diff --git a/riven/build/autogen/game_type.rs b/riven/build/autogen/game_type.rs new file mode 100644 index 00000000..5b4f0019 --- /dev/null +++ b/riven/build/autogen/game_type.rs @@ -0,0 +1,47 @@ +use proc_macro2::Span; +use quote::quote; +use syn::{parse_quote, File, Ident}; + +use super::enum_unknown::EnumString; + +pub fn game_type(variants: &[EnumString]) -> File { + let variants = variants.iter().map( + |EnumString { + x_name, + x_desc, + x_deprecated, + notes, + }| { + assert_eq!( + None, *x_deprecated, + "Unexpectedly deprecated `GameType` {}.", + x_name + ); + assert_eq!(None, *notes, "Unexpected notes for `GameType` {}.", x_name); + + let docs = x_desc.lines().map(str::trim); + let name_no_game = x_name.strip_suffix("_GAME").unwrap_or(x_name); + let key = Ident::new(x_name, Span::call_site()); + quote! { + #( #[doc = #docs] )* + // Note: strum(serialize = ...) actually specifies extra **De**serialization values. + #[strum(to_string = #x_name, serialize = #name_no_game)] + #[serde(alias = #name_no_game)] + #key, + } + }, + ); + + parse_quote! { + use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr }; + + /// League of Legends game type: matched game, custom game, or tutorial game. + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] + #[derive(EnumString, Display, AsRefStr, IntoStaticStr)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[repr(u8)] + pub enum GameType { + #( #variants )* + } + } +} diff --git a/riven/build/autogen/meta.rs b/riven/build/autogen/meta.rs new file mode 100644 index 00000000..d5125935 --- /dev/null +++ b/riven/build/autogen/meta.rs @@ -0,0 +1,33 @@ +use syn::{parse_quote, File}; + +use super::spec::Spec; + +pub fn meta(spec: &Spec) -> File { + let rows = spec + .paths + .iter() + .flat_map(|(route, path)| { + path.iter_operations() + .map(move |(method, operation)| (&**route, method, operation)) + }) + .map(|(route, method, operation)| { + let method_ident = + syn::Ident::new(&method.to_ascii_uppercase(), proc_macro2::Span::call_site()); + let operation_id = &operation.operation_id; + quote::quote! { + (Method::#method_ident, #route, #operation_id), + } + }) + .collect::>(); + let len = rows.len(); + + parse_quote! { + use reqwest::Method; + + /// Metadata for endpoints. Each tuple corresponds to one endpoint and contains + /// the HTTP [`Method`], `str` path, and the method's `str` ID. + pub static ALL_ENDPOINTS: [(Method, &str, &str); #len] = [ + #( #rows )* + ]; + } +} diff --git a/riven/build/autogen/mod.rs b/riven/build/autogen/mod.rs new file mode 100644 index 00000000..23a08754 --- /dev/null +++ b/riven/build/autogen/mod.rs @@ -0,0 +1,234 @@ +use std::borrow::Cow; +use std::future::Future; +use std::path::Path; + +use syn::parse_quote; + +mod champion; +mod endpoints; +mod enum_unknown; +mod game_type; +mod meta; +mod models; +mod newtype_enum; +mod route; +mod spec; + +const CODEGEN_NOTE: &str = r#"Note: this item is generated based on `riotapi-schema`."#; + +fn spec() -> impl Future { + static SPEC: tokio::sync::OnceCell = tokio::sync::OnceCell::const_new(); + SPEC.get_or_init(|| get("http://www.mingweisamuel.com/riotapi-schema/openapi-3.0.0.json")) +} + +pub fn autogen(src_dir: impl AsRef, consts_dir: impl AsRef) { + let src_dir = src_dir.as_ref(); + let consts_dir = consts_dir.as_ref(); + + let endpoints_gen = async { + let spec = spec().await; + write(src_dir, "endpoints.gen.rs", endpoints::endpoints(spec)).await; + }; + let meta_gen = async { + let spec = spec().await; + write(src_dir, "meta.gen.rs", meta::meta(spec)).await; + }; + let models_gen = async { + let spec = spec().await; + write(src_dir, "models.gen.rs", models::models(spec)).await; + }; + + let champions_gen = async { + let champions = get::>( + "http://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json" + ); + write( + consts_dir, + "champion.gen.rs", + champion::champion(&champions.await), + ) + .await; + }; + let game_mode_gen = async { + let game_modes = + get::>("http://www.mingweisamuel.com/riotapi-schema/enums/gameModes.json"); + write( + consts_dir, "game_mode.gen.rs", + enum_unknown::enum_unknown( + &game_modes.await, + parse_quote!(GameMode), + parse_quote!(u8), + "League of Legends game mode, such as Classic, ARAM, URF, One For All, Ascension, etc.", + ), + ) + .await; + }; + let game_type_gen = async { + let game_types = + get::>("http://www.mingweisamuel.com/riotapi-schema/enums/gameTypes.json"); + write( + consts_dir, + "game_type.gen.rs", + game_type::game_type(&game_types.await), + ) + .await; + }; + let maps_gen = async { + let maps = get::>("http://www.mingweisamuel.com/riotapi-schema/enums/maps.json"); + write( + consts_dir, + "map.gen.rs", + newtype_enum::newtype_enum( + &maps.await, + parse_quote!(Map), + parse_quote!(u8), + "A League of Legends map.", + ), + ) + .await; + }; + let queue_gen = async { + let queues = get::>("http://www.mingweisamuel.com/riotapi-schema/enums/queues.json"); + write( + consts_dir, + "queue.gen.rs", + newtype_enum::newtype_enum( + &queues.await, + parse_quote!(Queue), + parse_quote!(u16), + "A League of Legends matchmaking queue.", + ), + ) + .await; + }; + let queue_type_gen = async { + let queue_types = + get::>("http://www.mingweisamuel.com/riotapi-schema/enums/queueTypes.json"); + write( + consts_dir, + "queue_type.gen.rs", + enum_unknown::enum_unknown( + &queue_types.await, + parse_quote!(QueueType), + parse_quote!(u8), + "LoL or TFT queue types.", + ), + ) + .await; + }; + let route_gen = async { + let routes_table = get("http://www.mingweisamuel.com/riotapi-schema/routesTable.json"); + write( + consts_dir, + "route.gen.rs", + route::route(&routes_table.await), + ) + .await; + }; + let season_gen = async { + let seasons = + get::>("http://www.mingweisamuel.com/riotapi-schema/enums/seasons.json"); + write( + consts_dir, + "season.gen.rs", + newtype_enum::newtype_enum( + &seasons.await, + parse_quote!(Season), + parse_quote!(u8), + "A League of Legends season for competitive matchmaking.", + ), + ) + .await + }; + + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async move { + tokio::join!( + champions_gen, + endpoints_gen, + meta_gen, + models_gen, + season_gen, + queue_gen, + queue_type_gen, + game_mode_gen, + game_type_gen, + maps_gen, + route_gen, + ); + }) +} + +async fn write(dir: &Path, filename: &str, file: syn::File) { + use std::io::Write; + + let path = dir.join(filename); + let mut writer = std::io::BufWriter::new(std::fs::File::create(path).unwrap()); + let contents = prettyplease::unparse(&file); + let version = &*spec().await.info.version; + tokio::task::spawn_blocking(move || { + writeln!( + writer, + "// http://www.mingweisamuel.com/riotapi-schema/tool/" + )?; + writeln!(writer, "// Version: {}", version)?; + writeln!(writer)?; + writeln!(writer, "{}", contents)?; + Ok::<(), std::io::Error>(()) + }) + .await + .unwrap() + .unwrap() +} + +fn get(url: &str) -> impl use<'_, T> + Future { + static CLIENT: std::sync::OnceLock = std::sync::OnceLock::new(); + let client = CLIENT.get_or_init(|| { + reqwest::Client::builder() + .user_agent("riven") + .build() + .unwrap() + }); + async move { + let bytes = client + .get(url) + .send() + .await + .unwrap() + .error_for_status() + .unwrap() + .bytes() + .await + .unwrap(); + serde_json::from_slice::(&bytes).unwrap() + } +} + +fn process_description(description: &str) -> impl Iterator> { + description.lines().map(str::trim).map(|line| { + let mut line = Cow::Borrowed(line); + let mut i = 0; + while let Some(url_start) = line[i..] + .find("https://") + .or_else(|| line[i..].find("http://")) + .map(|j| i + j) + { + let mut url_end = line[url_start..] + .find(char::is_whitespace) + .map_or(line.len(), |j| url_start + j); + while line.as_bytes().get(url_end - 1) == Some(&b'.') { + url_end -= 1; + } + + let mut_line = line.to_mut(); + mut_line.insert(url_end, '>'); + mut_line.insert(url_start, '<'); + + i = url_end + 1; + } + line + }) +} diff --git a/riven/build/autogen/models.rs b/riven/build/autogen/models.rs new file mode 100644 index 00000000..06297ae9 --- /dev/null +++ b/riven/build/autogen/models.rs @@ -0,0 +1,145 @@ +use std::borrow::Cow; +use std::collections::HashSet; + +use heck::{ToPascalCase, ToSnakeCase}; +use indexmap::IndexMap; +use proc_macro2::Span; +use quote::quote; +use syn::{parse_quote, File, Ident}; + +use super::spec::{ + normalize_prop_name, normalize_schema_name, prop_to_type, Schema, SchemaEnum, SchemaOrRef, Spec, +}; +use super::{process_description, CODEGEN_NOTE}; + +pub fn models(spec: &Spec) -> File { + let mut schemas_by_endpoint = IndexMap::<_, Vec<_>>::new(); + for (schema_key, schema) in spec.components.schemas.iter() { + if "Error" == *schema_key { + continue; + } + let endpoint = schema_key.split_once('.').unwrap().0; + schemas_by_endpoint + .entry(endpoint) + .or_default() + .push((schema_key, schema)); + } + + let endpoint_modules = schemas_by_endpoint.into_iter().map(|(endpoint, schemas)| { + let endpoint_ident = Ident::new(&endpoint.to_snake_case(), Span::call_site()); + let doc = format!( + "Data structs used by [`{0}`](crate::endpoints::{0})", + endpoint.to_pascal_case() + ); + + let schemas = schemas + .into_iter() + .map::(|(schema_key, schema)| { + let schema_name_raw = schema_key.split_once('.').unwrap().1; + let schema_ident = normalize_schema_name(schema_name_raw); + let SchemaOrRef::Schema(Schema { + schema: + SchemaEnum::Object { + title: _, + properties, + required, + additional_properties: _, + x_key: _, + }, + description, + x_type: _, + x_alias: _, + }) = &schema + else { + panic!("Schema for `{}` is not an object: {:?}", schema_key, schema); + }; + let required = required.iter().flatten().collect::>(); + + // Field docs + let mut docs = vec![Cow::Owned(format!("`{}.{}` data object.", endpoint, schema_name_raw))]; + if let Some(description) = description { + docs.push("".into()); + docs.push("# Description".into()); + docs.extend(process_description(description)); + } + + // Generate the fields + let mut dedup_names = HashSet::new(); + let fields = properties.iter().flatten().map(|(prop_key, prop)| { + let optional = !required.contains(prop_key); + let prop_name = normalize_prop_name(prop_key, Some(&mut dedup_names)); + + // Docs + let mut docs = prop + .description() + .into_iter() + .flat_map(process_description) + .collect::>(); + + // Serde attributes + let mut serde_metas = vec![quote!(rename = #prop_key)]; + if let Some(alias) = prop.x_alias() { + serde_metas.push(quote!(alias = #alias)); + } + if optional { + serde_metas.push(quote!(default)); + serde_metas.push(quote!(skip_serializing_if = "Option::is_none")); + } + + let mut deprecated = None; + let mut ty = prop_to_type(prop, optional, true); + + // Special handling for specific fields + if "championId" == prop_key && prop.description().is_some_and(|d| d.contains("this field returned invalid championIds")) { + docs.push("".into()); + docs.push("Instead use [`Self::champion()`] which checks this field then parses [`Self::champion_name`].".into()); + docs.push("".into()); + deprecated = Some(quote!(#[deprecated(since = "2.5.0", note = "Use `Participant.champion()` instead. Riot sometimes returns corrupted data for this field: https://github.com/RiotGames/developer-relations/issues/553")])); + serde_metas.push(quote!(serialize_with = "crate::consts::Champion::serialize_result")); + serde_metas.push(quote!(deserialize_with = "crate::consts::Champion::deserialize_result")); + ty = parse_quote!(Result); + } + else if "gameType" == prop_key && "InfoDto" == schema_name_raw && "match-v5" == endpoint { + docs.push("".into()); + docs.push("Will be `None` if empty string is returned: ".into()); + serde_metas.push(quote!(serialize_with = "crate::consts::serialize_empty_string_none")); + serde_metas.push(quote!(deserialize_with = "crate::consts::deserialize_empty_string_none")); + ty = parse_quote!(Option<#ty>); + } + + quote! { + #( #[doc = #docs] )* + #deprecated + #[serde( #( #serde_metas ),* )] + pub #prop_name: #ty, + } + }); + + parse_quote! { + #( #[doc = #docs] )* + /// + #[doc = #CODEGEN_NOTE] + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct #schema_ident { + #( #fields )* + } + } + }); + + quote! { + #[doc = #doc] + /// + #[doc = #CODEGEN_NOTE] + #[allow(dead_code)] + pub mod #endpoint_ident { + #( #schemas )* + } + } + }); + + parse_quote! { + #( #endpoint_modules )* + } +} diff --git a/riven/build/autogen/newtype_enum.rs b/riven/build/autogen/newtype_enum.rs new file mode 100644 index 00000000..712b8a65 --- /dev/null +++ b/riven/build/autogen/newtype_enum.rs @@ -0,0 +1,65 @@ +use proc_macro2::{Literal, Span}; +use quote::quote; +use syn::{parse_quote, File, Ident}; + +#[derive(Debug, serde::Deserialize)] +pub struct EnumInt { + pub notes: Option, + #[serde(rename = "x-value")] + pub x_value: u32, + #[serde(rename = "x-deprecated")] + pub x_deprecated: Option, + #[serde(rename = "x-desc")] + pub x_desc: Option, + #[serde(rename = "x-name")] + pub x_name: String, +} + +pub fn newtype_enum(variants: &[EnumInt], ident: Ident, repr: Ident, description: &str) -> File { + let variants = variants.iter().map( + |EnumInt { + notes, + x_value, + x_deprecated, + x_desc, + x_name, + }| { + let doc = format!("`{}`", x_value); + let mut docs = vec![&*doc]; + if let Some(desc) = x_desc { + docs.extend(desc.lines().map(str::trim)); + } + if let Some(notes) = notes { + if !docs.contains(&&**notes) { + docs.push(""); + docs.push(notes); + } + } + let deprecated_attr = x_deprecated.unwrap_or_default().then(|| { + quote! { + #[deprecated(note = #notes)] + } + }); + let ident = Ident::new(x_name, Span::call_site()); + let value = Literal::u32_unsuffixed(*x_value); + quote! { + #( + #[doc = #docs] + )* + #deprecated_attr + #ident = #value, + } + }, + ); + + parse_quote! { + #[macro_rules_attribute::apply(newtype_enum)] + #[repr(#repr)] + #[doc = #description] + pub enum #ident { + #( + #variants + )* + } + } +} diff --git a/riven/build/autogen/route.rs b/riven/build/autogen/route.rs new file mode 100644 index 00000000..5e088990 --- /dev/null +++ b/riven/build/autogen/route.rs @@ -0,0 +1,275 @@ +use indexmap::IndexMap; +use proc_macro2::{Literal, Span}; +use quote::quote; +use syn::{parse_quote, File, Ident, ItemEnum}; + +#[derive(Debug, serde::Deserialize)] +pub struct RoutesTable { + pub regional: IndexMap, + pub platform: IndexMap, + #[serde(rename = "val-platform")] + pub val_platform: IndexMap, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Route { + pub id: u8, + pub description: String, + pub deprecated: Option, + #[serde(rename = "altName")] + pub alt_name: Option, + #[serde(rename = "tournamentRegion")] + pub tournament_region: Option, + #[serde(rename = "regionalRoute")] + pub regional_route: Option, + #[serde(rename = "regionalRouteLor")] + pub regional_route_lor: Option, +} + +pub fn make_enum(routes: &IndexMap, ident: Ident, description: &str) -> ItemEnum { + let variants = routes.iter().map( + |( + route_name, + Route { + id, + description, + deprecated, + alt_name, + .. + }, + )| { + let route_name = route_name.to_ascii_uppercase(); + let docs = description.lines().map(str::trim); + let doc_repr = format!("`{}` (riotapi-schema ID/repr)", id); + let deprecated_attr = deprecated + .unwrap_or_default() + .then(|| quote!(#[deprecated])); + let serialize = alt_name + .as_deref() + .filter(|&alt_name| route_name != alt_name) + // Note: strum(serialize = ...) actually specifies extra **De**serialization values. + .map(|alt_name| quote!(serialize = #alt_name)); + let key = Ident::new(&route_name, Span::call_site()); + let value = Literal::u8_unsuffixed(*id); + + quote! { + #( #[doc = #docs] )* + /// + #[doc = #doc_repr] + #deprecated_attr + #[strum(to_string=#route_name, #serialize)] + #key = #value, + } + }, + ); + parse_quote! { + #[doc = #description] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] + #[derive(IntoPrimitive, TryFromPrimitive)] + #[derive(EnumString, EnumIter, Display, IntoStaticStr)] + #[repr(u8)] + #[non_exhaustive] + pub enum #ident { + #( + #variants + )* + } + } +} + +pub fn route(routes_table: &RoutesTable) -> File { + let regional_route = make_enum( + &routes_table.regional, + parse_quote!(RegionalRoute), + "Regional routes, used in tournament services, Legends of Runeterra (LoR), and some other endpoints.", + ); + + let platform_route = make_enum( + &routes_table.platform, + parse_quote!(PlatformRoute), + "Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR).", + ); + let platform_route_impl = { + let route_idents = routes_table + .platform + .keys() + .map(|route_name| Ident::new(&route_name.to_ascii_uppercase(), Span::call_site())) + .collect::>(); + + let regional_idents = routes_table.platform.values().map(|route| { + Ident::new( + &route + .regional_route + .as_deref() + .unwrap() + .to_ascii_uppercase(), + Span::call_site(), + ) + }); + + let lor_idents = routes_table.platform.values().map(|route| { + Ident::new( + &route + .regional_route_lor + .as_deref() + .unwrap() + .to_ascii_uppercase(), + Span::call_site(), + ) + }); + + let tournament_regions = routes_table.platform.values().map(|route| { + route + .tournament_region + .as_deref() + .map(|tournament_region| { + let ident = Ident::new(tournament_region, Span::call_site()); + quote!(Some(TournamentRegion::#ident)) + }) + .unwrap_or(quote!(None)) + }); + + let alt_names = routes_table.platform.iter().map(|(route_name, route)| { + route + .alt_name + .as_deref() + .map(|alt_name| quote!(#alt_name)) + .unwrap_or_else(|| { + let route_name = route_name.to_ascii_uppercase(); + quote!(#route_name) + }) + }); + + quote! { + impl PlatformRoute { + /// Converts this [`PlatformRoute`] into its corresponding + /// [`RegionalRoute`] for LoL and TFT match endpoints such as + /// [`match-v5`](crate::endpoints::MatchV5). + pub fn to_regional(self) -> RegionalRoute { + match self { + #( + Self::#route_idents => RegionalRoute::#regional_idents, + )* + } + } + + /// Converts this [`PlatformRoute`] into its corresponding + /// [`RegionalRoute`] for LoR endpoints such as + /// [`lor-match-v1`](crate::endpoints::LorMatchV1). + pub fn to_regional_lor(self) -> RegionalRoute { + match self { + #( + Self::#route_idents => RegionalRoute::#lor_idents, + )* + } + } + + /// Used in the LoL Tournament API. Specifically + /// [`tournament-stub-v5.registerProviderData`](crate::endpoints::TournamentStubV5::register_provider_data) + /// and [`tournament-v5.registerProviderData`](crate::endpoints::TournamentV5::register_provider_data). + /// + /// Returns `None` if the corresponding tournament region is unknown: . + pub fn to_tournament_region(self) -> Option { + match self { + #( + Self::#route_idents => #tournament_regions, + )* + } + } + + /// Get the slightly more human-friendly alternate name for this `PlatformRoute`. Specifically + /// excludes any trailing numbers and appends extra N(orth), S(outh), E(ast), and/or W(est) + /// suffixes to some names. Some of these are old region names which are often still used as + /// user-facing names, e.g. on op.gg. + /// + /// Note these strings *are* handled by the `FromStr` implementation, if you wish to parse them + /// back into `PlatformRoute`s. + pub fn as_region_str(self) -> &'static str { + match self { + #( + Self::#route_idents => #alt_names, + )* + } + } + } + } + }; + + let val_platform_route = make_enum( + &routes_table.val_platform, + parse_quote!(ValPlatformRoute), + "Platform routes for Valorant.", + ); + + let tournament_region = { + let mut variants = routes_table + .platform + .values() + .filter_map(|route| { + route + .tournament_region + .as_deref() + .map(|tournament_region| (tournament_region, route)) + }) + .collect::>(); + variants.sort_unstable_by_key(|(_, region)| region.id); + + let variants = variants.into_iter().map( + |( + tournament_region, + Route { + id, + description, + deprecated, + .. + }, + )| { + let docs = description.lines().map(str::trim); + let doc_repr = format!("`{}` (riotapi-schema ID/repr)", id); + let deprecated_attr = deprecated + .unwrap_or_default() + .then(|| quote!(#[deprecated])); + let key = Ident::new(tournament_region, Span::call_site()); + let value = Literal::u8_unsuffixed(*id); + + quote! { + #( #[doc = #docs] )* + /// + #[doc = #doc_repr] + #deprecated_attr + #key = #value, + } + }, + ); + quote! { + /// Tournament regions for League of Legends (LoL) used in + /// [`TournamentStubV5`](crate::endpoints::TournamentStubV5) + /// and [`TournamentV5`](crate::endpoints::TournamentV5). + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] + #[derive(IntoPrimitive, TryFromPrimitive)] + #[derive(EnumString, EnumIter, Display, IntoStaticStr)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[repr(u8)] + #[non_exhaustive] + pub enum TournamentRegion { + #( + #variants + )* + } + } + }; + + parse_quote! { + use num_enum::{IntoPrimitive, TryFromPrimitive}; + use strum_macros::{Display, EnumIter, EnumString, IntoStaticStr}; + + #regional_route + + #platform_route + #platform_route_impl + + #val_platform_route + + #tournament_region + } +} diff --git a/riven/build/autogen/spec.rs b/riven/build/autogen/spec.rs new file mode 100644 index 00000000..758b0bc7 --- /dev/null +++ b/riven/build/autogen/spec.rs @@ -0,0 +1,318 @@ +#![allow(dead_code)] + +use std::collections::HashSet; + +use heck::{ToPascalCase, ToSnakeCase}; +use indexmap::IndexMap; +use proc_macro2::Span; +use serde_json::Value; +use syn::{parse_quote, Ident, Type}; + +#[derive(Debug, serde::Deserialize)] +pub struct Spec { + pub openapi: String, + pub info: Info, + // pub servers: Vec, + pub paths: IndexMap, + pub components: Components, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Info { + pub title: String, + pub version: String, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Path { + pub get: Option, + pub post: Option, + pub put: Option, + pub delete: Option, + pub patch: Option, + pub options: Option, + pub head: Option, + #[serde(rename = "x-endpoint")] + pub x_endpoint: Option, + #[serde(rename = "x-platforms-available")] + pub x_platforms_available: Option>, + #[serde(rename = "x-route-enum")] + pub x_route_enum: Option, +} +impl Path { + pub fn iter_operations(&self) -> impl Iterator { + IntoIterator::into_iter([ + ("get", &self.get), + ("post", &self.post), + ("put", &self.put), + ("delete", &self.delete), + ("patch", &self.patch), + ("options", &self.options), + ("head", &self.head), + ]) + .filter_map(|(method, op)| op.as_ref().map(|op| (method, op))) + } +} + +#[derive(Debug, serde::Deserialize)] +pub struct Operation { + pub tags: Vec, + pub summary: String, + pub description: String, + #[serde(rename = "operationId")] + pub operation_id: String, + pub parameters: Option>, + #[serde(rename = "externalDocs")] + pub external_docs: ExternalDocs, + #[serde(rename = "requestBody")] + pub request_body: Option, + pub responses: Responses, + pub security: Option>>>, + #[serde(rename = "x-route-enum")] + pub x_route_enum: String, + #[serde(rename = "x-nullable-404")] + pub x_nullable_404: Option, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Parameter { + pub name: String, + pub r#in: String, + pub schema: SchemaOrRef, + pub required: bool, + pub description: Option, +} + +#[derive(Debug, serde::Deserialize)] +pub struct RequestBody { + pub content: IndexMap, + pub required: bool, + pub description: Option, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Responses { + #[serde(rename = "200")] + pub ok: Response, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Response { + pub description: String, + pub content: Option>, +} + +#[derive(Debug, serde::Deserialize)] +pub struct MediaType { + pub schema: SchemaOrRef, + pub encoding: Option>, +} + +#[derive(Clone, Debug, serde::Deserialize)] +#[serde(untagged)] +pub enum SchemaOrRef { + Schema(Schema), + Ref { + #[serde(rename = "$ref")] + r#ref: String, + #[serde(rename = "x-type")] + x_type: Option, + }, +} +impl SchemaOrRef { + pub fn schema_enum(&self) -> Option<&SchemaEnum> { + match self { + SchemaOrRef::Schema(Schema { + schema: schema_enum, + .. + }) => Some(schema_enum), + _ => None, + } + } + pub fn description(&self) -> Option<&str> { + match self { + SchemaOrRef::Schema(schema_real) => schema_real.description.as_deref(), + _ => None, + } + } + pub fn x_alias(&self) -> Option<&str> { + match self { + SchemaOrRef::Schema(schema_real) => schema_real.x_alias.as_deref(), + _ => None, + } + } +} + +#[derive(Clone, Debug, serde::Deserialize)] +pub struct Schema { + #[serde(flatten)] + pub schema: SchemaEnum, + pub description: Option, + #[serde(rename = "x-type")] + pub x_type: Option, + #[serde(rename = "x-alias")] + pub x_alias: Option, +} +impl Schema { + fn x_enum(&self) -> Option<&str> { + match &self.schema { + SchemaEnum::String { x_enum, .. } => x_enum.as_deref(), + SchemaEnum::Integer { x_enum, .. } => x_enum.as_deref(), + _ => None, + } + } +} + +#[derive(Clone, Debug, serde::Deserialize)] +#[serde(tag = "type")] +pub enum SchemaEnum { + #[serde(rename = "array")] + Array { + #[serde(rename = "items")] + items: Box, + }, + #[serde(rename = "object")] + Object { + title: Option, + #[serde(rename = "properties")] + properties: Option>, + #[serde(rename = "required")] + required: Option>, + #[serde(rename = "additionalProperties")] + additional_properties: Option>, + #[serde(rename = "x-key")] + x_key: Option>, + }, + #[serde(rename = "string")] + String { + #[serde(rename = "enum")] + r#enum: Option>, + #[serde(rename = "x-enum")] + x_enum: Option, + }, + #[serde(rename = "integer")] + Integer { + format: Option, + #[serde(rename = "x-enum")] + x_enum: Option, + }, + #[serde(rename = "number")] + Number { format: String }, + #[serde(rename = "boolean")] + Boolean, +} + +#[derive(Debug, serde::Deserialize)] +pub struct ExternalDocs { + pub description: String, + pub url: String, +} + +#[derive(Debug, serde::Deserialize)] +pub struct Components { + pub schemas: IndexMap, + // #[serde(rename = "securitySchemes")] + // security_schemes: IndexMap, +} + +pub fn normalize_schema_name(schema_name: &str) -> Ident { + let schema_name = schema_name.replace("DTO", "").replace("Dto", ""); + Ident::new(&schema_name, Span::call_site()) +} + +pub fn normalize_prop_name(prop_name: &str, dedup_names: Option<&mut HashSet>) -> Ident { + let mut prop_name = prop_name.to_snake_case(); + if prop_name.starts_with(|c| char::is_ascii_digit(&c)) { + prop_name = format!("x{}", prop_name); + } + + if let Some(names) = dedup_names { + while names.contains(&prop_name) { + prop_name.push('_'); + } + names.insert(prop_name.clone()); + } + + if "type" == prop_name { + Ident::new_raw(&prop_name, Span::call_site()) + } else { + Ident::new(&prop_name, Span::call_site()) + } +} + +pub fn prop_to_type(prop: &SchemaOrRef, optional: bool, owned: bool) -> Type { + if optional { + let prop = prop_to_type(prop, false, owned); + return parse_quote!(Option<#prop>); + } + let schema = match prop { + SchemaOrRef::Schema(schema) => schema, + SchemaOrRef::Ref { r#ref, .. } => { + let (endpoint, schema) = r#ref + .strip_prefix("#/components/schemas/") + .unwrap() + .split_once('.') + .unwrap(); + let endpoint = Ident::new(&endpoint.to_snake_case(), Span::call_site()); + let schema = normalize_schema_name(schema); + return parse_quote!(crate::models::#endpoint::#schema); + } + }; + + if let Some(x_enum) = schema.x_enum() { + if "locale" != x_enum { + let enum_ident = Ident::new(&x_enum.to_pascal_case(), Span::call_site()); + return parse_quote!(crate::consts::#enum_ident); + }; + } + match &schema.schema { + SchemaEnum::Array { items } => { + let subtype = prop_to_type(items, false, owned); + if owned { + parse_quote!(Vec<#subtype>) + } else { + parse_quote!(&[#subtype]) + } + } + SchemaEnum::Object { + title: _, + properties, + required, + additional_properties, + x_key, + } => { + assert!( + properties.is_none(), + "Schema for is nested object, cannot turn into type name", + ); + assert!(required.is_none()); + + if let (Some(keys), Some(values)) = (x_key, additional_properties) { + let key_type = prop_to_type(keys, false, owned); + let value_type = prop_to_type(values, false, owned); + parse_quote!(::std::collections::HashMap::<#key_type, #value_type>) + } else { + // Only `{ "type": "object" }`. + parse_quote!(crate::serde_json::Map::) + } + } + SchemaEnum::String { .. } => { + if owned { + parse_quote!(String) + } else { + parse_quote!(&str) + } + } + SchemaEnum::Integer { format, .. } => match format.as_deref().unwrap() { + "int32" => parse_quote!(i32), + "int64" => parse_quote!(i64), + unknown => panic!("Unknown integer format: {}", unknown), + }, + SchemaEnum::Number { format } => match &**format { + "float" => parse_quote!(f32), + "double" => parse_quote!(f64), + unknown => panic!("Unknown number format: {}", unknown), + }, + SchemaEnum::Boolean => parse_quote!(bool), + } +} diff --git a/riven/build/main.rs b/riven/build/main.rs new file mode 100644 index 00000000..a617a9d6 --- /dev/null +++ b/riven/build/main.rs @@ -0,0 +1,42 @@ +// `cargo:rustc-check-cfg` doesn't silence warnings within the build script. +#![allow(unexpected_cfgs)] + +#[cfg(riven_autogen)] +pub mod autogen; + +pub fn main() { + const RIVEN_AUTOGEN_NONCE: &str = "RIVEN_AUTOGEN_NONCE"; + const RIVEN_AUTOGEN_DEVMODE: &str = "RIVEN_AUTOGEN_DEVMODE"; + const CFG_RIVEN_AUTOGEN: &str = "riven_autogen"; + const CFG_RIVEN_AUTOGEN_OUTDIR: &str = "riven_autogen_outdir"; + + println!("cargo:rerun-if-changed=build"); + println!("cargo:rerun-if-env-changed={}", RIVEN_AUTOGEN_NONCE); + println!("cargo:rerun-if-env-changed={}", RIVEN_AUTOGEN_DEVMODE); + println!("cargo:rustc-check-cfg=cfg({})", CFG_RIVEN_AUTOGEN); + println!("cargo:rustc-check-cfg=cfg({})", CFG_RIVEN_AUTOGEN_OUTDIR); + + #[cfg(riven_autogen)] + { + match std::env::var(RIVEN_AUTOGEN_DEVMODE) + .ok() + .map(|s| str::to_ascii_lowercase(&s)) + .as_deref() + { + None | Some("outdir") => { + println!("cargo:rustc-cfg={}", CFG_RIVEN_AUTOGEN_OUTDIR); + let out_dir = std::env::var_os("OUT_DIR").unwrap(); + autogen::autogen(&*out_dir, &*out_dir); + } + Some("src") => { + autogen::autogen("src", "src/consts"); + } + Some("none") => { + // Do nothing. + } + Some(other) => { + panic!("Unknown {}: {:?}", RIVEN_AUTOGEN_DEVMODE, other); + } + } + } +} diff --git a/riven/src/consts/champion.gen.rs b/riven/src/consts/champion.gen.rs new file mode 100644 index 00000000..055b121e --- /dev/null +++ b/riven/src/consts/champion.gen.rs @@ -0,0 +1,1257 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +#[macro_rules_attribute::apply(newtype_enum)] +#[repr(i16)] +/// A League of Legends champion. +/// +/// This newtype acts as a C-like enum; each variant corresponds to an +/// integer value. Using a newtype allows _unknown_ variants to be +/// represented. This is important when Riot adds new champions. +/// +/// Field | Name | Identifier | Id +/// ---|---|---|--- +/// `NONE` | None (no ban) | | -1 +///`1` | Annie | Annie | 1 +///`2` | Olaf | Olaf | 2 +///`3` | Galio | Galio | 3 +///`4` | Twisted Fate | TwistedFate | 4 +///`5` | Xin Zhao | XinZhao | 5 +///`6` | Urgot | Urgot | 6 +///`7` | LeBlanc | Leblanc | 7 +///`8` | Vladimir | Vladimir | 8 +///`9` | Fiddlesticks | FiddleSticks | 9 +///`10` | Kayle | Kayle | 10 +///`11` | Master Yi | MasterYi | 11 +///`12` | Alistar | Alistar | 12 +///`13` | Ryze | Ryze | 13 +///`14` | Sion | Sion | 14 +///`15` | Sivir | Sivir | 15 +///`16` | Soraka | Soraka | 16 +///`17` | Teemo | Teemo | 17 +///`18` | Tristana | Tristana | 18 +///`19` | Warwick | Warwick | 19 +///`20` | Nunu & Willump | Nunu | 20 +///`21` | Miss Fortune | MissFortune | 21 +///`22` | Ashe | Ashe | 22 +///`23` | Tryndamere | Tryndamere | 23 +///`24` | Jax | Jax | 24 +///`25` | Morgana | Morgana | 25 +///`26` | Zilean | Zilean | 26 +///`27` | Singed | Singed | 27 +///`28` | Evelynn | Evelynn | 28 +///`29` | Twitch | Twitch | 29 +///`30` | Karthus | Karthus | 30 +///`31` | Cho'Gath | Chogath | 31 +///`32` | Amumu | Amumu | 32 +///`33` | Rammus | Rammus | 33 +///`34` | Anivia | Anivia | 34 +///`35` | Shaco | Shaco | 35 +///`36` | Dr. Mundo | DrMundo | 36 +///`37` | Sona | Sona | 37 +///`38` | Kassadin | Kassadin | 38 +///`39` | Irelia | Irelia | 39 +///`40` | Janna | Janna | 40 +///`41` | Gangplank | Gangplank | 41 +///`42` | Corki | Corki | 42 +///`43` | Karma | Karma | 43 +///`44` | Taric | Taric | 44 +///`45` | Veigar | Veigar | 45 +///`48` | Trundle | Trundle | 48 +///`50` | Swain | Swain | 50 +///`51` | Caitlyn | Caitlyn | 51 +///`53` | Blitzcrank | Blitzcrank | 53 +///`54` | Malphite | Malphite | 54 +///`55` | Katarina | Katarina | 55 +///`56` | Nocturne | Nocturne | 56 +///`57` | Maokai | Maokai | 57 +///`58` | Renekton | Renekton | 58 +///`59` | Jarvan IV | JarvanIV | 59 +///`60` | Elise | Elise | 60 +///`61` | Orianna | Orianna | 61 +///`62` | Wukong | MonkeyKing | 62 +///`63` | Brand | Brand | 63 +///`64` | Lee Sin | LeeSin | 64 +///`67` | Vayne | Vayne | 67 +///`68` | Rumble | Rumble | 68 +///`69` | Cassiopeia | Cassiopeia | 69 +///`72` | Skarner | Skarner | 72 +///`74` | Heimerdinger | Heimerdinger | 74 +///`75` | Nasus | Nasus | 75 +///`76` | Nidalee | Nidalee | 76 +///`77` | Udyr | Udyr | 77 +///`78` | Poppy | Poppy | 78 +///`79` | Gragas | Gragas | 79 +///`80` | Pantheon | Pantheon | 80 +///`81` | Ezreal | Ezreal | 81 +///`82` | Mordekaiser | Mordekaiser | 82 +///`83` | Yorick | Yorick | 83 +///`84` | Akali | Akali | 84 +///`85` | Kennen | Kennen | 85 +///`86` | Garen | Garen | 86 +///`89` | Leona | Leona | 89 +///`90` | Malzahar | Malzahar | 90 +///`91` | Talon | Talon | 91 +///`92` | Riven | Riven | 92 +///`96` | Kog'Maw | KogMaw | 96 +///`98` | Shen | Shen | 98 +///`99` | Lux | Lux | 99 +///`101` | Xerath | Xerath | 101 +///`102` | Shyvana | Shyvana | 102 +///`103` | Ahri | Ahri | 103 +///`104` | Graves | Graves | 104 +///`105` | Fizz | Fizz | 105 +///`106` | Volibear | Volibear | 106 +///`107` | Rengar | Rengar | 107 +///`110` | Varus | Varus | 110 +///`111` | Nautilus | Nautilus | 111 +///`112` | Viktor | Viktor | 112 +///`113` | Sejuani | Sejuani | 113 +///`114` | Fiora | Fiora | 114 +///`115` | Ziggs | Ziggs | 115 +///`117` | Lulu | Lulu | 117 +///`119` | Draven | Draven | 119 +///`120` | Hecarim | Hecarim | 120 +///`121` | Kha'Zix | Khazix | 121 +///`122` | Darius | Darius | 122 +///`126` | Jayce | Jayce | 126 +///`127` | Lissandra | Lissandra | 127 +///`131` | Diana | Diana | 131 +///`133` | Quinn | Quinn | 133 +///`134` | Syndra | Syndra | 134 +///`136` | Aurelion Sol | AurelionSol | 136 +///`141` | Kayn | Kayn | 141 +///`142` | Zoe | Zoe | 142 +///`143` | Zyra | Zyra | 143 +///`145` | Kai'Sa | Kaisa | 145 +///`147` | Seraphine | Seraphine | 147 +///`150` | Gnar | Gnar | 150 +///`154` | Zac | Zac | 154 +///`157` | Yasuo | Yasuo | 157 +///`161` | Vel'Koz | Velkoz | 161 +///`163` | Taliyah | Taliyah | 163 +///`164` | Camille | Camille | 164 +///`166` | Akshan | Akshan | 166 +///`200` | Bel'Veth | Belveth | 200 +///`201` | Braum | Braum | 201 +///`202` | Jhin | Jhin | 202 +///`203` | Kindred | Kindred | 203 +///`221` | Zeri | Zeri | 221 +///`222` | Jinx | Jinx | 222 +///`223` | Tahm Kench | TahmKench | 223 +///`233` | Briar | Briar | 233 +///`234` | Viego | Viego | 234 +///`235` | Senna | Senna | 235 +///`236` | Lucian | Lucian | 236 +///`238` | Zed | Zed | 238 +///`240` | Kled | Kled | 240 +///`245` | Ekko | Ekko | 245 +///`246` | Qiyana | Qiyana | 246 +///`254` | Vi | Vi | 254 +///`266` | Aatrox | Aatrox | 266 +///`267` | Nami | Nami | 267 +///`268` | Azir | Azir | 268 +///`350` | Yuumi | Yuumi | 350 +///`360` | Samira | Samira | 360 +///`412` | Thresh | Thresh | 412 +///`420` | Illaoi | Illaoi | 420 +///`421` | Rek'Sai | RekSai | 421 +///`427` | Ivern | Ivern | 427 +///`429` | Kalista | Kalista | 429 +///`432` | Bard | Bard | 432 +///`497` | Rakan | Rakan | 497 +///`498` | Xayah | Xayah | 498 +///`516` | Ornn | Ornn | 516 +///`517` | Sylas | Sylas | 517 +///`518` | Neeko | Neeko | 518 +///`523` | Aphelios | Aphelios | 523 +///`526` | Rell | Rell | 526 +///`555` | Pyke | Pyke | 555 +///`711` | Vex | Vex | 711 +///`777` | Yone | Yone | 777 +///`799` | Ambessa | Ambessa | 799 +///`800` | Mel | Mel | 800 +///`875` | Sett | Sett | 875 +///`876` | Lillia | Lillia | 876 +///`887` | Gwen | Gwen | 887 +///`888` | Renata Glasc | Renata | 888 +///`893` | Aurora | Aurora | 893 +///`895` | Nilah | Nilah | 895 +///`897` | K'Sante | KSante | 897 +///`901` | Smolder | Smolder | 901 +///`902` | Milio | Milio | 902 +///`910` | Hwei | Hwei | 910 +///`950` | Naafiri | Naafiri | 950 +pub enum Champion { + /// `-1`, none. Appears when a champion ban is not used in champ select. + NONE = -1, + ///`1` + ANNIE = 1, + ///`2` + OLAF = 2, + ///`3` + GALIO = 3, + ///`4` + TWISTED_FATE = 4, + ///`5` + XIN_ZHAO = 5, + ///`6` + URGOT = 6, + ///`7` + LEBLANC = 7, + ///`8` + VLADIMIR = 8, + ///`9` + FIDDLE_STICKS = 9, + ///`10` + KAYLE = 10, + ///`11` + MASTER_YI = 11, + ///`12` + ALISTAR = 12, + ///`13` + RYZE = 13, + ///`14` + SION = 14, + ///`15` + SIVIR = 15, + ///`16` + SORAKA = 16, + ///`17` + TEEMO = 17, + ///`18` + TRISTANA = 18, + ///`19` + WARWICK = 19, + ///`20` + NUNU = 20, + ///`21` + MISS_FORTUNE = 21, + ///`22` + ASHE = 22, + ///`23` + TRYNDAMERE = 23, + ///`24` + JAX = 24, + ///`25` + MORGANA = 25, + ///`26` + ZILEAN = 26, + ///`27` + SINGED = 27, + ///`28` + EVELYNN = 28, + ///`29` + TWITCH = 29, + ///`30` + KARTHUS = 30, + ///`31` + CHOGATH = 31, + ///`32` + AMUMU = 32, + ///`33` + RAMMUS = 33, + ///`34` + ANIVIA = 34, + ///`35` + SHACO = 35, + ///`36` + DR_MUNDO = 36, + ///`37` + SONA = 37, + ///`38` + KASSADIN = 38, + ///`39` + IRELIA = 39, + ///`40` + JANNA = 40, + ///`41` + GANGPLANK = 41, + ///`42` + CORKI = 42, + ///`43` + KARMA = 43, + ///`44` + TARIC = 44, + ///`45` + VEIGAR = 45, + ///`48` + TRUNDLE = 48, + ///`50` + SWAIN = 50, + ///`51` + CAITLYN = 51, + ///`53` + BLITZCRANK = 53, + ///`54` + MALPHITE = 54, + ///`55` + KATARINA = 55, + ///`56` + NOCTURNE = 56, + ///`57` + MAOKAI = 57, + ///`58` + RENEKTON = 58, + ///`59` + JARVAN_IV = 59, + ///`60` + ELISE = 60, + ///`61` + ORIANNA = 61, + ///`62` + MONKEY_KING = 62, + ///`63` + BRAND = 63, + ///`64` + LEE_SIN = 64, + ///`67` + VAYNE = 67, + ///`68` + RUMBLE = 68, + ///`69` + CASSIOPEIA = 69, + ///`72` + SKARNER = 72, + ///`74` + HEIMERDINGER = 74, + ///`75` + NASUS = 75, + ///`76` + NIDALEE = 76, + ///`77` + UDYR = 77, + ///`78` + POPPY = 78, + ///`79` + GRAGAS = 79, + ///`80` + PANTHEON = 80, + ///`81` + EZREAL = 81, + ///`82` + MORDEKAISER = 82, + ///`83` + YORICK = 83, + ///`84` + AKALI = 84, + ///`85` + KENNEN = 85, + ///`86` + GAREN = 86, + ///`89` + LEONA = 89, + ///`90` + MALZAHAR = 90, + ///`91` + TALON = 91, + ///`92` + RIVEN = 92, + ///`96` + KOG_MAW = 96, + ///`98` + SHEN = 98, + ///`99` + LUX = 99, + ///`101` + XERATH = 101, + ///`102` + SHYVANA = 102, + ///`103` + AHRI = 103, + ///`104` + GRAVES = 104, + ///`105` + FIZZ = 105, + ///`106` + VOLIBEAR = 106, + ///`107` + RENGAR = 107, + ///`110` + VARUS = 110, + ///`111` + NAUTILUS = 111, + ///`112` + VIKTOR = 112, + ///`113` + SEJUANI = 113, + ///`114` + FIORA = 114, + ///`115` + ZIGGS = 115, + ///`117` + LULU = 117, + ///`119` + DRAVEN = 119, + ///`120` + HECARIM = 120, + ///`121` + KHAZIX = 121, + ///`122` + DARIUS = 122, + ///`126` + JAYCE = 126, + ///`127` + LISSANDRA = 127, + ///`131` + DIANA = 131, + ///`133` + QUINN = 133, + ///`134` + SYNDRA = 134, + ///`136` + AURELION_SOL = 136, + ///`141` + KAYN = 141, + ///`142` + ZOE = 142, + ///`143` + ZYRA = 143, + ///`145` + KAISA = 145, + ///`147` + SERAPHINE = 147, + ///`150` + GNAR = 150, + ///`154` + ZAC = 154, + ///`157` + YASUO = 157, + ///`161` + VELKOZ = 161, + ///`163` + TALIYAH = 163, + ///`164` + CAMILLE = 164, + ///`166` + AKSHAN = 166, + ///`200` + BELVETH = 200, + ///`201` + BRAUM = 201, + ///`202` + JHIN = 202, + ///`203` + KINDRED = 203, + ///`221` + ZERI = 221, + ///`222` + JINX = 222, + ///`223` + TAHM_KENCH = 223, + ///`233` + BRIAR = 233, + ///`234` + VIEGO = 234, + ///`235` + SENNA = 235, + ///`236` + LUCIAN = 236, + ///`238` + ZED = 238, + ///`240` + KLED = 240, + ///`245` + EKKO = 245, + ///`246` + QIYANA = 246, + ///`254` + VI = 254, + ///`266` + AATROX = 266, + ///`267` + NAMI = 267, + ///`268` + AZIR = 268, + ///`350` + YUUMI = 350, + ///`360` + SAMIRA = 360, + ///`412` + THRESH = 412, + ///`420` + ILLAOI = 420, + ///`421` + REK_SAI = 421, + ///`427` + IVERN = 427, + ///`429` + KALISTA = 429, + ///`432` + BARD = 432, + ///`497` + RAKAN = 497, + ///`498` + XAYAH = 498, + ///`516` + ORNN = 516, + ///`517` + SYLAS = 517, + ///`518` + NEEKO = 518, + ///`523` + APHELIOS = 523, + ///`526` + RELL = 526, + ///`555` + PYKE = 555, + ///`711` + VEX = 711, + ///`777` + YONE = 777, + ///`799` + AMBESSA = 799, + ///`800` + MEL = 800, + ///`875` + SETT = 875, + ///`876` + LILLIA = 876, + ///`887` + GWEN = 887, + ///`888` + RENATA = 888, + ///`893` + AURORA = 893, + ///`895` + NILAH = 895, + ///`897` + K_SANTE = 897, + ///`901` + SMOLDER = 901, + ///`902` + MILIO = 902, + ///`910` + HWEI = 910, + ///`950` + NAAFIRI = 950, +} +impl Champion { + /// The champion's name (`en_US` localization). + pub const fn name(self) -> Option<&'static str> { + match self { + Self::ANNIE => Some("Annie"), + Self::OLAF => Some("Olaf"), + Self::GALIO => Some("Galio"), + Self::TWISTED_FATE => Some("Twisted Fate"), + Self::XIN_ZHAO => Some("Xin Zhao"), + Self::URGOT => Some("Urgot"), + Self::LEBLANC => Some("LeBlanc"), + Self::VLADIMIR => Some("Vladimir"), + Self::FIDDLE_STICKS => Some("Fiddlesticks"), + Self::KAYLE => Some("Kayle"), + Self::MASTER_YI => Some("Master Yi"), + Self::ALISTAR => Some("Alistar"), + Self::RYZE => Some("Ryze"), + Self::SION => Some("Sion"), + Self::SIVIR => Some("Sivir"), + Self::SORAKA => Some("Soraka"), + Self::TEEMO => Some("Teemo"), + Self::TRISTANA => Some("Tristana"), + Self::WARWICK => Some("Warwick"), + Self::NUNU => Some("Nunu & Willump"), + Self::MISS_FORTUNE => Some("Miss Fortune"), + Self::ASHE => Some("Ashe"), + Self::TRYNDAMERE => Some("Tryndamere"), + Self::JAX => Some("Jax"), + Self::MORGANA => Some("Morgana"), + Self::ZILEAN => Some("Zilean"), + Self::SINGED => Some("Singed"), + Self::EVELYNN => Some("Evelynn"), + Self::TWITCH => Some("Twitch"), + Self::KARTHUS => Some("Karthus"), + Self::CHOGATH => Some("Cho'Gath"), + Self::AMUMU => Some("Amumu"), + Self::RAMMUS => Some("Rammus"), + Self::ANIVIA => Some("Anivia"), + Self::SHACO => Some("Shaco"), + Self::DR_MUNDO => Some("Dr. Mundo"), + Self::SONA => Some("Sona"), + Self::KASSADIN => Some("Kassadin"), + Self::IRELIA => Some("Irelia"), + Self::JANNA => Some("Janna"), + Self::GANGPLANK => Some("Gangplank"), + Self::CORKI => Some("Corki"), + Self::KARMA => Some("Karma"), + Self::TARIC => Some("Taric"), + Self::VEIGAR => Some("Veigar"), + Self::TRUNDLE => Some("Trundle"), + Self::SWAIN => Some("Swain"), + Self::CAITLYN => Some("Caitlyn"), + Self::BLITZCRANK => Some("Blitzcrank"), + Self::MALPHITE => Some("Malphite"), + Self::KATARINA => Some("Katarina"), + Self::NOCTURNE => Some("Nocturne"), + Self::MAOKAI => Some("Maokai"), + Self::RENEKTON => Some("Renekton"), + Self::JARVAN_IV => Some("Jarvan IV"), + Self::ELISE => Some("Elise"), + Self::ORIANNA => Some("Orianna"), + Self::MONKEY_KING => Some("Wukong"), + Self::BRAND => Some("Brand"), + Self::LEE_SIN => Some("Lee Sin"), + Self::VAYNE => Some("Vayne"), + Self::RUMBLE => Some("Rumble"), + Self::CASSIOPEIA => Some("Cassiopeia"), + Self::SKARNER => Some("Skarner"), + Self::HEIMERDINGER => Some("Heimerdinger"), + Self::NASUS => Some("Nasus"), + Self::NIDALEE => Some("Nidalee"), + Self::UDYR => Some("Udyr"), + Self::POPPY => Some("Poppy"), + Self::GRAGAS => Some("Gragas"), + Self::PANTHEON => Some("Pantheon"), + Self::EZREAL => Some("Ezreal"), + Self::MORDEKAISER => Some("Mordekaiser"), + Self::YORICK => Some("Yorick"), + Self::AKALI => Some("Akali"), + Self::KENNEN => Some("Kennen"), + Self::GAREN => Some("Garen"), + Self::LEONA => Some("Leona"), + Self::MALZAHAR => Some("Malzahar"), + Self::TALON => Some("Talon"), + Self::RIVEN => Some("Riven"), + Self::KOG_MAW => Some("Kog'Maw"), + Self::SHEN => Some("Shen"), + Self::LUX => Some("Lux"), + Self::XERATH => Some("Xerath"), + Self::SHYVANA => Some("Shyvana"), + Self::AHRI => Some("Ahri"), + Self::GRAVES => Some("Graves"), + Self::FIZZ => Some("Fizz"), + Self::VOLIBEAR => Some("Volibear"), + Self::RENGAR => Some("Rengar"), + Self::VARUS => Some("Varus"), + Self::NAUTILUS => Some("Nautilus"), + Self::VIKTOR => Some("Viktor"), + Self::SEJUANI => Some("Sejuani"), + Self::FIORA => Some("Fiora"), + Self::ZIGGS => Some("Ziggs"), + Self::LULU => Some("Lulu"), + Self::DRAVEN => Some("Draven"), + Self::HECARIM => Some("Hecarim"), + Self::KHAZIX => Some("Kha'Zix"), + Self::DARIUS => Some("Darius"), + Self::JAYCE => Some("Jayce"), + Self::LISSANDRA => Some("Lissandra"), + Self::DIANA => Some("Diana"), + Self::QUINN => Some("Quinn"), + Self::SYNDRA => Some("Syndra"), + Self::AURELION_SOL => Some("Aurelion Sol"), + Self::KAYN => Some("Kayn"), + Self::ZOE => Some("Zoe"), + Self::ZYRA => Some("Zyra"), + Self::KAISA => Some("Kai'Sa"), + Self::SERAPHINE => Some("Seraphine"), + Self::GNAR => Some("Gnar"), + Self::ZAC => Some("Zac"), + Self::YASUO => Some("Yasuo"), + Self::VELKOZ => Some("Vel'Koz"), + Self::TALIYAH => Some("Taliyah"), + Self::CAMILLE => Some("Camille"), + Self::AKSHAN => Some("Akshan"), + Self::BELVETH => Some("Bel'Veth"), + Self::BRAUM => Some("Braum"), + Self::JHIN => Some("Jhin"), + Self::KINDRED => Some("Kindred"), + Self::ZERI => Some("Zeri"), + Self::JINX => Some("Jinx"), + Self::TAHM_KENCH => Some("Tahm Kench"), + Self::BRIAR => Some("Briar"), + Self::VIEGO => Some("Viego"), + Self::SENNA => Some("Senna"), + Self::LUCIAN => Some("Lucian"), + Self::ZED => Some("Zed"), + Self::KLED => Some("Kled"), + Self::EKKO => Some("Ekko"), + Self::QIYANA => Some("Qiyana"), + Self::VI => Some("Vi"), + Self::AATROX => Some("Aatrox"), + Self::NAMI => Some("Nami"), + Self::AZIR => Some("Azir"), + Self::YUUMI => Some("Yuumi"), + Self::SAMIRA => Some("Samira"), + Self::THRESH => Some("Thresh"), + Self::ILLAOI => Some("Illaoi"), + Self::REK_SAI => Some("Rek'Sai"), + Self::IVERN => Some("Ivern"), + Self::KALISTA => Some("Kalista"), + Self::BARD => Some("Bard"), + Self::RAKAN => Some("Rakan"), + Self::XAYAH => Some("Xayah"), + Self::ORNN => Some("Ornn"), + Self::SYLAS => Some("Sylas"), + Self::NEEKO => Some("Neeko"), + Self::APHELIOS => Some("Aphelios"), + Self::RELL => Some("Rell"), + Self::PYKE => Some("Pyke"), + Self::VEX => Some("Vex"), + Self::YONE => Some("Yone"), + Self::AMBESSA => Some("Ambessa"), + Self::MEL => Some("Mel"), + Self::SETT => Some("Sett"), + Self::LILLIA => Some("Lillia"), + Self::GWEN => Some("Gwen"), + Self::RENATA => Some("Renata Glasc"), + Self::AURORA => Some("Aurora"), + Self::NILAH => Some("Nilah"), + Self::K_SANTE => Some("K'Sante"), + Self::SMOLDER => Some("Smolder"), + Self::MILIO => Some("Milio"), + Self::HWEI => Some("Hwei"), + Self::NAAFIRI => Some("Naafiri"), + _ => None, + } + } + /// The champion's identifier key. Somtimes called "key", "identifier", or "alias". + /// This is mainly used in DDragon paths. + /// + /// This is generally the `en_US` name with spaces and punctuation removed, + /// capitalization preserved, however the follow are exceptions: + /// + /// Field | Name | Identifier | Id + /// ---|---|---|--- + ///`1` | Annie | Annie | 1 + ///`2` | Olaf | Olaf | 2 + ///`3` | Galio | Galio | 3 + ///`4` | Twisted Fate | TwistedFate | 4 + ///`5` | Xin Zhao | XinZhao | 5 + ///`6` | Urgot | Urgot | 6 + ///`7` | LeBlanc | Leblanc | 7 + ///`8` | Vladimir | Vladimir | 8 + ///`9` | Fiddlesticks | FiddleSticks | 9 + ///`10` | Kayle | Kayle | 10 + ///`11` | Master Yi | MasterYi | 11 + ///`12` | Alistar | Alistar | 12 + ///`13` | Ryze | Ryze | 13 + ///`14` | Sion | Sion | 14 + ///`15` | Sivir | Sivir | 15 + ///`16` | Soraka | Soraka | 16 + ///`17` | Teemo | Teemo | 17 + ///`18` | Tristana | Tristana | 18 + ///`19` | Warwick | Warwick | 19 + ///`20` | Nunu & Willump | Nunu | 20 + ///`21` | Miss Fortune | MissFortune | 21 + ///`22` | Ashe | Ashe | 22 + ///`23` | Tryndamere | Tryndamere | 23 + ///`24` | Jax | Jax | 24 + ///`25` | Morgana | Morgana | 25 + ///`26` | Zilean | Zilean | 26 + ///`27` | Singed | Singed | 27 + ///`28` | Evelynn | Evelynn | 28 + ///`29` | Twitch | Twitch | 29 + ///`30` | Karthus | Karthus | 30 + ///`31` | Cho'Gath | Chogath | 31 + ///`32` | Amumu | Amumu | 32 + ///`33` | Rammus | Rammus | 33 + ///`34` | Anivia | Anivia | 34 + ///`35` | Shaco | Shaco | 35 + ///`36` | Dr. Mundo | DrMundo | 36 + ///`37` | Sona | Sona | 37 + ///`38` | Kassadin | Kassadin | 38 + ///`39` | Irelia | Irelia | 39 + ///`40` | Janna | Janna | 40 + ///`41` | Gangplank | Gangplank | 41 + ///`42` | Corki | Corki | 42 + ///`43` | Karma | Karma | 43 + ///`44` | Taric | Taric | 44 + ///`45` | Veigar | Veigar | 45 + ///`48` | Trundle | Trundle | 48 + ///`50` | Swain | Swain | 50 + ///`51` | Caitlyn | Caitlyn | 51 + ///`53` | Blitzcrank | Blitzcrank | 53 + ///`54` | Malphite | Malphite | 54 + ///`55` | Katarina | Katarina | 55 + ///`56` | Nocturne | Nocturne | 56 + ///`57` | Maokai | Maokai | 57 + ///`58` | Renekton | Renekton | 58 + ///`59` | Jarvan IV | JarvanIV | 59 + ///`60` | Elise | Elise | 60 + ///`61` | Orianna | Orianna | 61 + ///`62` | Wukong | MonkeyKing | 62 + ///`63` | Brand | Brand | 63 + ///`64` | Lee Sin | LeeSin | 64 + ///`67` | Vayne | Vayne | 67 + ///`68` | Rumble | Rumble | 68 + ///`69` | Cassiopeia | Cassiopeia | 69 + ///`72` | Skarner | Skarner | 72 + ///`74` | Heimerdinger | Heimerdinger | 74 + ///`75` | Nasus | Nasus | 75 + ///`76` | Nidalee | Nidalee | 76 + ///`77` | Udyr | Udyr | 77 + ///`78` | Poppy | Poppy | 78 + ///`79` | Gragas | Gragas | 79 + ///`80` | Pantheon | Pantheon | 80 + ///`81` | Ezreal | Ezreal | 81 + ///`82` | Mordekaiser | Mordekaiser | 82 + ///`83` | Yorick | Yorick | 83 + ///`84` | Akali | Akali | 84 + ///`85` | Kennen | Kennen | 85 + ///`86` | Garen | Garen | 86 + ///`89` | Leona | Leona | 89 + ///`90` | Malzahar | Malzahar | 90 + ///`91` | Talon | Talon | 91 + ///`92` | Riven | Riven | 92 + ///`96` | Kog'Maw | KogMaw | 96 + ///`98` | Shen | Shen | 98 + ///`99` | Lux | Lux | 99 + ///`101` | Xerath | Xerath | 101 + ///`102` | Shyvana | Shyvana | 102 + ///`103` | Ahri | Ahri | 103 + ///`104` | Graves | Graves | 104 + ///`105` | Fizz | Fizz | 105 + ///`106` | Volibear | Volibear | 106 + ///`107` | Rengar | Rengar | 107 + ///`110` | Varus | Varus | 110 + ///`111` | Nautilus | Nautilus | 111 + ///`112` | Viktor | Viktor | 112 + ///`113` | Sejuani | Sejuani | 113 + ///`114` | Fiora | Fiora | 114 + ///`115` | Ziggs | Ziggs | 115 + ///`117` | Lulu | Lulu | 117 + ///`119` | Draven | Draven | 119 + ///`120` | Hecarim | Hecarim | 120 + ///`121` | Kha'Zix | Khazix | 121 + ///`122` | Darius | Darius | 122 + ///`126` | Jayce | Jayce | 126 + ///`127` | Lissandra | Lissandra | 127 + ///`131` | Diana | Diana | 131 + ///`133` | Quinn | Quinn | 133 + ///`134` | Syndra | Syndra | 134 + ///`136` | Aurelion Sol | AurelionSol | 136 + ///`141` | Kayn | Kayn | 141 + ///`142` | Zoe | Zoe | 142 + ///`143` | Zyra | Zyra | 143 + ///`145` | Kai'Sa | Kaisa | 145 + ///`147` | Seraphine | Seraphine | 147 + ///`150` | Gnar | Gnar | 150 + ///`154` | Zac | Zac | 154 + ///`157` | Yasuo | Yasuo | 157 + ///`161` | Vel'Koz | Velkoz | 161 + ///`163` | Taliyah | Taliyah | 163 + ///`164` | Camille | Camille | 164 + ///`166` | Akshan | Akshan | 166 + ///`200` | Bel'Veth | Belveth | 200 + ///`201` | Braum | Braum | 201 + ///`202` | Jhin | Jhin | 202 + ///`203` | Kindred | Kindred | 203 + ///`221` | Zeri | Zeri | 221 + ///`222` | Jinx | Jinx | 222 + ///`223` | Tahm Kench | TahmKench | 223 + ///`233` | Briar | Briar | 233 + ///`234` | Viego | Viego | 234 + ///`235` | Senna | Senna | 235 + ///`236` | Lucian | Lucian | 236 + ///`238` | Zed | Zed | 238 + ///`240` | Kled | Kled | 240 + ///`245` | Ekko | Ekko | 245 + ///`246` | Qiyana | Qiyana | 246 + ///`254` | Vi | Vi | 254 + ///`266` | Aatrox | Aatrox | 266 + ///`267` | Nami | Nami | 267 + ///`268` | Azir | Azir | 268 + ///`350` | Yuumi | Yuumi | 350 + ///`360` | Samira | Samira | 360 + ///`412` | Thresh | Thresh | 412 + ///`420` | Illaoi | Illaoi | 420 + ///`421` | Rek'Sai | RekSai | 421 + ///`427` | Ivern | Ivern | 427 + ///`429` | Kalista | Kalista | 429 + ///`432` | Bard | Bard | 432 + ///`497` | Rakan | Rakan | 497 + ///`498` | Xayah | Xayah | 498 + ///`516` | Ornn | Ornn | 516 + ///`517` | Sylas | Sylas | 517 + ///`518` | Neeko | Neeko | 518 + ///`523` | Aphelios | Aphelios | 523 + ///`526` | Rell | Rell | 526 + ///`555` | Pyke | Pyke | 555 + ///`711` | Vex | Vex | 711 + ///`777` | Yone | Yone | 777 + ///`799` | Ambessa | Ambessa | 799 + ///`800` | Mel | Mel | 800 + ///`875` | Sett | Sett | 875 + ///`876` | Lillia | Lillia | 876 + ///`887` | Gwen | Gwen | 887 + ///`888` | Renata Glasc | Renata | 888 + ///`893` | Aurora | Aurora | 893 + ///`895` | Nilah | Nilah | 895 + ///`897` | K'Sante | KSante | 897 + ///`901` | Smolder | Smolder | 901 + ///`902` | Milio | Milio | 902 + ///`910` | Hwei | Hwei | 910 + ///`950` | Naafiri | Naafiri | 950 + pub const fn identifier(self) -> Option<&'static str> { + match self { + Self::ANNIE => Some("Annie"), + Self::OLAF => Some("Olaf"), + Self::GALIO => Some("Galio"), + Self::TWISTED_FATE => Some("TwistedFate"), + Self::XIN_ZHAO => Some("XinZhao"), + Self::URGOT => Some("Urgot"), + Self::LEBLANC => Some("Leblanc"), + Self::VLADIMIR => Some("Vladimir"), + Self::FIDDLE_STICKS => Some("FiddleSticks"), + Self::KAYLE => Some("Kayle"), + Self::MASTER_YI => Some("MasterYi"), + Self::ALISTAR => Some("Alistar"), + Self::RYZE => Some("Ryze"), + Self::SION => Some("Sion"), + Self::SIVIR => Some("Sivir"), + Self::SORAKA => Some("Soraka"), + Self::TEEMO => Some("Teemo"), + Self::TRISTANA => Some("Tristana"), + Self::WARWICK => Some("Warwick"), + Self::NUNU => Some("Nunu"), + Self::MISS_FORTUNE => Some("MissFortune"), + Self::ASHE => Some("Ashe"), + Self::TRYNDAMERE => Some("Tryndamere"), + Self::JAX => Some("Jax"), + Self::MORGANA => Some("Morgana"), + Self::ZILEAN => Some("Zilean"), + Self::SINGED => Some("Singed"), + Self::EVELYNN => Some("Evelynn"), + Self::TWITCH => Some("Twitch"), + Self::KARTHUS => Some("Karthus"), + Self::CHOGATH => Some("Chogath"), + Self::AMUMU => Some("Amumu"), + Self::RAMMUS => Some("Rammus"), + Self::ANIVIA => Some("Anivia"), + Self::SHACO => Some("Shaco"), + Self::DR_MUNDO => Some("DrMundo"), + Self::SONA => Some("Sona"), + Self::KASSADIN => Some("Kassadin"), + Self::IRELIA => Some("Irelia"), + Self::JANNA => Some("Janna"), + Self::GANGPLANK => Some("Gangplank"), + Self::CORKI => Some("Corki"), + Self::KARMA => Some("Karma"), + Self::TARIC => Some("Taric"), + Self::VEIGAR => Some("Veigar"), + Self::TRUNDLE => Some("Trundle"), + Self::SWAIN => Some("Swain"), + Self::CAITLYN => Some("Caitlyn"), + Self::BLITZCRANK => Some("Blitzcrank"), + Self::MALPHITE => Some("Malphite"), + Self::KATARINA => Some("Katarina"), + Self::NOCTURNE => Some("Nocturne"), + Self::MAOKAI => Some("Maokai"), + Self::RENEKTON => Some("Renekton"), + Self::JARVAN_IV => Some("JarvanIV"), + Self::ELISE => Some("Elise"), + Self::ORIANNA => Some("Orianna"), + Self::MONKEY_KING => Some("MonkeyKing"), + Self::BRAND => Some("Brand"), + Self::LEE_SIN => Some("LeeSin"), + Self::VAYNE => Some("Vayne"), + Self::RUMBLE => Some("Rumble"), + Self::CASSIOPEIA => Some("Cassiopeia"), + Self::SKARNER => Some("Skarner"), + Self::HEIMERDINGER => Some("Heimerdinger"), + Self::NASUS => Some("Nasus"), + Self::NIDALEE => Some("Nidalee"), + Self::UDYR => Some("Udyr"), + Self::POPPY => Some("Poppy"), + Self::GRAGAS => Some("Gragas"), + Self::PANTHEON => Some("Pantheon"), + Self::EZREAL => Some("Ezreal"), + Self::MORDEKAISER => Some("Mordekaiser"), + Self::YORICK => Some("Yorick"), + Self::AKALI => Some("Akali"), + Self::KENNEN => Some("Kennen"), + Self::GAREN => Some("Garen"), + Self::LEONA => Some("Leona"), + Self::MALZAHAR => Some("Malzahar"), + Self::TALON => Some("Talon"), + Self::RIVEN => Some("Riven"), + Self::KOG_MAW => Some("KogMaw"), + Self::SHEN => Some("Shen"), + Self::LUX => Some("Lux"), + Self::XERATH => Some("Xerath"), + Self::SHYVANA => Some("Shyvana"), + Self::AHRI => Some("Ahri"), + Self::GRAVES => Some("Graves"), + Self::FIZZ => Some("Fizz"), + Self::VOLIBEAR => Some("Volibear"), + Self::RENGAR => Some("Rengar"), + Self::VARUS => Some("Varus"), + Self::NAUTILUS => Some("Nautilus"), + Self::VIKTOR => Some("Viktor"), + Self::SEJUANI => Some("Sejuani"), + Self::FIORA => Some("Fiora"), + Self::ZIGGS => Some("Ziggs"), + Self::LULU => Some("Lulu"), + Self::DRAVEN => Some("Draven"), + Self::HECARIM => Some("Hecarim"), + Self::KHAZIX => Some("Khazix"), + Self::DARIUS => Some("Darius"), + Self::JAYCE => Some("Jayce"), + Self::LISSANDRA => Some("Lissandra"), + Self::DIANA => Some("Diana"), + Self::QUINN => Some("Quinn"), + Self::SYNDRA => Some("Syndra"), + Self::AURELION_SOL => Some("AurelionSol"), + Self::KAYN => Some("Kayn"), + Self::ZOE => Some("Zoe"), + Self::ZYRA => Some("Zyra"), + Self::KAISA => Some("Kaisa"), + Self::SERAPHINE => Some("Seraphine"), + Self::GNAR => Some("Gnar"), + Self::ZAC => Some("Zac"), + Self::YASUO => Some("Yasuo"), + Self::VELKOZ => Some("Velkoz"), + Self::TALIYAH => Some("Taliyah"), + Self::CAMILLE => Some("Camille"), + Self::AKSHAN => Some("Akshan"), + Self::BELVETH => Some("Belveth"), + Self::BRAUM => Some("Braum"), + Self::JHIN => Some("Jhin"), + Self::KINDRED => Some("Kindred"), + Self::ZERI => Some("Zeri"), + Self::JINX => Some("Jinx"), + Self::TAHM_KENCH => Some("TahmKench"), + Self::BRIAR => Some("Briar"), + Self::VIEGO => Some("Viego"), + Self::SENNA => Some("Senna"), + Self::LUCIAN => Some("Lucian"), + Self::ZED => Some("Zed"), + Self::KLED => Some("Kled"), + Self::EKKO => Some("Ekko"), + Self::QIYANA => Some("Qiyana"), + Self::VI => Some("Vi"), + Self::AATROX => Some("Aatrox"), + Self::NAMI => Some("Nami"), + Self::AZIR => Some("Azir"), + Self::YUUMI => Some("Yuumi"), + Self::SAMIRA => Some("Samira"), + Self::THRESH => Some("Thresh"), + Self::ILLAOI => Some("Illaoi"), + Self::REK_SAI => Some("RekSai"), + Self::IVERN => Some("Ivern"), + Self::KALISTA => Some("Kalista"), + Self::BARD => Some("Bard"), + Self::RAKAN => Some("Rakan"), + Self::XAYAH => Some("Xayah"), + Self::ORNN => Some("Ornn"), + Self::SYLAS => Some("Sylas"), + Self::NEEKO => Some("Neeko"), + Self::APHELIOS => Some("Aphelios"), + Self::RELL => Some("Rell"), + Self::PYKE => Some("Pyke"), + Self::VEX => Some("Vex"), + Self::YONE => Some("Yone"), + Self::AMBESSA => Some("Ambessa"), + Self::MEL => Some("Mel"), + Self::SETT => Some("Sett"), + Self::LILLIA => Some("Lillia"), + Self::GWEN => Some("Gwen"), + Self::RENATA => Some("Renata"), + Self::AURORA => Some("Aurora"), + Self::NILAH => Some("Nilah"), + Self::K_SANTE => Some("KSante"), + Self::SMOLDER => Some("Smolder"), + Self::MILIO => Some("Milio"), + Self::HWEI => Some("Hwei"), + Self::NAAFIRI => Some("Naafiri"), + _ => None, + } + } +} +impl std::str::FromStr for Champion { + type Err = ParseChampionError; + fn from_str(s: &str) -> Result { + let mut chars = ['\0'; 4]; + s.chars() + .take(4) + .filter(|c| c.is_ascii_alphanumeric()) + .map(|c| c.to_ascii_uppercase()) + .enumerate() + .for_each(|(i, c)| chars[i] = c); + match chars { + ['A', 'A', 'T', 'R'] => Ok(Champion::AATROX), + ['A', 'H', 'R', 'I'] => Ok(Champion::AHRI), + ['A', 'K', 'A', 'L'] => Ok(Champion::AKALI), + ['A', 'K', 'S', 'H'] => Ok(Champion::AKSHAN), + ['A', 'L', 'I', 'S'] => Ok(Champion::ALISTAR), + ['A', 'M', 'B', 'E'] => Ok(Champion::AMBESSA), + ['A', 'M', 'U', 'M'] => Ok(Champion::AMUMU), + ['A', 'N', 'I', 'V'] => Ok(Champion::ANIVIA), + ['A', 'N', 'N', 'I'] => Ok(Champion::ANNIE), + ['A', 'P', 'H', 'E'] => Ok(Champion::APHELIOS), + ['A', 'S', 'H', 'E'] => Ok(Champion::ASHE), + ['A', 'U', 'R', 'E'] => Ok(Champion::AURELION_SOL), + ['A', 'U', 'R', 'O'] => Ok(Champion::AURORA), + ['A', 'Z', 'I', 'R'] => Ok(Champion::AZIR), + ['B', 'A', 'R', 'D'] => Ok(Champion::BARD), + ['B', 'E', 'L', '\0'] => Ok(Champion::BELVETH), + ['B', 'E', 'L', 'V'] => Ok(Champion::BELVETH), + ['B', 'L', 'I', 'T'] => Ok(Champion::BLITZCRANK), + ['B', 'R', 'A', 'N'] => Ok(Champion::BRAND), + ['B', 'R', 'A', 'U'] => Ok(Champion::BRAUM), + ['B', 'R', 'I', 'A'] => Ok(Champion::BRIAR), + ['C', 'A', 'I', 'T'] => Ok(Champion::CAITLYN), + ['C', 'A', 'M', 'I'] => Ok(Champion::CAMILLE), + ['C', 'A', 'S', 'S'] => Ok(Champion::CASSIOPEIA), + ['C', 'H', 'O', '\0'] => Ok(Champion::CHOGATH), + ['C', 'H', 'O', 'G'] => Ok(Champion::CHOGATH), + ['C', 'O', 'R', 'K'] => Ok(Champion::CORKI), + ['D', 'A', 'R', 'I'] => Ok(Champion::DARIUS), + ['D', 'I', 'A', 'N'] => Ok(Champion::DIANA), + ['D', 'R', '\0', '\0'] => Ok(Champion::DR_MUNDO), + ['D', 'R', 'A', 'V'] => Ok(Champion::DRAVEN), + ['D', 'R', 'M', 'U'] => Ok(Champion::DR_MUNDO), + ['E', 'K', 'K', 'O'] => Ok(Champion::EKKO), + ['E', 'L', 'I', 'S'] => Ok(Champion::ELISE), + ['E', 'V', 'E', 'L'] => Ok(Champion::EVELYNN), + ['E', 'Z', 'R', 'E'] => Ok(Champion::EZREAL), + ['F', 'I', 'D', 'D'] => Ok(Champion::FIDDLE_STICKS), + ['F', 'I', 'O', 'R'] => Ok(Champion::FIORA), + ['F', 'I', 'Z', 'Z'] => Ok(Champion::FIZZ), + ['G', 'A', 'L', 'I'] => Ok(Champion::GALIO), + ['G', 'A', 'N', 'G'] => Ok(Champion::GANGPLANK), + ['G', 'A', 'R', 'E'] => Ok(Champion::GAREN), + ['G', 'N', 'A', 'R'] => Ok(Champion::GNAR), + ['G', 'R', 'A', 'G'] => Ok(Champion::GRAGAS), + ['G', 'R', 'A', 'V'] => Ok(Champion::GRAVES), + ['G', 'W', 'E', 'N'] => Ok(Champion::GWEN), + ['H', 'E', 'C', 'A'] => Ok(Champion::HECARIM), + ['H', 'E', 'I', 'M'] => Ok(Champion::HEIMERDINGER), + ['H', 'W', 'E', 'I'] => Ok(Champion::HWEI), + ['I', 'L', 'L', 'A'] => Ok(Champion::ILLAOI), + ['I', 'R', 'E', 'L'] => Ok(Champion::IRELIA), + ['I', 'V', 'E', 'R'] => Ok(Champion::IVERN), + ['J', 'A', 'N', 'N'] => Ok(Champion::JANNA), + ['J', 'A', 'R', 'V'] => Ok(Champion::JARVAN_IV), + ['J', 'A', 'X', '\0'] => Ok(Champion::JAX), + ['J', 'A', 'Y', 'C'] => Ok(Champion::JAYCE), + ['J', 'H', 'I', 'N'] => Ok(Champion::JHIN), + ['J', 'I', 'N', 'X'] => Ok(Champion::JINX), + ['K', '\0', '\0', '\0'] => Ok(Champion::K_SANTE), + ['K', 'A', 'I', '\0'] => Ok(Champion::KAISA), + ['K', 'A', 'I', 'S'] => Ok(Champion::KAISA), + ['K', 'A', 'L', 'I'] => Ok(Champion::KALISTA), + ['K', 'A', 'R', 'M'] => Ok(Champion::KARMA), + ['K', 'A', 'R', 'T'] => Ok(Champion::KARTHUS), + ['K', 'A', 'S', 'S'] => Ok(Champion::KASSADIN), + ['K', 'A', 'T', 'A'] => Ok(Champion::KATARINA), + ['K', 'A', 'Y', 'L'] => Ok(Champion::KAYLE), + ['K', 'A', 'Y', 'N'] => Ok(Champion::KAYN), + ['K', 'E', 'N', 'N'] => Ok(Champion::KENNEN), + ['K', 'H', 'A', '\0'] => Ok(Champion::KHAZIX), + ['K', 'H', 'A', 'Z'] => Ok(Champion::KHAZIX), + ['K', 'I', 'N', 'D'] => Ok(Champion::KINDRED), + ['K', 'L', 'E', 'D'] => Ok(Champion::KLED), + ['K', 'O', 'G', '\0'] => Ok(Champion::KOG_MAW), + ['K', 'O', 'G', 'M'] => Ok(Champion::KOG_MAW), + ['K', 'S', 'A', 'N'] => Ok(Champion::K_SANTE), + ['L', 'E', 'B', 'L'] => Ok(Champion::LEBLANC), + ['L', 'E', 'E', '\0'] => Ok(Champion::LEE_SIN), + ['L', 'E', 'E', 'S'] => Ok(Champion::LEE_SIN), + ['L', 'E', 'O', 'N'] => Ok(Champion::LEONA), + ['L', 'I', 'L', 'L'] => Ok(Champion::LILLIA), + ['L', 'I', 'S', 'S'] => Ok(Champion::LISSANDRA), + ['L', 'U', 'C', 'I'] => Ok(Champion::LUCIAN), + ['L', 'U', 'L', 'U'] => Ok(Champion::LULU), + ['L', 'U', 'X', '\0'] => Ok(Champion::LUX), + ['M', 'A', 'L', 'P'] => Ok(Champion::MALPHITE), + ['M', 'A', 'L', 'Z'] => Ok(Champion::MALZAHAR), + ['M', 'A', 'O', 'K'] => Ok(Champion::MAOKAI), + ['M', 'A', 'S', 'T'] => Ok(Champion::MASTER_YI), + ['M', 'E', 'L', '\0'] => Ok(Champion::MEL), + ['M', 'I', 'L', 'I'] => Ok(Champion::MILIO), + ['M', 'I', 'S', 'S'] => Ok(Champion::MISS_FORTUNE), + ['M', 'O', 'N', 'K'] => Ok(Champion::MONKEY_KING), + ['M', 'O', 'R', 'D'] => Ok(Champion::MORDEKAISER), + ['M', 'O', 'R', 'G'] => Ok(Champion::MORGANA), + ['N', 'A', 'A', 'F'] => Ok(Champion::NAAFIRI), + ['N', 'A', 'M', 'I'] => Ok(Champion::NAMI), + ['N', 'A', 'S', 'U'] => Ok(Champion::NASUS), + ['N', 'A', 'U', 'T'] => Ok(Champion::NAUTILUS), + ['N', 'E', 'E', 'K'] => Ok(Champion::NEEKO), + ['N', 'I', 'D', 'A'] => Ok(Champion::NIDALEE), + ['N', 'I', 'L', 'A'] => Ok(Champion::NILAH), + ['N', 'O', 'C', 'T'] => Ok(Champion::NOCTURNE), + ['N', 'U', 'N', 'U'] => Ok(Champion::NUNU), + ['O', 'L', 'A', 'F'] => Ok(Champion::OLAF), + ['O', 'R', 'I', 'A'] => Ok(Champion::ORIANNA), + ['O', 'R', 'N', 'N'] => Ok(Champion::ORNN), + ['P', 'A', 'N', 'T'] => Ok(Champion::PANTHEON), + ['P', 'O', 'P', 'P'] => Ok(Champion::POPPY), + ['P', 'Y', 'K', 'E'] => Ok(Champion::PYKE), + ['Q', 'I', 'Y', 'A'] => Ok(Champion::QIYANA), + ['Q', 'U', 'I', 'N'] => Ok(Champion::QUINN), + ['R', 'A', 'K', 'A'] => Ok(Champion::RAKAN), + ['R', 'A', 'M', 'M'] => Ok(Champion::RAMMUS), + ['R', 'E', 'K', '\0'] => Ok(Champion::REK_SAI), + ['R', 'E', 'K', 'S'] => Ok(Champion::REK_SAI), + ['R', 'E', 'L', 'L'] => Ok(Champion::RELL), + ['R', 'E', 'N', 'A'] => Ok(Champion::RENATA), + ['R', 'E', 'N', 'E'] => Ok(Champion::RENEKTON), + ['R', 'E', 'N', 'G'] => Ok(Champion::RENGAR), + ['R', 'I', 'V', 'E'] => Ok(Champion::RIVEN), + ['R', 'U', 'M', 'B'] => Ok(Champion::RUMBLE), + ['R', 'Y', 'Z', 'E'] => Ok(Champion::RYZE), + ['S', 'A', 'M', 'I'] => Ok(Champion::SAMIRA), + ['S', 'E', 'J', 'U'] => Ok(Champion::SEJUANI), + ['S', 'E', 'N', 'N'] => Ok(Champion::SENNA), + ['S', 'E', 'R', 'A'] => Ok(Champion::SERAPHINE), + ['S', 'E', 'T', 'T'] => Ok(Champion::SETT), + ['S', 'H', 'A', 'C'] => Ok(Champion::SHACO), + ['S', 'H', 'E', 'N'] => Ok(Champion::SHEN), + ['S', 'H', 'Y', 'V'] => Ok(Champion::SHYVANA), + ['S', 'I', 'N', 'G'] => Ok(Champion::SINGED), + ['S', 'I', 'O', 'N'] => Ok(Champion::SION), + ['S', 'I', 'V', 'I'] => Ok(Champion::SIVIR), + ['S', 'K', 'A', 'R'] => Ok(Champion::SKARNER), + ['S', 'M', 'O', 'L'] => Ok(Champion::SMOLDER), + ['S', 'O', 'N', 'A'] => Ok(Champion::SONA), + ['S', 'O', 'R', 'A'] => Ok(Champion::SORAKA), + ['S', 'W', 'A', 'I'] => Ok(Champion::SWAIN), + ['S', 'Y', 'L', 'A'] => Ok(Champion::SYLAS), + ['S', 'Y', 'N', 'D'] => Ok(Champion::SYNDRA), + ['T', 'A', 'H', 'M'] => Ok(Champion::TAHM_KENCH), + ['T', 'A', 'L', 'I'] => Ok(Champion::TALIYAH), + ['T', 'A', 'L', 'O'] => Ok(Champion::TALON), + ['T', 'A', 'R', 'I'] => Ok(Champion::TARIC), + ['T', 'E', 'E', 'M'] => Ok(Champion::TEEMO), + ['T', 'H', 'R', 'E'] => Ok(Champion::THRESH), + ['T', 'R', 'I', 'S'] => Ok(Champion::TRISTANA), + ['T', 'R', 'U', 'N'] => Ok(Champion::TRUNDLE), + ['T', 'R', 'Y', 'N'] => Ok(Champion::TRYNDAMERE), + ['T', 'W', 'I', 'S'] => Ok(Champion::TWISTED_FATE), + ['T', 'W', 'I', 'T'] => Ok(Champion::TWITCH), + ['U', 'D', 'Y', 'R'] => Ok(Champion::UDYR), + ['U', 'R', 'G', 'O'] => Ok(Champion::URGOT), + ['V', 'A', 'R', 'U'] => Ok(Champion::VARUS), + ['V', 'A', 'Y', 'N'] => Ok(Champion::VAYNE), + ['V', 'E', 'I', 'G'] => Ok(Champion::VEIGAR), + ['V', 'E', 'L', '\0'] => Ok(Champion::VELKOZ), + ['V', 'E', 'L', 'K'] => Ok(Champion::VELKOZ), + ['V', 'E', 'X', '\0'] => Ok(Champion::VEX), + ['V', 'I', '\0', '\0'] => Ok(Champion::VI), + ['V', 'I', 'E', 'G'] => Ok(Champion::VIEGO), + ['V', 'I', 'K', 'T'] => Ok(Champion::VIKTOR), + ['V', 'L', 'A', 'D'] => Ok(Champion::VLADIMIR), + ['V', 'O', 'L', 'I'] => Ok(Champion::VOLIBEAR), + ['W', 'A', 'R', 'W'] => Ok(Champion::WARWICK), + ['W', 'U', 'K', 'O'] => Ok(Champion::MONKEY_KING), + ['X', 'A', 'Y', 'A'] => Ok(Champion::XAYAH), + ['X', 'E', 'R', 'A'] => Ok(Champion::XERATH), + ['X', 'I', 'N', '\0'] => Ok(Champion::XIN_ZHAO), + ['X', 'I', 'N', 'Z'] => Ok(Champion::XIN_ZHAO), + ['Y', 'A', 'S', 'U'] => Ok(Champion::YASUO), + ['Y', 'O', 'N', 'E'] => Ok(Champion::YONE), + ['Y', 'O', 'R', 'I'] => Ok(Champion::YORICK), + ['Y', 'U', 'U', 'M'] => Ok(Champion::YUUMI), + ['Z', 'A', 'C', '\0'] => Ok(Champion::ZAC), + ['Z', 'E', 'D', '\0'] => Ok(Champion::ZED), + ['Z', 'E', 'R', 'I'] => Ok(Champion::ZERI), + ['Z', 'I', 'G', 'G'] => Ok(Champion::ZIGGS), + ['Z', 'I', 'L', 'E'] => Ok(Champion::ZILEAN), + ['Z', 'O', 'E', '\0'] => Ok(Champion::ZOE), + ['Z', 'Y', 'R', 'A'] => Ok(Champion::ZYRA), + unknown => Err(ParseChampionError(unknown)), + } + } +} + diff --git a/riven/src/consts/champion.rs b/riven/src/consts/champion.rs index dc5d68ba..e1584548 100644 --- a/riven/src/consts/champion.rs +++ b/riven/src/consts/champion.rs @@ -1,911 +1,6 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -newtype_enum! { - /// A League of Legends champion. - /// - /// This newtype acts as a C-like enum; each variant corresponds to an - /// integer value. Using a newtype allows _unknown_ variants to be - /// represented. This is important when Riot adds new champions. - /// - /// Field | Name | Identifier | Id - /// ---|---|---|--- - /// `NONE` | None (no ban) | | -1 - /// `AATROX` | "Aatrox" | "Aatrox" | 266 - /// `AHRI` | "Ahri" | "Ahri" | 103 - /// `AKALI` | "Akali" | "Akali" | 84 - /// `AKSHAN` | "Akshan" | "Akshan" | 166 - /// `ALISTAR` | "Alistar" | "Alistar" | 12 - /// `AMBESSA` | "Ambessa" | "Ambessa" | 799 - /// `AMUMU` | "Amumu" | "Amumu" | 32 - /// `ANIVIA` | "Anivia" | "Anivia" | 34 - /// `ANNIE` | "Annie" | "Annie" | 1 - /// `APHELIOS` | "Aphelios" | "Aphelios" | 523 - /// `ASHE` | "Ashe" | "Ashe" | 22 - /// `AURELION_SOL` | "Aurelion Sol" | "AurelionSol" | 136 - /// `AURORA` | "Aurora" | "Aurora" | 893 - /// `AZIR` | "Azir" | "Azir" | 268 - /// `BARD` | "Bard" | "Bard" | 432 - /// `BEL_VETH` | "Bel'Veth" | "Belveth" | 200 - /// `BLITZCRANK` | "Blitzcrank" | "Blitzcrank" | 53 - /// `BRAND` | "Brand" | "Brand" | 63 - /// `BRAUM` | "Braum" | "Braum" | 201 - /// `BRIAR` | "Briar" | "Briar" | 233 - /// `CAITLYN` | "Caitlyn" | "Caitlyn" | 51 - /// `CAMILLE` | "Camille" | "Camille" | 164 - /// `CASSIOPEIA` | "Cassiopeia" | "Cassiopeia" | 69 - /// `CHO_GATH` | "Cho'Gath" | "Chogath" | 31 - /// `CORKI` | "Corki" | "Corki" | 42 - /// `DARIUS` | "Darius" | "Darius" | 122 - /// `DIANA` | "Diana" | "Diana" | 131 - /// `DR_MUNDO` | "Dr. Mundo" | "DrMundo" | 36 - /// `DRAVEN` | "Draven" | "Draven" | 119 - /// `EKKO` | "Ekko" | "Ekko" | 245 - /// `ELISE` | "Elise" | "Elise" | 60 - /// `EVELYNN` | "Evelynn" | "Evelynn" | 28 - /// `EZREAL` | "Ezreal" | "Ezreal" | 81 - /// `FIDDLESTICKS` | "Fiddlesticks" | "FiddleSticks" | 9 - /// `FIORA` | "Fiora" | "Fiora" | 114 - /// `FIZZ` | "Fizz" | "Fizz" | 105 - /// `GALIO` | "Galio" | "Galio" | 3 - /// `GANGPLANK` | "Gangplank" | "Gangplank" | 41 - /// `GAREN` | "Garen" | "Garen" | 86 - /// `GNAR` | "Gnar" | "Gnar" | 150 - /// `GRAGAS` | "Gragas" | "Gragas" | 79 - /// `GRAVES` | "Graves" | "Graves" | 104 - /// `GWEN` | "Gwen" | "Gwen" | 887 - /// `HECARIM` | "Hecarim" | "Hecarim" | 120 - /// `HEIMERDINGER` | "Heimerdinger" | "Heimerdinger" | 74 - /// `HWEI` | "Hwei" | "Hwei" | 910 - /// `ILLAOI` | "Illaoi" | "Illaoi" | 420 - /// `IRELIA` | "Irelia" | "Irelia" | 39 - /// `IVERN` | "Ivern" | "Ivern" | 427 - /// `JANNA` | "Janna" | "Janna" | 40 - /// `JARVAN_IV` | "Jarvan IV" | "JarvanIV" | 59 - /// `JAX` | "Jax" | "Jax" | 24 - /// `JAYCE` | "Jayce" | "Jayce" | 126 - /// `JHIN` | "Jhin" | "Jhin" | 202 - /// `JINX` | "Jinx" | "Jinx" | 222 - /// `K_SANTE` | "K'Sante" | "KSante" | 897 - /// `KAI_SA` | "Kai'Sa" | "Kaisa" | 145 - /// `KALISTA` | "Kalista" | "Kalista" | 429 - /// `KARMA` | "Karma" | "Karma" | 43 - /// `KARTHUS` | "Karthus" | "Karthus" | 30 - /// `KASSADIN` | "Kassadin" | "Kassadin" | 38 - /// `KATARINA` | "Katarina" | "Katarina" | 55 - /// `KAYLE` | "Kayle" | "Kayle" | 10 - /// `KAYN` | "Kayn" | "Kayn" | 141 - /// `KENNEN` | "Kennen" | "Kennen" | 85 - /// `KHA_ZIX` | "Kha'Zix" | "Khazix" | 121 - /// `KINDRED` | "Kindred" | "Kindred" | 203 - /// `KLED` | "Kled" | "Kled" | 240 - /// `KOG_MAW` | "Kog'Maw" | "KogMaw" | 96 - /// `LE_BLANC` | "LeBlanc" | "Leblanc" | 7 - /// `LEE_SIN` | "Lee Sin" | "LeeSin" | 64 - /// `LEONA` | "Leona" | "Leona" | 89 - /// `LILLIA` | "Lillia" | "Lillia" | 876 - /// `LISSANDRA` | "Lissandra" | "Lissandra" | 127 - /// `LUCIAN` | "Lucian" | "Lucian" | 236 - /// `LULU` | "Lulu" | "Lulu" | 117 - /// `LUX` | "Lux" | "Lux" | 99 - /// `MALPHITE` | "Malphite" | "Malphite" | 54 - /// `MALZAHAR` | "Malzahar" | "Malzahar" | 90 - /// `MAOKAI` | "Maokai" | "Maokai" | 57 - /// `MASTER_YI` | "Master Yi" | "MasterYi" | 11 - /// `MEL` | "Mel" | "Mel" | 800 - /// `MILIO` | "Milio" | "Milio" | 902 - /// `MISS_FORTUNE` | "Miss Fortune" | "MissFortune" | 21 - /// `MORDEKAISER` | "Mordekaiser" | "Mordekaiser" | 82 - /// `MORGANA` | "Morgana" | "Morgana" | 25 - /// `NAAFIRI` | "Naafiri" | "Naafiri" | 950 - /// `NAMI` | "Nami" | "Nami" | 267 - /// `NASUS` | "Nasus" | "Nasus" | 75 - /// `NAUTILUS` | "Nautilus" | "Nautilus" | 111 - /// `NEEKO` | "Neeko" | "Neeko" | 518 - /// `NIDALEE` | "Nidalee" | "Nidalee" | 76 - /// `NILAH` | "Nilah" | "Nilah" | 895 - /// `NOCTURNE` | "Nocturne" | "Nocturne" | 56 - /// `NUNU_WILLUMP` | "Nunu & Willump" | "Nunu" | 20 - /// `OLAF` | "Olaf" | "Olaf" | 2 - /// `ORIANNA` | "Orianna" | "Orianna" | 61 - /// `ORNN` | "Ornn" | "Ornn" | 516 - /// `PANTHEON` | "Pantheon" | "Pantheon" | 80 - /// `POPPY` | "Poppy" | "Poppy" | 78 - /// `PYKE` | "Pyke" | "Pyke" | 555 - /// `QIYANA` | "Qiyana" | "Qiyana" | 246 - /// `QUINN` | "Quinn" | "Quinn" | 133 - /// `RAKAN` | "Rakan" | "Rakan" | 497 - /// `RAMMUS` | "Rammus" | "Rammus" | 33 - /// `REK_SAI` | "Rek'Sai" | "RekSai" | 421 - /// `RELL` | "Rell" | "Rell" | 526 - /// `RENATA_GLASC` | "Renata Glasc" | "Renata" | 888 - /// `RENEKTON` | "Renekton" | "Renekton" | 58 - /// `RENGAR` | "Rengar" | "Rengar" | 107 - /// `RIVEN` | "Riven" | "Riven" | 92 - /// `RUMBLE` | "Rumble" | "Rumble" | 68 - /// `RYZE` | "Ryze" | "Ryze" | 13 - /// `SAMIRA` | "Samira" | "Samira" | 360 - /// `SEJUANI` | "Sejuani" | "Sejuani" | 113 - /// `SENNA` | "Senna" | "Senna" | 235 - /// `SERAPHINE` | "Seraphine" | "Seraphine" | 147 - /// `SETT` | "Sett" | "Sett" | 875 - /// `SHACO` | "Shaco" | "Shaco" | 35 - /// `SHEN` | "Shen" | "Shen" | 98 - /// `SHYVANA` | "Shyvana" | "Shyvana" | 102 - /// `SINGED` | "Singed" | "Singed" | 27 - /// `SION` | "Sion" | "Sion" | 14 - /// `SIVIR` | "Sivir" | "Sivir" | 15 - /// `SKARNER` | "Skarner" | "Skarner" | 72 - /// `SMOLDER` | "Smolder" | "Smolder" | 901 - /// `SONA` | "Sona" | "Sona" | 37 - /// `SORAKA` | "Soraka" | "Soraka" | 16 - /// `SWAIN` | "Swain" | "Swain" | 50 - /// `SYLAS` | "Sylas" | "Sylas" | 517 - /// `SYNDRA` | "Syndra" | "Syndra" | 134 - /// `TAHM_KENCH` | "Tahm Kench" | "TahmKench" | 223 - /// `TALIYAH` | "Taliyah" | "Taliyah" | 163 - /// `TALON` | "Talon" | "Talon" | 91 - /// `TARIC` | "Taric" | "Taric" | 44 - /// `TEEMO` | "Teemo" | "Teemo" | 17 - /// `THRESH` | "Thresh" | "Thresh" | 412 - /// `TRISTANA` | "Tristana" | "Tristana" | 18 - /// `TRUNDLE` | "Trundle" | "Trundle" | 48 - /// `TRYNDAMERE` | "Tryndamere" | "Tryndamere" | 23 - /// `TWISTED_FATE` | "Twisted Fate" | "TwistedFate" | 4 - /// `TWITCH` | "Twitch" | "Twitch" | 29 - /// `UDYR` | "Udyr" | "Udyr" | 77 - /// `URGOT` | "Urgot" | "Urgot" | 6 - /// `VARUS` | "Varus" | "Varus" | 110 - /// `VAYNE` | "Vayne" | "Vayne" | 67 - /// `VEIGAR` | "Veigar" | "Veigar" | 45 - /// `VEL_KOZ` | "Vel'Koz" | "Velkoz" | 161 - /// `VEX` | "Vex" | "Vex" | 711 - /// `VI` | "Vi" | "Vi" | 254 - /// `VIEGO` | "Viego" | "Viego" | 234 - /// `VIKTOR` | "Viktor" | "Viktor" | 112 - /// `VLADIMIR` | "Vladimir" | "Vladimir" | 8 - /// `VOLIBEAR` | "Volibear" | "Volibear" | 106 - /// `WARWICK` | "Warwick" | "Warwick" | 19 - /// `WUKONG` | "Wukong" | "MonkeyKing" | 62 - /// `XAYAH` | "Xayah" | "Xayah" | 498 - /// `XERATH` | "Xerath" | "Xerath" | 101 - /// `XIN_ZHAO` | "Xin Zhao" | "XinZhao" | 5 - /// `YASUO` | "Yasuo" | "Yasuo" | 157 - /// `YONE` | "Yone" | "Yone" | 777 - /// `YORICK` | "Yorick" | "Yorick" | 83 - /// `YUUMI` | "Yuumi" | "Yuumi" | 350 - /// `ZAC` | "Zac" | "Zac" | 154 - /// `ZED` | "Zed" | "Zed" | 238 - /// `ZERI` | "Zeri" | "Zeri" | 221 - /// `ZIGGS` | "Ziggs" | "Ziggs" | 115 - /// `ZILEAN` | "Zilean" | "Zilean" | 26 - /// `ZOE` | "Zoe" | "Zoe" | 142 - /// `ZYRA` | "Zyra" | "Zyra" | 143 - pub newtype_enum Champion(i16) { - /// `-1`, none. Appears when a champion ban is not used in champ select. - NONE = -1, - - /// `266`. - AATROX = 266, - /// `103`. - AHRI = 103, - /// `84`. - AKALI = 84, - /// `166`. - AKSHAN = 166, - /// `12`. - ALISTAR = 12, - /// `799`. - AMBESSA = 799, - /// `32`. - AMUMU = 32, - /// `34`. - ANIVIA = 34, - /// `1`. - ANNIE = 1, - /// `523`. - APHELIOS = 523, - /// `22`. - ASHE = 22, - /// `136`. - AURELION_SOL = 136, - /// `893`. - AURORA = 893, - /// `268`. - AZIR = 268, - /// `432`. - BARD = 432, - /// `200`. - BEL_VETH = 200, - /// `53`. - BLITZCRANK = 53, - /// `63`. - BRAND = 63, - /// `201`. - BRAUM = 201, - /// `233`. - BRIAR = 233, - /// `51`. - CAITLYN = 51, - /// `164`. - CAMILLE = 164, - /// `69`. - CASSIOPEIA = 69, - /// `31`. - CHO_GATH = 31, - /// `42`. - CORKI = 42, - /// `122`. - DARIUS = 122, - /// `131`. - DIANA = 131, - /// `36`. - DR_MUNDO = 36, - /// `119`. - DRAVEN = 119, - /// `245`. - EKKO = 245, - /// `60`. - ELISE = 60, - /// `28`. - EVELYNN = 28, - /// `81`. - EZREAL = 81, - /// `9`. - FIDDLESTICKS = 9, - /// `114`. - FIORA = 114, - /// `105`. - FIZZ = 105, - /// `3`. - GALIO = 3, - /// `41`. - GANGPLANK = 41, - /// `86`. - GAREN = 86, - /// `150`. - GNAR = 150, - /// `79`. - GRAGAS = 79, - /// `104`. - GRAVES = 104, - /// `887`. - GWEN = 887, - /// `120`. - HECARIM = 120, - /// `74`. - HEIMERDINGER = 74, - /// `910`. - HWEI = 910, - /// `420`. - ILLAOI = 420, - /// `39`. - IRELIA = 39, - /// `427`. - IVERN = 427, - /// `40`. - JANNA = 40, - /// `59`. - JARVAN_IV = 59, - /// `24`. - JAX = 24, - /// `126`. - JAYCE = 126, - /// `202`. - JHIN = 202, - /// `222`. - JINX = 222, - /// `897`. - K_SANTE = 897, - /// `145`. - KAI_SA = 145, - /// `429`. - KALISTA = 429, - /// `43`. - KARMA = 43, - /// `30`. - KARTHUS = 30, - /// `38`. - KASSADIN = 38, - /// `55`. - KATARINA = 55, - /// `10`. - KAYLE = 10, - /// `141`. - KAYN = 141, - /// `85`. - KENNEN = 85, - /// `121`. - KHA_ZIX = 121, - /// `203`. - KINDRED = 203, - /// `240`. - KLED = 240, - /// `96`. - KOG_MAW = 96, - /// `7`. - LE_BLANC = 7, - /// `64`. - LEE_SIN = 64, - /// `89`. - LEONA = 89, - /// `876`. - LILLIA = 876, - /// `127`. - LISSANDRA = 127, - /// `236`. - LUCIAN = 236, - /// `117`. - LULU = 117, - /// `99`. - LUX = 99, - /// `54`. - MALPHITE = 54, - /// `90`. - MALZAHAR = 90, - /// `57`. - MAOKAI = 57, - /// `11`. - MASTER_YI = 11, - /// `800`. - MEL = 800, - /// `902`. - MILIO = 902, - /// `21`. - MISS_FORTUNE = 21, - /// `82`. - MORDEKAISER = 82, - /// `25`. - MORGANA = 25, - /// `950`. - NAAFIRI = 950, - /// `267`. - NAMI = 267, - /// `75`. - NASUS = 75, - /// `111`. - NAUTILUS = 111, - /// `518`. - NEEKO = 518, - /// `76`. - NIDALEE = 76, - /// `895`. - NILAH = 895, - /// `56`. - NOCTURNE = 56, - /// `20`. - NUNU_WILLUMP = 20, - /// `2`. - OLAF = 2, - /// `61`. - ORIANNA = 61, - /// `516`. - ORNN = 516, - /// `80`. - PANTHEON = 80, - /// `78`. - POPPY = 78, - /// `555`. - PYKE = 555, - /// `246`. - QIYANA = 246, - /// `133`. - QUINN = 133, - /// `497`. - RAKAN = 497, - /// `33`. - RAMMUS = 33, - /// `421`. - REK_SAI = 421, - /// `526`. - RELL = 526, - /// `888`. - RENATA_GLASC = 888, - /// `58`. - RENEKTON = 58, - /// `107`. - RENGAR = 107, - /// `92`. - RIVEN = 92, - /// `68`. - RUMBLE = 68, - /// `13`. - RYZE = 13, - /// `360`. - SAMIRA = 360, - /// `113`. - SEJUANI = 113, - /// `235`. - SENNA = 235, - /// `147`. - SERAPHINE = 147, - /// `875`. - SETT = 875, - /// `35`. - SHACO = 35, - /// `98`. - SHEN = 98, - /// `102`. - SHYVANA = 102, - /// `27`. - SINGED = 27, - /// `14`. - SION = 14, - /// `15`. - SIVIR = 15, - /// `72`. - SKARNER = 72, - /// `901`. - SMOLDER = 901, - /// `37`. - SONA = 37, - /// `16`. - SORAKA = 16, - /// `50`. - SWAIN = 50, - /// `517`. - SYLAS = 517, - /// `134`. - SYNDRA = 134, - /// `223`. - TAHM_KENCH = 223, - /// `163`. - TALIYAH = 163, - /// `91`. - TALON = 91, - /// `44`. - TARIC = 44, - /// `17`. - TEEMO = 17, - /// `412`. - THRESH = 412, - /// `18`. - TRISTANA = 18, - /// `48`. - TRUNDLE = 48, - /// `23`. - TRYNDAMERE = 23, - /// `4`. - TWISTED_FATE = 4, - /// `29`. - TWITCH = 29, - /// `77`. - UDYR = 77, - /// `6`. - URGOT = 6, - /// `110`. - VARUS = 110, - /// `67`. - VAYNE = 67, - /// `45`. - VEIGAR = 45, - /// `161`. - VEL_KOZ = 161, - /// `711`. - VEX = 711, - /// `254`. - VI = 254, - /// `234`. - VIEGO = 234, - /// `112`. - VIKTOR = 112, - /// `8`. - VLADIMIR = 8, - /// `106`. - VOLIBEAR = 106, - /// `19`. - WARWICK = 19, - /// `62`. - WUKONG = 62, - /// `498`. - XAYAH = 498, - /// `101`. - XERATH = 101, - /// `5`. - XIN_ZHAO = 5, - /// `157`. - YASUO = 157, - /// `777`. - YONE = 777, - /// `83`. - YORICK = 83, - /// `350`. - YUUMI = 350, - /// `154`. - ZAC = 154, - /// `238`. - ZED = 238, - /// `221`. - ZERI = 221, - /// `115`. - ZIGGS = 115, - /// `26`. - ZILEAN = 26, - /// `142`. - ZOE = 142, - /// `143`. - ZYRA = 143, - } -} +include_autogen!("champion.gen.rs"); impl Champion { - /// The champion's name (`en_US` localization). - pub const fn name(self) -> Option<&'static str> { - match self { - Self::AATROX => Some("Aatrox"), - Self::AHRI => Some("Ahri"), - Self::AKALI => Some("Akali"), - Self::AKSHAN => Some("Akshan"), - Self::ALISTAR => Some("Alistar"), - Self::AMBESSA => Some("Ambessa"), - Self::AMUMU => Some("Amumu"), - Self::ANIVIA => Some("Anivia"), - Self::ANNIE => Some("Annie"), - Self::APHELIOS => Some("Aphelios"), - Self::ASHE => Some("Ashe"), - Self::AURELION_SOL => Some("Aurelion Sol"), - Self::AURORA => Some("Aurora"), - Self::AZIR => Some("Azir"), - Self::BARD => Some("Bard"), - Self::BEL_VETH => Some("Bel'Veth"), - Self::BLITZCRANK => Some("Blitzcrank"), - Self::BRAND => Some("Brand"), - Self::BRAUM => Some("Braum"), - Self::BRIAR => Some("Briar"), - Self::CAITLYN => Some("Caitlyn"), - Self::CAMILLE => Some("Camille"), - Self::CASSIOPEIA => Some("Cassiopeia"), - Self::CHO_GATH => Some("Cho'Gath"), - Self::CORKI => Some("Corki"), - Self::DARIUS => Some("Darius"), - Self::DIANA => Some("Diana"), - Self::DR_MUNDO => Some("Dr. Mundo"), - Self::DRAVEN => Some("Draven"), - Self::EKKO => Some("Ekko"), - Self::ELISE => Some("Elise"), - Self::EVELYNN => Some("Evelynn"), - Self::EZREAL => Some("Ezreal"), - Self::FIDDLESTICKS => Some("Fiddlesticks"), - Self::FIORA => Some("Fiora"), - Self::FIZZ => Some("Fizz"), - Self::GALIO => Some("Galio"), - Self::GANGPLANK => Some("Gangplank"), - Self::GAREN => Some("Garen"), - Self::GNAR => Some("Gnar"), - Self::GRAGAS => Some("Gragas"), - Self::GRAVES => Some("Graves"), - Self::GWEN => Some("Gwen"), - Self::HECARIM => Some("Hecarim"), - Self::HEIMERDINGER => Some("Heimerdinger"), - Self::HWEI => Some("Hwei"), - Self::ILLAOI => Some("Illaoi"), - Self::IRELIA => Some("Irelia"), - Self::IVERN => Some("Ivern"), - Self::JANNA => Some("Janna"), - Self::JARVAN_IV => Some("Jarvan IV"), - Self::JAX => Some("Jax"), - Self::JAYCE => Some("Jayce"), - Self::JHIN => Some("Jhin"), - Self::JINX => Some("Jinx"), - Self::K_SANTE => Some("K'Sante"), - Self::KAI_SA => Some("Kai'Sa"), - Self::KALISTA => Some("Kalista"), - Self::KARMA => Some("Karma"), - Self::KARTHUS => Some("Karthus"), - Self::KASSADIN => Some("Kassadin"), - Self::KATARINA => Some("Katarina"), - Self::KAYLE => Some("Kayle"), - Self::KAYN => Some("Kayn"), - Self::KENNEN => Some("Kennen"), - Self::KHA_ZIX => Some("Kha'Zix"), - Self::KINDRED => Some("Kindred"), - Self::KLED => Some("Kled"), - Self::KOG_MAW => Some("Kog'Maw"), - Self::LE_BLANC => Some("LeBlanc"), - Self::LEE_SIN => Some("Lee Sin"), - Self::LEONA => Some("Leona"), - Self::LILLIA => Some("Lillia"), - Self::LISSANDRA => Some("Lissandra"), - Self::LUCIAN => Some("Lucian"), - Self::LULU => Some("Lulu"), - Self::LUX => Some("Lux"), - Self::MALPHITE => Some("Malphite"), - Self::MALZAHAR => Some("Malzahar"), - Self::MAOKAI => Some("Maokai"), - Self::MASTER_YI => Some("Master Yi"), - Self::MEL => Some("Mel"), - Self::MILIO => Some("Milio"), - Self::MISS_FORTUNE => Some("Miss Fortune"), - Self::MORDEKAISER => Some("Mordekaiser"), - Self::MORGANA => Some("Morgana"), - Self::NAAFIRI => Some("Naafiri"), - Self::NAMI => Some("Nami"), - Self::NASUS => Some("Nasus"), - Self::NAUTILUS => Some("Nautilus"), - Self::NEEKO => Some("Neeko"), - Self::NIDALEE => Some("Nidalee"), - Self::NILAH => Some("Nilah"), - Self::NOCTURNE => Some("Nocturne"), - Self::NUNU_WILLUMP => Some("Nunu & Willump"), - Self::OLAF => Some("Olaf"), - Self::ORIANNA => Some("Orianna"), - Self::ORNN => Some("Ornn"), - Self::PANTHEON => Some("Pantheon"), - Self::POPPY => Some("Poppy"), - Self::PYKE => Some("Pyke"), - Self::QIYANA => Some("Qiyana"), - Self::QUINN => Some("Quinn"), - Self::RAKAN => Some("Rakan"), - Self::RAMMUS => Some("Rammus"), - Self::REK_SAI => Some("Rek'Sai"), - Self::RELL => Some("Rell"), - Self::RENATA_GLASC => Some("Renata Glasc"), - Self::RENEKTON => Some("Renekton"), - Self::RENGAR => Some("Rengar"), - Self::RIVEN => Some("Riven"), - Self::RUMBLE => Some("Rumble"), - Self::RYZE => Some("Ryze"), - Self::SAMIRA => Some("Samira"), - Self::SEJUANI => Some("Sejuani"), - Self::SENNA => Some("Senna"), - Self::SERAPHINE => Some("Seraphine"), - Self::SETT => Some("Sett"), - Self::SHACO => Some("Shaco"), - Self::SHEN => Some("Shen"), - Self::SHYVANA => Some("Shyvana"), - Self::SINGED => Some("Singed"), - Self::SION => Some("Sion"), - Self::SIVIR => Some("Sivir"), - Self::SKARNER => Some("Skarner"), - Self::SMOLDER => Some("Smolder"), - Self::SONA => Some("Sona"), - Self::SORAKA => Some("Soraka"), - Self::SWAIN => Some("Swain"), - Self::SYLAS => Some("Sylas"), - Self::SYNDRA => Some("Syndra"), - Self::TAHM_KENCH => Some("Tahm Kench"), - Self::TALIYAH => Some("Taliyah"), - Self::TALON => Some("Talon"), - Self::TARIC => Some("Taric"), - Self::TEEMO => Some("Teemo"), - Self::THRESH => Some("Thresh"), - Self::TRISTANA => Some("Tristana"), - Self::TRUNDLE => Some("Trundle"), - Self::TRYNDAMERE => Some("Tryndamere"), - Self::TWISTED_FATE => Some("Twisted Fate"), - Self::TWITCH => Some("Twitch"), - Self::UDYR => Some("Udyr"), - Self::URGOT => Some("Urgot"), - Self::VARUS => Some("Varus"), - Self::VAYNE => Some("Vayne"), - Self::VEIGAR => Some("Veigar"), - Self::VEL_KOZ => Some("Vel'Koz"), - Self::VEX => Some("Vex"), - Self::VI => Some("Vi"), - Self::VIEGO => Some("Viego"), - Self::VIKTOR => Some("Viktor"), - Self::VLADIMIR => Some("Vladimir"), - Self::VOLIBEAR => Some("Volibear"), - Self::WARWICK => Some("Warwick"), - Self::WUKONG => Some("Wukong"), - Self::XAYAH => Some("Xayah"), - Self::XERATH => Some("Xerath"), - Self::XIN_ZHAO => Some("Xin Zhao"), - Self::YASUO => Some("Yasuo"), - Self::YONE => Some("Yone"), - Self::YORICK => Some("Yorick"), - Self::YUUMI => Some("Yuumi"), - Self::ZAC => Some("Zac"), - Self::ZED => Some("Zed"), - Self::ZERI => Some("Zeri"), - Self::ZIGGS => Some("Ziggs"), - Self::ZILEAN => Some("Zilean"), - Self::ZOE => Some("Zoe"), - Self::ZYRA => Some("Zyra"), - _ => None, - } - } - - /// The champion's identifier key. Somtimes called "key", "identifier", or "alias". - /// This is mainly used in DDragon paths. - /// - /// This is generally the `en_US` name with spaces and punctuation removed, - /// capitalization preserved, however the follow are exceptions: - /// - /// Field | Name | Identifier | Id - /// ---|---|---|--- - /// `BEL_VETH` | "Bel'Veth" | "Belveth" | 200 - /// `CHO_GATH` | "Cho'Gath" | "Chogath" | 31 - /// `FIDDLESTICKS` | "Fiddlesticks" | "FiddleSticks" | 9 - /// `KAI_SA` | "Kai'Sa" | "Kaisa" | 145 - /// `KHA_ZIX` | "Kha'Zix" | "Khazix" | 121 - /// `LE_BLANC` | "LeBlanc" | "Leblanc" | 7 - /// `NUNU_WILLUMP` | "Nunu & Willump" | "Nunu" | 20 - /// `RENATA_GLASC` | "Renata Glasc" | "Renata" | 888 - /// `VEL_KOZ` | "Vel'Koz" | "Velkoz" | 161 - /// `WUKONG` | "Wukong" | "MonkeyKing" | 62 - pub const fn identifier(self) -> Option<&'static str> { - match self { - Self::AATROX => Some("Aatrox"), - Self::AHRI => Some("Ahri"), - Self::AKALI => Some("Akali"), - Self::AKSHAN => Some("Akshan"), - Self::ALISTAR => Some("Alistar"), - Self::AMBESSA => Some("Ambessa"), - Self::AMUMU => Some("Amumu"), - Self::ANIVIA => Some("Anivia"), - Self::ANNIE => Some("Annie"), - Self::APHELIOS => Some("Aphelios"), - Self::ASHE => Some("Ashe"), - Self::AURELION_SOL => Some("AurelionSol"), - Self::AURORA => Some("Aurora"), - Self::AZIR => Some("Azir"), - Self::BARD => Some("Bard"), - Self::BEL_VETH => Some("Belveth"), - Self::BLITZCRANK => Some("Blitzcrank"), - Self::BRAND => Some("Brand"), - Self::BRAUM => Some("Braum"), - Self::BRIAR => Some("Briar"), - Self::CAITLYN => Some("Caitlyn"), - Self::CAMILLE => Some("Camille"), - Self::CASSIOPEIA => Some("Cassiopeia"), - Self::CHO_GATH => Some("Chogath"), - Self::CORKI => Some("Corki"), - Self::DARIUS => Some("Darius"), - Self::DIANA => Some("Diana"), - Self::DR_MUNDO => Some("DrMundo"), - Self::DRAVEN => Some("Draven"), - Self::EKKO => Some("Ekko"), - Self::ELISE => Some("Elise"), - Self::EVELYNN => Some("Evelynn"), - Self::EZREAL => Some("Ezreal"), - Self::FIDDLESTICKS => Some("FiddleSticks"), - Self::FIORA => Some("Fiora"), - Self::FIZZ => Some("Fizz"), - Self::GALIO => Some("Galio"), - Self::GANGPLANK => Some("Gangplank"), - Self::GAREN => Some("Garen"), - Self::GNAR => Some("Gnar"), - Self::GRAGAS => Some("Gragas"), - Self::GRAVES => Some("Graves"), - Self::GWEN => Some("Gwen"), - Self::HECARIM => Some("Hecarim"), - Self::HEIMERDINGER => Some("Heimerdinger"), - Self::HWEI => Some("Hwei"), - Self::ILLAOI => Some("Illaoi"), - Self::IRELIA => Some("Irelia"), - Self::IVERN => Some("Ivern"), - Self::JANNA => Some("Janna"), - Self::JARVAN_IV => Some("JarvanIV"), - Self::JAX => Some("Jax"), - Self::JAYCE => Some("Jayce"), - Self::JHIN => Some("Jhin"), - Self::JINX => Some("Jinx"), - Self::K_SANTE => Some("KSante"), - Self::KAI_SA => Some("Kaisa"), - Self::KALISTA => Some("Kalista"), - Self::KARMA => Some("Karma"), - Self::KARTHUS => Some("Karthus"), - Self::KASSADIN => Some("Kassadin"), - Self::KATARINA => Some("Katarina"), - Self::KAYLE => Some("Kayle"), - Self::KAYN => Some("Kayn"), - Self::KENNEN => Some("Kennen"), - Self::KHA_ZIX => Some("Khazix"), - Self::KINDRED => Some("Kindred"), - Self::KLED => Some("Kled"), - Self::KOG_MAW => Some("KogMaw"), - Self::LE_BLANC => Some("Leblanc"), - Self::LEE_SIN => Some("LeeSin"), - Self::LEONA => Some("Leona"), - Self::LILLIA => Some("Lillia"), - Self::LISSANDRA => Some("Lissandra"), - Self::LUCIAN => Some("Lucian"), - Self::LULU => Some("Lulu"), - Self::LUX => Some("Lux"), - Self::MALPHITE => Some("Malphite"), - Self::MALZAHAR => Some("Malzahar"), - Self::MAOKAI => Some("Maokai"), - Self::MASTER_YI => Some("MasterYi"), - Self::MEL => Some("Mel"), - Self::MILIO => Some("Milio"), - Self::MISS_FORTUNE => Some("MissFortune"), - Self::MORDEKAISER => Some("Mordekaiser"), - Self::MORGANA => Some("Morgana"), - Self::NAAFIRI => Some("Naafiri"), - Self::NAMI => Some("Nami"), - Self::NASUS => Some("Nasus"), - Self::NAUTILUS => Some("Nautilus"), - Self::NEEKO => Some("Neeko"), - Self::NIDALEE => Some("Nidalee"), - Self::NILAH => Some("Nilah"), - Self::NOCTURNE => Some("Nocturne"), - Self::NUNU_WILLUMP => Some("Nunu"), - Self::OLAF => Some("Olaf"), - Self::ORIANNA => Some("Orianna"), - Self::ORNN => Some("Ornn"), - Self::PANTHEON => Some("Pantheon"), - Self::POPPY => Some("Poppy"), - Self::PYKE => Some("Pyke"), - Self::QIYANA => Some("Qiyana"), - Self::QUINN => Some("Quinn"), - Self::RAKAN => Some("Rakan"), - Self::RAMMUS => Some("Rammus"), - Self::REK_SAI => Some("RekSai"), - Self::RELL => Some("Rell"), - Self::RENATA_GLASC => Some("Renata"), - Self::RENEKTON => Some("Renekton"), - Self::RENGAR => Some("Rengar"), - Self::RIVEN => Some("Riven"), - Self::RUMBLE => Some("Rumble"), - Self::RYZE => Some("Ryze"), - Self::SAMIRA => Some("Samira"), - Self::SEJUANI => Some("Sejuani"), - Self::SENNA => Some("Senna"), - Self::SERAPHINE => Some("Seraphine"), - Self::SETT => Some("Sett"), - Self::SHACO => Some("Shaco"), - Self::SHEN => Some("Shen"), - Self::SHYVANA => Some("Shyvana"), - Self::SINGED => Some("Singed"), - Self::SION => Some("Sion"), - Self::SIVIR => Some("Sivir"), - Self::SKARNER => Some("Skarner"), - Self::SMOLDER => Some("Smolder"), - Self::SONA => Some("Sona"), - Self::SORAKA => Some("Soraka"), - Self::SWAIN => Some("Swain"), - Self::SYLAS => Some("Sylas"), - Self::SYNDRA => Some("Syndra"), - Self::TAHM_KENCH => Some("TahmKench"), - Self::TALIYAH => Some("Taliyah"), - Self::TALON => Some("Talon"), - Self::TARIC => Some("Taric"), - Self::TEEMO => Some("Teemo"), - Self::THRESH => Some("Thresh"), - Self::TRISTANA => Some("Tristana"), - Self::TRUNDLE => Some("Trundle"), - Self::TRYNDAMERE => Some("Tryndamere"), - Self::TWISTED_FATE => Some("TwistedFate"), - Self::TWITCH => Some("Twitch"), - Self::UDYR => Some("Udyr"), - Self::URGOT => Some("Urgot"), - Self::VARUS => Some("Varus"), - Self::VAYNE => Some("Vayne"), - Self::VEIGAR => Some("Veigar"), - Self::VEL_KOZ => Some("Velkoz"), - Self::VEX => Some("Vex"), - Self::VI => Some("Vi"), - Self::VIEGO => Some("Viego"), - Self::VIKTOR => Some("Viktor"), - Self::VLADIMIR => Some("Vladimir"), - Self::VOLIBEAR => Some("Volibear"), - Self::WARWICK => Some("Warwick"), - Self::WUKONG => Some("MonkeyKing"), - Self::XAYAH => Some("Xayah"), - Self::XERATH => Some("Xerath"), - Self::XIN_ZHAO => Some("XinZhao"), - Self::YASUO => Some("Yasuo"), - Self::YONE => Some("Yone"), - Self::YORICK => Some("Yorick"), - Self::YUUMI => Some("Yuumi"), - Self::ZAC => Some("Zac"), - Self::ZED => Some("Zed"), - Self::ZERI => Some("Zeri"), - Self::ZIGGS => Some("Ziggs"), - Self::ZILEAN => Some("Zilean"), - Self::ZOE => Some("Zoe"), - Self::ZYRA => Some("Zyra"), - _ => None, - } - } - /// https://github.com/MingweiSamuel/Riven/issues/36 pub(crate) fn serialize_result( val: &Result, @@ -945,204 +40,6 @@ impl std::fmt::Display for ParseChampionError { } impl std::error::Error for ParseChampionError {} -impl std::str::FromStr for Champion { - type Err = ParseChampionError; - fn from_str(s: &str) -> Result { - let mut chars = ['\0'; 4]; - s.chars() - .take(4) - .filter(|c| c.is_ascii_alphanumeric()) - .map(|c| c.to_ascii_uppercase()) - .enumerate() - .for_each(|(i, c)| chars[i] = c); - match chars { - /* AATR */ [ 'A', 'A', 'T', 'R'] => Ok(Champion::AATROX), - /* AHRI */ [ 'A', 'H', 'R', 'I'] => Ok(Champion::AHRI), - /* AKAL */ [ 'A', 'K', 'A', 'L'] => Ok(Champion::AKALI), - /* AKSH */ [ 'A', 'K', 'S', 'H'] => Ok(Champion::AKSHAN), - /* ALIS */ [ 'A', 'L', 'I', 'S'] => Ok(Champion::ALISTAR), - /* AMBE */ [ 'A', 'M', 'B', 'E'] => Ok(Champion::AMBESSA), - /* AMUM */ [ 'A', 'M', 'U', 'M'] => Ok(Champion::AMUMU), - /* ANIV */ [ 'A', 'N', 'I', 'V'] => Ok(Champion::ANIVIA), - /* ANNI */ [ 'A', 'N', 'N', 'I'] => Ok(Champion::ANNIE), - /* APHE */ [ 'A', 'P', 'H', 'E'] => Ok(Champion::APHELIOS), - /* ASHE */ [ 'A', 'S', 'H', 'E'] => Ok(Champion::ASHE), - /* AURE */ [ 'A', 'U', 'R', 'E'] => Ok(Champion::AURELION_SOL), - /* AURO */ [ 'A', 'U', 'R', 'O'] => Ok(Champion::AURORA), - /* AZIR */ [ 'A', 'Z', 'I', 'R'] => Ok(Champion::AZIR), - /* BARD */ [ 'B', 'A', 'R', 'D'] => Ok(Champion::BARD), - /* BELV */ [ 'B', 'E', 'L', 'V'] => Ok(Champion::BEL_VETH), - /* BEL */ [ 'B', 'E', 'L', '\0'] => Ok(Champion::BEL_VETH), - /* BLIT */ [ 'B', 'L', 'I', 'T'] => Ok(Champion::BLITZCRANK), - /* BRAN */ [ 'B', 'R', 'A', 'N'] => Ok(Champion::BRAND), - /* BRAU */ [ 'B', 'R', 'A', 'U'] => Ok(Champion::BRAUM), - /* BRIA */ [ 'B', 'R', 'I', 'A'] => Ok(Champion::BRIAR), - /* CAIT */ [ 'C', 'A', 'I', 'T'] => Ok(Champion::CAITLYN), - /* CAMI */ [ 'C', 'A', 'M', 'I'] => Ok(Champion::CAMILLE), - /* CASS */ [ 'C', 'A', 'S', 'S'] => Ok(Champion::CASSIOPEIA), - /* CHOG */ [ 'C', 'H', 'O', 'G'] => Ok(Champion::CHO_GATH), - /* CHO */ [ 'C', 'H', 'O', '\0'] => Ok(Champion::CHO_GATH), - /* CORK */ [ 'C', 'O', 'R', 'K'] => Ok(Champion::CORKI), - /* DARI */ [ 'D', 'A', 'R', 'I'] => Ok(Champion::DARIUS), - /* DIAN */ [ 'D', 'I', 'A', 'N'] => Ok(Champion::DIANA), - /* DRMU */ [ 'D', 'R', 'M', 'U'] => Ok(Champion::DR_MUNDO), - /* DR */ [ 'D', 'R', '\0', '\0'] => Ok(Champion::DR_MUNDO), - /* DRAV */ [ 'D', 'R', 'A', 'V'] => Ok(Champion::DRAVEN), - /* EKKO */ [ 'E', 'K', 'K', 'O'] => Ok(Champion::EKKO), - /* ELIS */ [ 'E', 'L', 'I', 'S'] => Ok(Champion::ELISE), - /* EVEL */ [ 'E', 'V', 'E', 'L'] => Ok(Champion::EVELYNN), - /* EZRE */ [ 'E', 'Z', 'R', 'E'] => Ok(Champion::EZREAL), - /* FIDD */ [ 'F', 'I', 'D', 'D'] => Ok(Champion::FIDDLESTICKS), - /* FIOR */ [ 'F', 'I', 'O', 'R'] => Ok(Champion::FIORA), - /* FIZZ */ [ 'F', 'I', 'Z', 'Z'] => Ok(Champion::FIZZ), - /* GALI */ [ 'G', 'A', 'L', 'I'] => Ok(Champion::GALIO), - /* GANG */ [ 'G', 'A', 'N', 'G'] => Ok(Champion::GANGPLANK), - /* GARE */ [ 'G', 'A', 'R', 'E'] => Ok(Champion::GAREN), - /* GNAR */ [ 'G', 'N', 'A', 'R'] => Ok(Champion::GNAR), - /* GRAG */ [ 'G', 'R', 'A', 'G'] => Ok(Champion::GRAGAS), - /* GRAV */ [ 'G', 'R', 'A', 'V'] => Ok(Champion::GRAVES), - /* GWEN */ [ 'G', 'W', 'E', 'N'] => Ok(Champion::GWEN), - /* HECA */ [ 'H', 'E', 'C', 'A'] => Ok(Champion::HECARIM), - /* HEIM */ [ 'H', 'E', 'I', 'M'] => Ok(Champion::HEIMERDINGER), - /* HWEI */ [ 'H', 'W', 'E', 'I'] => Ok(Champion::HWEI), - /* ILLA */ [ 'I', 'L', 'L', 'A'] => Ok(Champion::ILLAOI), - /* IREL */ [ 'I', 'R', 'E', 'L'] => Ok(Champion::IRELIA), - /* IVER */ [ 'I', 'V', 'E', 'R'] => Ok(Champion::IVERN), - /* JANN */ [ 'J', 'A', 'N', 'N'] => Ok(Champion::JANNA), - /* JARV */ [ 'J', 'A', 'R', 'V'] => Ok(Champion::JARVAN_IV), - /* JAX */ [ 'J', 'A', 'X', '\0'] => Ok(Champion::JAX), - /* JAYC */ [ 'J', 'A', 'Y', 'C'] => Ok(Champion::JAYCE), - /* JHIN */ [ 'J', 'H', 'I', 'N'] => Ok(Champion::JHIN), - /* JINX */ [ 'J', 'I', 'N', 'X'] => Ok(Champion::JINX), - /* KSAN */ [ 'K', 'S', 'A', 'N'] => Ok(Champion::K_SANTE), - /* K */ [ 'K', '\0', '\0', '\0'] => Ok(Champion::K_SANTE), - /* KAIS */ [ 'K', 'A', 'I', 'S'] => Ok(Champion::KAI_SA), - /* KAI */ [ 'K', 'A', 'I', '\0'] => Ok(Champion::KAI_SA), - /* KALI */ [ 'K', 'A', 'L', 'I'] => Ok(Champion::KALISTA), - /* KARM */ [ 'K', 'A', 'R', 'M'] => Ok(Champion::KARMA), - /* KART */ [ 'K', 'A', 'R', 'T'] => Ok(Champion::KARTHUS), - /* KASS */ [ 'K', 'A', 'S', 'S'] => Ok(Champion::KASSADIN), - /* KATA */ [ 'K', 'A', 'T', 'A'] => Ok(Champion::KATARINA), - /* KAYL */ [ 'K', 'A', 'Y', 'L'] => Ok(Champion::KAYLE), - /* KAYN */ [ 'K', 'A', 'Y', 'N'] => Ok(Champion::KAYN), - /* KENN */ [ 'K', 'E', 'N', 'N'] => Ok(Champion::KENNEN), - /* KHAZ */ [ 'K', 'H', 'A', 'Z'] => Ok(Champion::KHA_ZIX), - /* KHA */ [ 'K', 'H', 'A', '\0'] => Ok(Champion::KHA_ZIX), - /* KIND */ [ 'K', 'I', 'N', 'D'] => Ok(Champion::KINDRED), - /* KLED */ [ 'K', 'L', 'E', 'D'] => Ok(Champion::KLED), - /* KOGM */ [ 'K', 'O', 'G', 'M'] => Ok(Champion::KOG_MAW), - /* KOG */ [ 'K', 'O', 'G', '\0'] => Ok(Champion::KOG_MAW), - /* LEBL */ [ 'L', 'E', 'B', 'L'] => Ok(Champion::LE_BLANC), - /* LEES */ [ 'L', 'E', 'E', 'S'] => Ok(Champion::LEE_SIN), - /* LEE */ [ 'L', 'E', 'E', '\0'] => Ok(Champion::LEE_SIN), - /* LEON */ [ 'L', 'E', 'O', 'N'] => Ok(Champion::LEONA), - /* LILL */ [ 'L', 'I', 'L', 'L'] => Ok(Champion::LILLIA), - /* LISS */ [ 'L', 'I', 'S', 'S'] => Ok(Champion::LISSANDRA), - /* LUCI */ [ 'L', 'U', 'C', 'I'] => Ok(Champion::LUCIAN), - /* LULU */ [ 'L', 'U', 'L', 'U'] => Ok(Champion::LULU), - /* LUX */ [ 'L', 'U', 'X', '\0'] => Ok(Champion::LUX), - /* MALP */ [ 'M', 'A', 'L', 'P'] => Ok(Champion::MALPHITE), - /* MALZ */ [ 'M', 'A', 'L', 'Z'] => Ok(Champion::MALZAHAR), - /* MAOK */ [ 'M', 'A', 'O', 'K'] => Ok(Champion::MAOKAI), - /* MAST */ [ 'M', 'A', 'S', 'T'] => Ok(Champion::MASTER_YI), - /* MEL */ [ 'M', 'E', 'L', '\0'] => Ok(Champion::MEL), - /* MILI */ [ 'M', 'I', 'L', 'I'] => Ok(Champion::MILIO), - /* MISS */ [ 'M', 'I', 'S', 'S'] => Ok(Champion::MISS_FORTUNE), - /* MORD */ [ 'M', 'O', 'R', 'D'] => Ok(Champion::MORDEKAISER), - /* MORG */ [ 'M', 'O', 'R', 'G'] => Ok(Champion::MORGANA), - /* NAAF */ [ 'N', 'A', 'A', 'F'] => Ok(Champion::NAAFIRI), - /* NAMI */ [ 'N', 'A', 'M', 'I'] => Ok(Champion::NAMI), - /* NASU */ [ 'N', 'A', 'S', 'U'] => Ok(Champion::NASUS), - /* NAUT */ [ 'N', 'A', 'U', 'T'] => Ok(Champion::NAUTILUS), - /* NEEK */ [ 'N', 'E', 'E', 'K'] => Ok(Champion::NEEKO), - /* NIDA */ [ 'N', 'I', 'D', 'A'] => Ok(Champion::NIDALEE), - /* NILA */ [ 'N', 'I', 'L', 'A'] => Ok(Champion::NILAH), - /* NOCT */ [ 'N', 'O', 'C', 'T'] => Ok(Champion::NOCTURNE), - /* NUNU */ [ 'N', 'U', 'N', 'U'] => Ok(Champion::NUNU_WILLUMP), - /* OLAF */ [ 'O', 'L', 'A', 'F'] => Ok(Champion::OLAF), - /* ORIA */ [ 'O', 'R', 'I', 'A'] => Ok(Champion::ORIANNA), - /* ORNN */ [ 'O', 'R', 'N', 'N'] => Ok(Champion::ORNN), - /* PANT */ [ 'P', 'A', 'N', 'T'] => Ok(Champion::PANTHEON), - /* POPP */ [ 'P', 'O', 'P', 'P'] => Ok(Champion::POPPY), - /* PYKE */ [ 'P', 'Y', 'K', 'E'] => Ok(Champion::PYKE), - /* QIYA */ [ 'Q', 'I', 'Y', 'A'] => Ok(Champion::QIYANA), - /* QUIN */ [ 'Q', 'U', 'I', 'N'] => Ok(Champion::QUINN), - /* RAKA */ [ 'R', 'A', 'K', 'A'] => Ok(Champion::RAKAN), - /* RAMM */ [ 'R', 'A', 'M', 'M'] => Ok(Champion::RAMMUS), - /* REKS */ [ 'R', 'E', 'K', 'S'] => Ok(Champion::REK_SAI), - /* REK */ [ 'R', 'E', 'K', '\0'] => Ok(Champion::REK_SAI), - /* RELL */ [ 'R', 'E', 'L', 'L'] => Ok(Champion::RELL), - /* RENA */ [ 'R', 'E', 'N', 'A'] => Ok(Champion::RENATA_GLASC), - /* RENE */ [ 'R', 'E', 'N', 'E'] => Ok(Champion::RENEKTON), - /* RENG */ [ 'R', 'E', 'N', 'G'] => Ok(Champion::RENGAR), - /* RIVE */ [ 'R', 'I', 'V', 'E'] => Ok(Champion::RIVEN), - /* RUMB */ [ 'R', 'U', 'M', 'B'] => Ok(Champion::RUMBLE), - /* RYZE */ [ 'R', 'Y', 'Z', 'E'] => Ok(Champion::RYZE), - /* SAMI */ [ 'S', 'A', 'M', 'I'] => Ok(Champion::SAMIRA), - /* SEJU */ [ 'S', 'E', 'J', 'U'] => Ok(Champion::SEJUANI), - /* SENN */ [ 'S', 'E', 'N', 'N'] => Ok(Champion::SENNA), - /* SERA */ [ 'S', 'E', 'R', 'A'] => Ok(Champion::SERAPHINE), - /* SETT */ [ 'S', 'E', 'T', 'T'] => Ok(Champion::SETT), - /* SHAC */ [ 'S', 'H', 'A', 'C'] => Ok(Champion::SHACO), - /* SHEN */ [ 'S', 'H', 'E', 'N'] => Ok(Champion::SHEN), - /* SHYV */ [ 'S', 'H', 'Y', 'V'] => Ok(Champion::SHYVANA), - /* SING */ [ 'S', 'I', 'N', 'G'] => Ok(Champion::SINGED), - /* SION */ [ 'S', 'I', 'O', 'N'] => Ok(Champion::SION), - /* SIVI */ [ 'S', 'I', 'V', 'I'] => Ok(Champion::SIVIR), - /* SKAR */ [ 'S', 'K', 'A', 'R'] => Ok(Champion::SKARNER), - /* SMOL */ [ 'S', 'M', 'O', 'L'] => Ok(Champion::SMOLDER), - /* SONA */ [ 'S', 'O', 'N', 'A'] => Ok(Champion::SONA), - /* SORA */ [ 'S', 'O', 'R', 'A'] => Ok(Champion::SORAKA), - /* SWAI */ [ 'S', 'W', 'A', 'I'] => Ok(Champion::SWAIN), - /* SYLA */ [ 'S', 'Y', 'L', 'A'] => Ok(Champion::SYLAS), - /* SYND */ [ 'S', 'Y', 'N', 'D'] => Ok(Champion::SYNDRA), - /* TAHM */ [ 'T', 'A', 'H', 'M'] => Ok(Champion::TAHM_KENCH), - /* TALI */ [ 'T', 'A', 'L', 'I'] => Ok(Champion::TALIYAH), - /* TALO */ [ 'T', 'A', 'L', 'O'] => Ok(Champion::TALON), - /* TARI */ [ 'T', 'A', 'R', 'I'] => Ok(Champion::TARIC), - /* TEEM */ [ 'T', 'E', 'E', 'M'] => Ok(Champion::TEEMO), - /* THRE */ [ 'T', 'H', 'R', 'E'] => Ok(Champion::THRESH), - /* TRIS */ [ 'T', 'R', 'I', 'S'] => Ok(Champion::TRISTANA), - /* TRUN */ [ 'T', 'R', 'U', 'N'] => Ok(Champion::TRUNDLE), - /* TRYN */ [ 'T', 'R', 'Y', 'N'] => Ok(Champion::TRYNDAMERE), - /* TWIS */ [ 'T', 'W', 'I', 'S'] => Ok(Champion::TWISTED_FATE), - /* TWIT */ [ 'T', 'W', 'I', 'T'] => Ok(Champion::TWITCH), - /* UDYR */ [ 'U', 'D', 'Y', 'R'] => Ok(Champion::UDYR), - /* URGO */ [ 'U', 'R', 'G', 'O'] => Ok(Champion::URGOT), - /* VARU */ [ 'V', 'A', 'R', 'U'] => Ok(Champion::VARUS), - /* VAYN */ [ 'V', 'A', 'Y', 'N'] => Ok(Champion::VAYNE), - /* VEIG */ [ 'V', 'E', 'I', 'G'] => Ok(Champion::VEIGAR), - /* VELK */ [ 'V', 'E', 'L', 'K'] => Ok(Champion::VEL_KOZ), - /* VEL */ [ 'V', 'E', 'L', '\0'] => Ok(Champion::VEL_KOZ), - /* VEX */ [ 'V', 'E', 'X', '\0'] => Ok(Champion::VEX), - /* VI */ [ 'V', 'I', '\0', '\0'] => Ok(Champion::VI), - /* VIEG */ [ 'V', 'I', 'E', 'G'] => Ok(Champion::VIEGO), - /* VIKT */ [ 'V', 'I', 'K', 'T'] => Ok(Champion::VIKTOR), - /* VLAD */ [ 'V', 'L', 'A', 'D'] => Ok(Champion::VLADIMIR), - /* VOLI */ [ 'V', 'O', 'L', 'I'] => Ok(Champion::VOLIBEAR), - /* WARW */ [ 'W', 'A', 'R', 'W'] => Ok(Champion::WARWICK), - /* WUKO */ [ 'W', 'U', 'K', 'O'] => Ok(Champion::WUKONG), - /* MONK */ [ 'M', 'O', 'N', 'K'] => Ok(Champion::WUKONG), - /* XAYA */ [ 'X', 'A', 'Y', 'A'] => Ok(Champion::XAYAH), - /* XERA */ [ 'X', 'E', 'R', 'A'] => Ok(Champion::XERATH), - /* XINZ */ [ 'X', 'I', 'N', 'Z'] => Ok(Champion::XIN_ZHAO), - /* XIN */ [ 'X', 'I', 'N', '\0'] => Ok(Champion::XIN_ZHAO), - /* YASU */ [ 'Y', 'A', 'S', 'U'] => Ok(Champion::YASUO), - /* YONE */ [ 'Y', 'O', 'N', 'E'] => Ok(Champion::YONE), - /* YORI */ [ 'Y', 'O', 'R', 'I'] => Ok(Champion::YORICK), - /* YUUM */ [ 'Y', 'U', 'U', 'M'] => Ok(Champion::YUUMI), - /* ZAC */ [ 'Z', 'A', 'C', '\0'] => Ok(Champion::ZAC), - /* ZED */ [ 'Z', 'E', 'D', '\0'] => Ok(Champion::ZED), - /* ZERI */ [ 'Z', 'E', 'R', 'I'] => Ok(Champion::ZERI), - /* ZIGG */ [ 'Z', 'I', 'G', 'G'] => Ok(Champion::ZIGGS), - /* ZILE */ [ 'Z', 'I', 'L', 'E'] => Ok(Champion::ZILEAN), - /* ZOE */ [ 'Z', 'O', 'E', '\0'] => Ok(Champion::ZOE), - /* ZYRA */ [ 'Z', 'Y', 'R', 'A'] => Ok(Champion::ZYRA), - unknown => Err(ParseChampionError(unknown)), - } - } -} - impl std::convert::TryFrom<&str> for Champion { type Error = ::Err; fn try_from(value: &str) -> Result { diff --git a/riven/src/consts/game_mode.gen.rs b/riven/src/consts/game_mode.gen.rs new file mode 100644 index 00000000..39e54726 --- /dev/null +++ b/riven/src/consts/game_mode.gen.rs @@ -0,0 +1,71 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +use strum_macros::{EnumString, EnumVariantNames, IntoStaticStr}; +///League of Legends game mode, such as Classic, ARAM, URF, One For All, Ascension, etc. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(EnumString, EnumVariantNames, IntoStaticStr)] +#[repr(u8)] +pub enum GameMode { + /// Catch-all variant for new/unknown values. + #[strum(default)] + UNKNOWN(String), + ///ARAM games + ARAM, + ///All Random Summoner's Rift games + ARSR, + ///Ascension games + ASCENSION, + ///Blood Hunt Assassin games + ASSASSINATE, + ///2v2v2v2 Arena + CHERRY, + ///Classic Summoner's Rift and Twisted Treeline games + CLASSIC, + ///Dark Star: Singularity games + DARKSTAR, + ///Doom Bot games + DOOMBOTSTEEMO, + ///Snowdown Showdown games + FIRSTBLOOD, + ///Nexus Blitz games + GAMEMODEX, + ///Legend of the Poro King games + KINGPORO, + ///Nexus Blitz games + NEXUSBLITZ, + ///Dominion/Crystal Scar games + ODIN, + ///Odyssey: Extraction games + ODYSSEY, + ///One for All games + ONEFORALL, + ///Practice tool training games. + PRACTICETOOL, + ///PROJECT: Hunters games + PROJECT, + ///Nexus Siege games + SIEGE, + ///Star Guardian Invasion games + STARGUARDIAN, + ///Swarm + STRAWBERRY, + ///Swiftplay Summoner's Rift + SWIFTPLAY, + ///Teamfight Tactics. + TFT, + ///Tutorial games + TUTORIAL, + ///Tutorial: Welcome to League. + TUTORIAL_MODULE_1, + ///Tutorial: Power Up. + TUTORIAL_MODULE_2, + ///Tutorial: Shop for Gear. + TUTORIAL_MODULE_3, + ///Ultimate Spellbook games + ULTBOOK, + ///URF games + URF, +} +serde_strum_unknown!(GameMode); + diff --git a/riven/src/consts/game_mode.rs b/riven/src/consts/game_mode.rs deleted file mode 100644 index 89f9708a..00000000 --- a/riven/src/consts/game_mode.rs +++ /dev/null @@ -1,82 +0,0 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -use strum_macros::{ EnumString, EnumVariantNames, IntoStaticStr }; - -/// League of Legends game mode, such as Classic, -/// ARAM, URF, One For All, Ascension, etc. -#[non_exhaustive] -#[derive(Debug, Clone)] -#[derive(Eq, PartialEq, Hash)] -#[derive(EnumString, EnumVariantNames, IntoStaticStr)] -#[repr(u8)] -pub enum GameMode { - /// Catch-all variant for new, unknown game modes. - #[strum(default)] - UNKNOWN(String), - - /// ARAM games - ARAM, - /// All Random Summoner's Rift games - ARSR, - /// Ascension games - ASCENSION, - /// Blood Hunt Assassin games - ASSASSINATE, - /// 2v2v2v2 Arena - CHERRY, - /// Classic Summoner's Rift and Twisted Treeline games - CLASSIC, - /// Dark Star: Singularity games - DARKSTAR, - /// Doom Bot games - DOOMBOTSTEEMO, - /// Snowdown Showdown games - FIRSTBLOOD, - /// Nexus Blitz games - GAMEMODEX, - /// Legend of the Poro King games - KINGPORO, - /// Nexus Blitz games - NEXUSBLITZ, - /// Dominion/Crystal Scar games - ODIN, - /// Odyssey: Extraction games - ODYSSEY, - /// One for All games - ONEFORALL, - /// Practice tool training games. - PRACTICETOOL, - /// PROJECT: Hunters games - PROJECT, - /// Nexus Siege games - SIEGE, - /// Star Guardian Invasion games - STARGUARDIAN, - /// Swarm - STRAWBERRY, - /// Swiftplay Summoner's Rift - SWIFTPLAY, - /// Teamfight Tactics. - TFT, - /// Tutorial games - TUTORIAL, - /// Tutorial: Welcome to League. - TUTORIAL_MODULE_1, - /// Tutorial: Power Up. - TUTORIAL_MODULE_2, - /// Tutorial: Shop for Gear. - TUTORIAL_MODULE_3, - /// Ultimate Spellbook games - ULTBOOK, - /// URF games - URF, -} - -serde_strum_unknown!(GameMode); diff --git a/riven/src/consts/game_type.gen.rs b/riven/src/consts/game_type.gen.rs new file mode 100644 index 00000000..eea604c8 --- /dev/null +++ b/riven/src/consts/game_type.gen.rs @@ -0,0 +1,24 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +use strum_macros::{EnumString, Display, AsRefStr, IntoStaticStr}; +/// League of Legends game type: matched game, custom game, or tutorial game. +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[derive(EnumString, Display, AsRefStr, IntoStaticStr)] +#[derive(serde::Serialize, crate::de::Deserialize)] +#[repr(u8)] +pub enum GameType { + ///Custom games + #[strum(to_string = "CUSTOM_GAME", serialize = "CUSTOM")] + #[serde(alias = "CUSTOM")] + CUSTOM_GAME, + ///all other games + #[strum(to_string = "MATCHED_GAME", serialize = "MATCHED")] + #[serde(alias = "MATCHED")] + MATCHED_GAME, + ///Tutorial games + #[strum(to_string = "TUTORIAL_GAME", serialize = "TUTORIAL")] + #[serde(alias = "TUTORIAL")] + TUTORIAL_GAME, +} + diff --git a/riven/src/consts/game_type.rs b/riven/src/consts/game_type.rs index 6c6493d5..033182b6 100644 --- a/riven/src/consts/game_type.rs +++ b/riven/src/consts/game_type.rs @@ -1,34 +1,32 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// +include_autogen!("game_type.gen.rs"); -use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr }; +#[cfg(test)] +mod test { + use super::*; -/// League of Legends game type: matched game, custom game, or tutorial game. -#[derive(Debug, Copy, Clone)] -#[derive(Eq, PartialEq, Hash)] -#[derive(EnumString, Display, AsRefStr, IntoStaticStr)] -#[derive(serde::Serialize, crate::de::Deserialize)] -#[repr(u8)] -pub enum GameType { - /// Custom games - #[strum(to_string = "CUSTOM_GAME", serialize = "CUSTOM")] - #[serde(alias = "CUSTOM")] - CUSTOM_GAME, - /// all other games - #[strum(to_string = "MATCHED_GAME", serialize = "MATCHED")] - #[serde(alias = "MATCHED")] - MATCHED_GAME, - /// Tutorial games - #[strum(to_string = "TUTORIAL_GAME", serialize = "TUTORIAL")] - #[serde(alias = "TUTORIAL")] - TUTORIAL_GAME, -} + #[test] + fn check_as_ref() { + assert_eq!("MATCHED_GAME", GameType::MATCHED_GAME.as_ref()); + } -#[cfg(test)] -mod test; + #[test] + fn check_to_string() { + assert_eq!("MATCHED_GAME", GameType::MATCHED_GAME.to_string()); + } + + #[test] + fn check_from_string() { + assert_eq!(Ok(GameType::MATCHED_GAME), "MATCHED_GAME".parse()); + assert_eq!(Ok(GameType::MATCHED_GAME), "MATCHED".parse()); + } + + #[test] + fn check_serialize() { + assert_eq!( + Some("\"MATCHED_GAME\""), + serde_json::to_string(&GameType::MATCHED_GAME) + .ok() + .as_deref() + ); + } +} diff --git a/riven/src/consts/game_type/test.rs b/riven/src/consts/game_type/test.rs deleted file mode 100644 index 05516f15..00000000 --- a/riven/src/consts/game_type/test.rs +++ /dev/null @@ -1,24 +0,0 @@ -use super::*; - -#[test] -fn check_as_ref() { - assert_eq!("MATCHED_GAME", GameType::MATCHED_GAME.as_ref()); -} - -#[test] -fn check_to_string() { - assert_eq!("MATCHED_GAME", GameType::MATCHED_GAME.to_string()); -} - -#[test] -fn check_from_string() { - assert_eq!(Ok(GameType::MATCHED_GAME), "MATCHED_GAME".parse()); - assert_eq!(Ok(GameType::MATCHED_GAME), "MATCHED".parse()); -} - -#[test] -fn check_serialize() { - assert_eq!(Some("\"MATCHED_GAME\""), - serde_json::to_string(&GameType::MATCHED_GAME) - .ok().as_deref()); -} diff --git a/riven/src/consts/map.gen.rs b/riven/src/consts/map.gen.rs new file mode 100644 index 00000000..7a683f4d --- /dev/null +++ b/riven/src/consts/map.gen.rs @@ -0,0 +1,80 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +#[macro_rules_attribute::apply(newtype_enum)] +#[repr(u8)] +///A League of Legends map. +pub enum Map { + ///`1` + ///Summoner's Rift + ///Original Summer variant + #[deprecated(note = "Original Summer variant")] + SUMMONERS_RIFT_ORIGINAL_SUMMER_VARIANT = 1, + ///`2` + ///Summoner's Rift + ///Original Autumn variant + #[deprecated(note = "Original Autumn variant")] + SUMMONERS_RIFT_ORIGINAL_AUTUMN_VARIANT = 2, + ///`3` + ///The Proving Grounds + ///Tutorial Map + THE_PROVING_GROUNDS = 3, + ///`4` + ///Twisted Treeline + ///Original Version + #[deprecated(note = "Original Version")] + TWISTED_TREELINE_ORIGINAL_VERSION = 4, + ///`8` + ///The Crystal Scar + ///Dominion map + THE_CRYSTAL_SCAR = 8, + ///`10` + ///Twisted Treeline + ///Last TT map + TWISTED_TREELINE = 10, + ///`11` + ///Summoner's Rift + ///Current Version + SUMMONERS_RIFT = 11, + ///`12` + ///Howling Abyss + ///ARAM map + HOWLING_ABYSS = 12, + ///`14` + ///Butcher's Bridge + ///Alternate ARAM map + BUTCHERS_BRIDGE = 14, + ///`16` + ///Cosmic Ruins + ///Dark Star: Singularity map + COSMIC_RUINS = 16, + ///`18` + ///Valoran City Park + ///Star Guardian Invasion map + VALORAN_CITY_PARK = 18, + ///`19` + ///Substructure 43 + ///PROJECT: Hunters map + SUBSTRUCTURE_43 = 19, + ///`20` + ///Crash Site + ///Odyssey: Extraction map + CRASH_SITE = 20, + ///`21` + ///Nexus Blitz + ///Nexus Blitz map + NEXUS_BLITZ = 21, + ///`22` + ///Convergence + ///Teamfight Tactics map + CONVERGENCE = 22, + ///`30` + ///Arena + ///Map for 2v2v2v2 (`CHERRY`). Team up with a friend or venture solo in this new game mode. Face against multiple teams in chaotic battles across diverse arenas + ARENA = 30, + ///`33` + ///Swarm + ///Map for Swarm (`STRAWBERRY`). Team up with a friend or venture solo in this horde survival mode. + SWARM = 33, +} + diff --git a/riven/src/consts/map.rs b/riven/src/consts/map.rs deleted file mode 100644 index a8289d3b..00000000 --- a/riven/src/consts/map.rs +++ /dev/null @@ -1,82 +0,0 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -newtype_enum! { - /// A League of Legends map. - pub newtype_enum Map(u8) { - /// `1`. - /// Summoner's Rift - /// Original Summer variant - SUMMONERS_RIFT_ORIGINAL_SUMMER_VARIANT = 1, - /// `2`. - /// Summoner's Rift - /// Original Autumn variant - SUMMONERS_RIFT_ORIGINAL_AUTUMN_VARIANT = 2, - /// `3`. - /// The Proving Grounds - /// Tutorial Map - THE_PROVING_GROUNDS = 3, - /// `4`. - /// Twisted Treeline - /// Original Version - TWISTED_TREELINE_ORIGINAL_VERSION = 4, - /// `8`. - /// The Crystal Scar - /// Dominion map - THE_CRYSTAL_SCAR = 8, - /// `10`. - /// Twisted Treeline - /// Last TT map - TWISTED_TREELINE = 10, - /// `11`. - /// Summoner's Rift - /// Current Version - SUMMONERS_RIFT = 11, - /// `12`. - /// Howling Abyss - /// ARAM map - HOWLING_ABYSS = 12, - /// `14`. - /// Butcher's Bridge - /// Alternate ARAM map - BUTCHERS_BRIDGE = 14, - /// `16`. - /// Cosmic Ruins - /// Dark Star: Singularity map - COSMIC_RUINS = 16, - /// `18`. - /// Valoran City Park - /// Star Guardian Invasion map - VALORAN_CITY_PARK = 18, - /// `19`. - /// Substructure 43 - /// PROJECT: Hunters map - SUBSTRUCTURE_43 = 19, - /// `20`. - /// Crash Site - /// Odyssey: Extraction map - CRASH_SITE = 20, - /// `21`. - /// Nexus Blitz - /// Nexus Blitz map - NEXUS_BLITZ = 21, - /// `22`. - /// Convergence - /// Teamfight Tactics map - CONVERGENCE = 22, - /// `30`. - /// Arena - /// Map for 2v2v2v2 (`CHERRY`). Team up with a friend or venture solo in this new game mode. Face against multiple teams in chaotic battles across diverse arenas - ARENA = 30, - /// `33`. - /// Swarm - /// Map for Swarm (`STRAWBERRY`). Team up with a friend or venture solo in this horde survival mode. - SWARM = 33, - } -} diff --git a/riven/src/consts/mod.rs b/riven/src/consts/mod.rs index 2bc03d37..e653f3ef 100644 --- a/riven/src/consts/mod.rs +++ b/riven/src/consts/mod.rs @@ -6,50 +6,46 @@ #![allow(deprecated)] #![allow(non_camel_case_types)] -mod macros; +/// Trait allowing iteration of enum types, implemented by several enums in this module. +/// Re-exported from strum. +pub use strum::IntoEnumIterator; -#[rustfmt::skip] mod champion; pub use champion::*; mod division; pub use division::*; -#[rustfmt::skip] -mod game_mode; +mod game_mode { + include_autogen!("game_mode.gen.rs"); +} pub use game_mode::*; -#[rustfmt::skip] mod game_type; pub use game_type::*; -#[rustfmt::skip] -mod map; +mod map { + include_autogen!("map.gen.rs"); +} pub use map::*; -#[rustfmt::skip] mod queue_type; pub use queue_type::*; -#[rustfmt::skip] -mod queue; +mod queue { + include_autogen!("queue.gen.rs"); +} pub use queue::*; pub mod ranks; -#[rustfmt::skip] mod route; pub use route::*; -mod route_ext; -pub use route_ext::*; - -#[rustfmt::skip] -mod season; +mod season { + include_autogen!("season.gen.rs"); +} pub use season::*; -/// Trait allowing iteration of enum types, implemented by several enums in this module. -/// Re-exported from strum. -pub use strum::IntoEnumIterator; mod team; pub use team::*; diff --git a/riven/src/consts/queue.gen.rs b/riven/src/consts/queue.gen.rs new file mode 100644 index 00000000..0f9da2b0 --- /dev/null +++ b/riven/src/consts/queue.gen.rs @@ -0,0 +1,432 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +#[macro_rules_attribute::apply(newtype_enum)] +#[repr(u16)] +///A League of Legends matchmaking queue. +pub enum Queue { + ///`0` + ///Games on Custom games + CUSTOM = 0, + ///`2` + ///5v5 Blind Pick games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 430 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 430")] + SUMMONERS_RIFT_5V5_BLIND_PICK_DEPRECATED_2 = 2, + ///`4` + ///5v5 Ranked Solo games on Summoner's Rift + /// + ///Deprecated in favor of queueId 420 + #[deprecated(note = "Deprecated in favor of queueId 420")] + SUMMONERS_RIFT_5V5_RANKED_SOLO_DEPRECATED_4 = 4, + ///`6` + ///5v5 Ranked Premade games on Summoner's Rift + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + SUMMONERS_RIFT_5V5_RANKED_PREMADE = 6, + ///`7` + ///Co-op vs AI games on Summoner's Rift + /// + ///Deprecated in favor of queueId 32 and 33 + #[deprecated(note = "Deprecated in favor of queueId 32 and 33")] + SUMMONERS_RIFT_CO_OP_VS_AI = 7, + ///`8` + ///3v3 Normal games on Twisted Treeline + /// + ///Deprecated in patch 7.19 in favor of queueId 460 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 460")] + TWISTED_TREELINE_3V3_NORMAL = 8, + ///`9` + ///3v3 Ranked Flex games on Twisted Treeline + /// + ///Deprecated in patch 7.19 in favor of queueId 470 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 470")] + TWISTED_TREELINE_3V3_RANKED_FLEX_DEPRECATED_9 = 9, + ///`14` + ///5v5 Draft Pick games on Summoner's Rift + /// + ///Deprecated in favor of queueId 400 + #[deprecated(note = "Deprecated in favor of queueId 400")] + SUMMONERS_RIFT_5V5_DRAFT_PICK_DEPRECATED_14 = 14, + ///`16` + ///5v5 Dominion Blind Pick games on Crystal Scar + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + CRYSTAL_SCAR_5V5_DOMINION_BLIND_PICK = 16, + ///`17` + ///5v5 Dominion Draft Pick games on Crystal Scar + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + CRYSTAL_SCAR_5V5_DOMINION_DRAFT_PICK = 17, + ///`25` + ///Dominion Co-op vs AI games on Crystal Scar + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + CRYSTAL_SCAR_DOMINION_CO_OP_VS_AI = 25, + ///`31` + ///Co-op vs AI Intro Bot games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 830 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 830")] + SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_DEPRECATED_31 = 31, + ///`32` + ///Co-op vs AI Beginner Bot games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 840 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 840")] + SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_DEPRECATED_32 = 32, + ///`33` + ///Co-op vs AI Intermediate Bot games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 850 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 850")] + SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_DEPRECATED_33 = 33, + ///`41` + ///3v3 Ranked Team games on Twisted Treeline + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + TWISTED_TREELINE_3V3_RANKED_TEAM = 41, + ///`42` + ///5v5 Ranked Team games on Summoner's Rift + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + SUMMONERS_RIFT_5V5_RANKED_TEAM = 42, + ///`52` + ///Co-op vs AI games on Twisted Treeline + /// + ///Deprecated in patch 7.19 in favor of queueId 800 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 800")] + TWISTED_TREELINE_CO_OP_VS_AI = 52, + ///`61` + ///5v5 Team Builder games on Summoner's Rift + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + SUMMONERS_RIFT_5V5_TEAM_BUILDER = 61, + ///`65` + ///5v5 ARAM games on Howling Abyss + /// + ///Deprecated in patch 7.19 in favor of queueId 450 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 450")] + HOWLING_ABYSS_5V5_ARAM_DEPRECATED_65 = 65, + ///`67` + ///ARAM Co-op vs AI games on Howling Abyss + /// + ///Game mode deprecated + #[deprecated(note = "Game mode deprecated")] + HOWLING_ABYSS_ARAM_CO_OP_VS_AI = 67, + ///`70` + ///One for All games on Summoner's Rift + /// + ///Deprecated in patch 8.6 in favor of queueId 1020 + #[deprecated(note = "Deprecated in patch 8.6 in favor of queueId 1020")] + SUMMONERS_RIFT_ONE_FOR_ALL_DEPRECATED_70 = 70, + ///`72` + ///1v1 Snowdown Showdown games on Howling Abyss + HOWLING_ABYSS_1V1_SNOWDOWN_SHOWDOWN = 72, + ///`73` + ///2v2 Snowdown Showdown games on Howling Abyss + HOWLING_ABYSS_2V2_SNOWDOWN_SHOWDOWN = 73, + ///`75` + ///6v6 Hexakill games on Summoner's Rift + SUMMONERS_RIFT_6V6_HEXAKILL = 75, + ///`76` + ///Ultra Rapid Fire games on Summoner's Rift + SUMMONERS_RIFT_ULTRA_RAPID_FIRE = 76, + ///`78` + ///One For All: Mirror Mode games on Howling Abyss + HOWLING_ABYSS_ONE_FOR_ALL_MIRROR_MODE = 78, + ///`83` + ///Co-op vs AI Ultra Rapid Fire games on Summoner's Rift + SUMMONERS_RIFT_CO_OP_VS_AI_ULTRA_RAPID_FIRE = 83, + ///`91` + ///Doom Bots Rank 1 games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 950 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 950")] + SUMMONERS_RIFT_DOOM_BOTS_RANK_1 = 91, + ///`92` + ///Doom Bots Rank 2 games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 950 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 950")] + SUMMONERS_RIFT_DOOM_BOTS_RANK_2 = 92, + ///`93` + ///Doom Bots Rank 5 games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 950 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 950")] + SUMMONERS_RIFT_DOOM_BOTS_RANK_5 = 93, + ///`96` + ///Ascension games on Crystal Scar + /// + ///Deprecated in patch 7.19 in favor of queueId 910 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 910")] + CRYSTAL_SCAR_ASCENSION_DEPRECATED_96 = 96, + ///`98` + ///6v6 Hexakill games on Twisted Treeline + TWISTED_TREELINE_6V6_HEXAKILL = 98, + ///`100` + ///5v5 ARAM games on Butcher's Bridge + BUTCHERS_BRIDGE_5V5_ARAM = 100, + ///`300` + ///Legend of the Poro King games on Howling Abyss + /// + ///Deprecated in patch 7.19 in favor of queueId 920 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 920")] + HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING_DEPRECATED_300 = 300, + ///`310` + ///Nemesis games on Summoner's Rift + SUMMONERS_RIFT_NEMESIS = 310, + ///`313` + ///Black Market Brawlers games on Summoner's Rift + SUMMONERS_RIFT_BLACK_MARKET_BRAWLERS = 313, + ///`315` + ///Nexus Siege games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 940 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 940")] + SUMMONERS_RIFT_NEXUS_SIEGE_DEPRECATED_315 = 315, + ///`317` + ///Definitely Not Dominion games on Crystal Scar + CRYSTAL_SCAR_DEFINITELY_NOT_DOMINION = 317, + ///`318` + ///ARURF games on Summoner's Rift + /// + ///Deprecated in patch 7.19 in favor of queueId 900 + #[deprecated(note = "Deprecated in patch 7.19 in favor of queueId 900")] + SUMMONERS_RIFT_ARURF_DEPRECATED_318 = 318, + ///`325` + ///All Random games on Summoner's Rift + SUMMONERS_RIFT_ALL_RANDOM = 325, + ///`400` + ///5v5 Draft Pick games on Summoner's Rift + SUMMONERS_RIFT_5V5_DRAFT_PICK = 400, + ///`410` + ///5v5 Ranked Dynamic games on Summoner's Rift + /// + ///Game mode deprecated in patch 6.22 + #[deprecated(note = "Game mode deprecated in patch 6.22")] + SUMMONERS_RIFT_5V5_RANKED_DYNAMIC = 410, + ///`420` + ///5v5 Ranked Solo games on Summoner's Rift + SUMMONERS_RIFT_5V5_RANKED_SOLO = 420, + ///`430` + ///5v5 Blind Pick games on Summoner's Rift + SUMMONERS_RIFT_5V5_BLIND_PICK = 430, + ///`440` + ///5v5 Ranked Flex games on Summoner's Rift + SUMMONERS_RIFT_5V5_RANKED_FLEX = 440, + ///`450` + ///5v5 ARAM games on Howling Abyss + HOWLING_ABYSS_5V5_ARAM = 450, + ///`460` + ///3v3 Blind Pick games on Twisted Treeline + /// + ///Deprecated in patch 9.23 + #[deprecated(note = "Deprecated in patch 9.23")] + TWISTED_TREELINE_3V3_BLIND_PICK = 460, + ///`470` + ///3v3 Ranked Flex games on Twisted Treeline + /// + ///Deprecated in patch 9.23 + #[deprecated(note = "Deprecated in patch 9.23")] + TWISTED_TREELINE_3V3_RANKED_FLEX_DEPRECATED_470 = 470, + ///`480` + ///Normal (Swiftplay) games on Summoner's Rift + SUMMONERS_RIFT_NORMAL_SWIFTPLAY = 480, + ///`490` + ///Normal (Quickplay) games on Summoner's Rift + SUMMONERS_RIFT_NORMAL_QUICKPLAY = 490, + ///`600` + ///Blood Hunt Assassin games on Summoner's Rift + SUMMONERS_RIFT_BLOOD_HUNT_ASSASSIN = 600, + ///`610` + ///Dark Star: Singularity games on Cosmic Ruins + COSMIC_RUINS_DARK_STAR_SINGULARITY = 610, + ///`700` + ///Summoner's Rift Clash games on Summoner's Rift + SUMMONERS_RIFT_CLASH = 700, + ///`720` + ///ARAM Clash games on Howling Abyss + HOWLING_ABYSS_ARAM_CLASH = 720, + ///`800` + ///Co-op vs. AI Intermediate Bot games on Twisted Treeline + /// + ///Deprecated in patch 9.23 + #[deprecated(note = "Deprecated in patch 9.23")] + TWISTED_TREELINE_CO_OP_VS_AI_INTERMEDIATE_BOT = 800, + ///`810` + ///Co-op vs. AI Intro Bot games on Twisted Treeline + /// + ///Deprecated in patch 9.23 + #[deprecated(note = "Deprecated in patch 9.23")] + TWISTED_TREELINE_CO_OP_VS_AI_INTRO_BOT = 810, + ///`820` + ///Co-op vs. AI Beginner Bot games on Twisted Treeline + TWISTED_TREELINE_CO_OP_VS_AI_BEGINNER_BOT = 820, + ///`830` + ///Co-op vs. AI Intro Bot games on Summoner's Rift + /// + ///Deprecated in March 2024 in favor of queueId 870 + #[deprecated(note = "Deprecated in March 2024 in favor of queueId 870")] + SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_DEPRECATED_830 = 830, + ///`840` + ///Co-op vs. AI Beginner Bot games on Summoner's Rift + /// + ///Deprecated in March 2024 in favor of queueId 880 + #[deprecated(note = "Deprecated in March 2024 in favor of queueId 880")] + SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_DEPRECATED_840 = 840, + ///`850` + ///Co-op vs. AI Intermediate Bot games on Summoner's Rift + /// + ///Deprecated in March 2024 in favor of queueId 890 + #[deprecated(note = "Deprecated in March 2024 in favor of queueId 890")] + SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_DEPRECATED_850 = 850, + ///`870` + ///Co-op vs. AI Intro Bot games on Summoner's Rift + SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT = 870, + ///`880` + ///Co-op vs. AI Beginner Bot games on Summoner's Rift + SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT = 880, + ///`890` + ///Co-op vs. AI Intermediate Bot games on Summoner's Rift + SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT = 890, + ///`900` + ///ARURF games on Summoner's Rift + SUMMONERS_RIFT_ARURF = 900, + ///`910` + ///Ascension games on Crystal Scar + CRYSTAL_SCAR_ASCENSION = 910, + ///`920` + ///Legend of the Poro King games on Howling Abyss + HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING = 920, + ///`940` + ///Nexus Siege games on Summoner's Rift + SUMMONERS_RIFT_NEXUS_SIEGE = 940, + ///`950` + ///Doom Bots Voting games on Summoner's Rift + SUMMONERS_RIFT_DOOM_BOTS_VOTING = 950, + ///`960` + ///Doom Bots Standard games on Summoner's Rift + SUMMONERS_RIFT_DOOM_BOTS_STANDARD = 960, + ///`980` + ///Star Guardian Invasion: Normal games on Valoran City Park + VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_NORMAL = 980, + ///`990` + ///Star Guardian Invasion: Onslaught games on Valoran City Park + VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_ONSLAUGHT = 990, + ///`1000` + ///PROJECT: Hunters games on Overcharge + OVERCHARGE_PROJECT_HUNTERS = 1000, + ///`1010` + ///Snow ARURF games on Summoner's Rift + SUMMONERS_RIFT_SNOW_ARURF = 1010, + ///`1020` + ///One for All games on Summoner's Rift + SUMMONERS_RIFT_ONE_FOR_ALL = 1020, + ///`1030` + ///Odyssey Extraction: Intro games on Crash Site + CRASH_SITE_ODYSSEY_EXTRACTION_INTRO = 1030, + ///`1040` + ///Odyssey Extraction: Cadet games on Crash Site + CRASH_SITE_ODYSSEY_EXTRACTION_CADET = 1040, + ///`1050` + ///Odyssey Extraction: Crewmember games on Crash Site + CRASH_SITE_ODYSSEY_EXTRACTION_CREWMEMBER = 1050, + ///`1060` + ///Odyssey Extraction: Captain games on Crash Site + CRASH_SITE_ODYSSEY_EXTRACTION_CAPTAIN = 1060, + ///`1070` + ///Odyssey Extraction: Onslaught games on Crash Site + CRASH_SITE_ODYSSEY_EXTRACTION_ONSLAUGHT = 1070, + ///`1090` + ///Teamfight Tactics games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS = 1090, + ///`1091` + ///Teamfight Tactics 1v0 games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_1V0 = 1091, + ///`1092` + ///Teamfight Tactics 2v0 games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_2V0 = 1092, + ///`1100` + ///Ranked Teamfight Tactics games on Convergence + CONVERGENCE_RANKED_TEAMFIGHT_TACTICS = 1100, + ///`1110` + ///Teamfight Tactics Tutorial games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_TUTORIAL = 1110, + ///`1111` + ///Teamfight Tactics Simluation games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_SIMLUATION = 1111, + ///`1130` + ///Ranked Teamfight Tactics (Hyper Roll) games on Convergence + CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_HYPER_ROLL = 1130, + ///`1150` + ///Ranked Teamfight Tactics (Double Up Workshop) games on Convergence + /// + ///Deprecated in patch 12.11 in favor of queueId 1160 + #[deprecated(note = "Deprecated in patch 12.11 in favor of queueId 1160")] + CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_WORKSHOP_DEPRECATED_1150 = 1150, + ///`1160` + ///Ranked Teamfight Tactics (Double Up Workshop) games on Convergence + CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_WORKSHOP = 1160, + ///`1200` + ///Nexus Blitz games on Nexus Blitz + /// + ///Deprecated in patch 9.2 in favor of queueId 1300 + #[deprecated(note = "Deprecated in patch 9.2 in favor of queueId 1300")] + NEXUS_BLITZ_DEPRECATED_1200 = 1200, + ///`1210` + ///Teamfight Tactics (Choncc's Treasure) games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_CHONCCS_TREASURE = 1210, + ///`1300` + ///Nexus Blitz games on Nexus Blitz + NEXUS_BLITZ = 1300, + ///`1400` + ///Ultimate Spellbook games on Summoner's Rift + SUMMONERS_RIFT_ULTIMATE_SPELLBOOK = 1400, + ///`1700` + ///2v2v2v2 `CHERRY` games on Arena + ARENA_2V2V2V2_CHERRY = 1700, + ///`1710` + ///Arena (`CHERRY` games) games on Rings of Wrath + RINGS_OF_WRATH_ARENA_CHERRY_GAMES = 1710, + ///`1810` + ///Swarm solo (`STRAWBERRY` games) games on Swarm + SWARM_SOLO_STRAWBERRY_GAMES = 1810, + ///`1820` + ///Swarm duo (`STRAWBERRY` games) games on Swarm + SWARM_DUO_STRAWBERRY_GAMES = 1820, + ///`1830` + ///Swarm trio (`STRAWBERRY` games) games on Swarm + SWARM_TRIO_STRAWBERRY_GAMES = 1830, + ///`1840` + ///Swarm quad (`STRAWBERRY` games) games on Swarm + SWARM_QUAD_STRAWBERRY_GAMES = 1840, + ///`1900` + ///Pick URF games on Summoner's Rift + SUMMONERS_RIFT_PICK_URF = 1900, + ///`2000` + ///Tutorial 1 games on Summoner's Rift + SUMMONERS_RIFT_TUTORIAL_1 = 2000, + ///`2010` + ///Tutorial 2 games on Summoner's Rift + SUMMONERS_RIFT_TUTORIAL_2 = 2010, + ///`2020` + ///Tutorial 3 games on Summoner's Rift + SUMMONERS_RIFT_TUTORIAL_3 = 2020, + ///`6000` + ///Teamfight Tactics Set 3.5 Revival games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_SET_3_5_REVIVAL = 6000, + ///`6100` + ///Teamfight Tactics Revival: Festival of Beasts games on Convergence + CONVERGENCE_TEAMFIGHT_TACTICS_REVIVAL_FESTIVAL_OF_BEASTS = 6100, +} + diff --git a/riven/src/consts/queue.rs b/riven/src/consts/queue.rs deleted file mode 100644 index db9df0a5..00000000 --- a/riven/src/consts/queue.rs +++ /dev/null @@ -1,437 +0,0 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -newtype_enum! { - /// A League of Legends matchmaking queue. - pub newtype_enum Queue(u16) { - /// `0`. - /// Games on Custom games - CUSTOM = 0, - /// `2`. - /// 5v5 Blind Pick games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 430 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 430")] - SUMMONERS_RIFT_5V5_BLIND_PICK_DEPRECATED_2 = 2, - /// `4`. - /// 5v5 Ranked Solo games on Summoner's Rift - /// - /// Deprecated in favor of queueId 420 - #[deprecated(note="Deprecated in favor of queueId 420")] - SUMMONERS_RIFT_5V5_RANKED_SOLO_DEPRECATED_4 = 4, - /// `6`. - /// 5v5 Ranked Premade games on Summoner's Rift - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - SUMMONERS_RIFT_5V5_RANKED_PREMADE = 6, - /// `7`. - /// Co-op vs AI games on Summoner's Rift - /// - /// Deprecated in favor of queueId 32 and 33 - #[deprecated(note="Deprecated in favor of queueId 32 and 33")] - SUMMONERS_RIFT_CO_OP_VS_AI = 7, - /// `8`. - /// 3v3 Normal games on Twisted Treeline - /// - /// Deprecated in patch 7.19 in favor of queueId 460 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 460")] - TWISTED_TREELINE_3V3_NORMAL = 8, - /// `9`. - /// 3v3 Ranked Flex games on Twisted Treeline - /// - /// Deprecated in patch 7.19 in favor of queueId 470 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 470")] - TWISTED_TREELINE_3V3_RANKED_FLEX_DEPRECATED_9 = 9, - /// `14`. - /// 5v5 Draft Pick games on Summoner's Rift - /// - /// Deprecated in favor of queueId 400 - #[deprecated(note="Deprecated in favor of queueId 400")] - SUMMONERS_RIFT_5V5_DRAFT_PICK_DEPRECATED_14 = 14, - /// `16`. - /// 5v5 Dominion Blind Pick games on Crystal Scar - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - CRYSTAL_SCAR_5V5_DOMINION_BLIND_PICK = 16, - /// `17`. - /// 5v5 Dominion Draft Pick games on Crystal Scar - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - CRYSTAL_SCAR_5V5_DOMINION_DRAFT_PICK = 17, - /// `25`. - /// Dominion Co-op vs AI games on Crystal Scar - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - CRYSTAL_SCAR_DOMINION_CO_OP_VS_AI = 25, - /// `31`. - /// Co-op vs AI Intro Bot games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 830 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 830")] - SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_DEPRECATED_31 = 31, - /// `32`. - /// Co-op vs AI Beginner Bot games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 840 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 840")] - SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_DEPRECATED_32 = 32, - /// `33`. - /// Co-op vs AI Intermediate Bot games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 850 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 850")] - SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_DEPRECATED_33 = 33, - /// `41`. - /// 3v3 Ranked Team games on Twisted Treeline - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - TWISTED_TREELINE_3V3_RANKED_TEAM = 41, - /// `42`. - /// 5v5 Ranked Team games on Summoner's Rift - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - SUMMONERS_RIFT_5V5_RANKED_TEAM = 42, - /// `52`. - /// Co-op vs AI games on Twisted Treeline - /// - /// Deprecated in patch 7.19 in favor of queueId 800 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 800")] - TWISTED_TREELINE_CO_OP_VS_AI = 52, - /// `61`. - /// 5v5 Team Builder games on Summoner's Rift - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - SUMMONERS_RIFT_5V5_TEAM_BUILDER = 61, - /// `65`. - /// 5v5 ARAM games on Howling Abyss - /// - /// Deprecated in patch 7.19 in favor of queueId 450 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 450")] - HOWLING_ABYSS_5V5_ARAM_DEPRECATED_65 = 65, - /// `67`. - /// ARAM Co-op vs AI games on Howling Abyss - /// - /// Game mode deprecated - #[deprecated(note="Game mode deprecated")] - HOWLING_ABYSS_ARAM_CO_OP_VS_AI = 67, - /// `70`. - /// One for All games on Summoner's Rift - /// - /// Deprecated in patch 8.6 in favor of queueId 1020 - #[deprecated(note="Deprecated in patch 8.6 in favor of queueId 1020")] - SUMMONERS_RIFT_ONE_FOR_ALL_DEPRECATED_70 = 70, - /// `72`. - /// 1v1 Snowdown Showdown games on Howling Abyss - HOWLING_ABYSS_1V1_SNOWDOWN_SHOWDOWN = 72, - /// `73`. - /// 2v2 Snowdown Showdown games on Howling Abyss - HOWLING_ABYSS_2V2_SNOWDOWN_SHOWDOWN = 73, - /// `75`. - /// 6v6 Hexakill games on Summoner's Rift - SUMMONERS_RIFT_6V6_HEXAKILL = 75, - /// `76`. - /// Ultra Rapid Fire games on Summoner's Rift - SUMMONERS_RIFT_ULTRA_RAPID_FIRE = 76, - /// `78`. - /// One For All: Mirror Mode games on Howling Abyss - HOWLING_ABYSS_ONE_FOR_ALL_MIRROR_MODE = 78, - /// `83`. - /// Co-op vs AI Ultra Rapid Fire games on Summoner's Rift - SUMMONERS_RIFT_CO_OP_VS_AI_ULTRA_RAPID_FIRE = 83, - /// `91`. - /// Doom Bots Rank 1 games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 950 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] - SUMMONERS_RIFT_DOOM_BOTS_RANK_1 = 91, - /// `92`. - /// Doom Bots Rank 2 games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 950 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] - SUMMONERS_RIFT_DOOM_BOTS_RANK_2 = 92, - /// `93`. - /// Doom Bots Rank 5 games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 950 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 950")] - SUMMONERS_RIFT_DOOM_BOTS_RANK_5 = 93, - /// `96`. - /// Ascension games on Crystal Scar - /// - /// Deprecated in patch 7.19 in favor of queueId 910 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 910")] - CRYSTAL_SCAR_ASCENSION_DEPRECATED_96 = 96, - /// `98`. - /// 6v6 Hexakill games on Twisted Treeline - TWISTED_TREELINE_6V6_HEXAKILL = 98, - /// `100`. - /// 5v5 ARAM games on Butcher's Bridge - BUTCHERS_BRIDGE_5V5_ARAM = 100, - /// `300`. - /// Legend of the Poro King games on Howling Abyss - /// - /// Deprecated in patch 7.19 in favor of queueId 920 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 920")] - HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING_DEPRECATED_300 = 300, - /// `310`. - /// Nemesis games on Summoner's Rift - SUMMONERS_RIFT_NEMESIS = 310, - /// `313`. - /// Black Market Brawlers games on Summoner's Rift - SUMMONERS_RIFT_BLACK_MARKET_BRAWLERS = 313, - /// `315`. - /// Nexus Siege games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 940 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 940")] - SUMMONERS_RIFT_NEXUS_SIEGE_DEPRECATED_315 = 315, - /// `317`. - /// Definitely Not Dominion games on Crystal Scar - CRYSTAL_SCAR_DEFINITELY_NOT_DOMINION = 317, - /// `318`. - /// ARURF games on Summoner's Rift - /// - /// Deprecated in patch 7.19 in favor of queueId 900 - #[deprecated(note="Deprecated in patch 7.19 in favor of queueId 900")] - SUMMONERS_RIFT_ARURF_DEPRECATED_318 = 318, - /// `325`. - /// All Random games on Summoner's Rift - SUMMONERS_RIFT_ALL_RANDOM = 325, - /// `400`. - /// 5v5 Draft Pick games on Summoner's Rift - SUMMONERS_RIFT_5V5_DRAFT_PICK = 400, - /// `410`. - /// 5v5 Ranked Dynamic games on Summoner's Rift - /// - /// Game mode deprecated in patch 6.22 - #[deprecated(note="Game mode deprecated in patch 6.22")] - SUMMONERS_RIFT_5V5_RANKED_DYNAMIC = 410, - /// `420`. - /// 5v5 Ranked Solo games on Summoner's Rift - SUMMONERS_RIFT_5V5_RANKED_SOLO = 420, - /// `430`. - /// 5v5 Blind Pick games on Summoner's Rift - SUMMONERS_RIFT_5V5_BLIND_PICK = 430, - /// `440`. - /// 5v5 Ranked Flex games on Summoner's Rift - SUMMONERS_RIFT_5V5_RANKED_FLEX = 440, - /// `450`. - /// 5v5 ARAM games on Howling Abyss - HOWLING_ABYSS_5V5_ARAM = 450, - /// `460`. - /// 3v3 Blind Pick games on Twisted Treeline - /// - /// Deprecated in patch 9.23 - #[deprecated(note="Deprecated in patch 9.23")] - TWISTED_TREELINE_3V3_BLIND_PICK = 460, - /// `470`. - /// 3v3 Ranked Flex games on Twisted Treeline - /// - /// Deprecated in patch 9.23 - #[deprecated(note="Deprecated in patch 9.23")] - TWISTED_TREELINE_3V3_RANKED_FLEX_DEPRECATED_470 = 470, - /// `480`. - /// Normal (Swiftplay) games on Summoner's Rift - SUMMONERS_RIFT_NORMAL_SWIFTPLAY = 480, - /// `490`. - /// Normal (Quickplay) games on Summoner's Rift - SUMMONERS_RIFT_NORMAL_QUICKPLAY = 490, - /// `600`. - /// Blood Hunt Assassin games on Summoner's Rift - SUMMONERS_RIFT_BLOOD_HUNT_ASSASSIN = 600, - /// `610`. - /// Dark Star: Singularity games on Cosmic Ruins - COSMIC_RUINS_DARK_STAR_SINGULARITY = 610, - /// `700`. - /// Summoner's Rift Clash games on Summoner's Rift - SUMMONERS_RIFT_CLASH = 700, - /// `720`. - /// ARAM Clash games on Howling Abyss - HOWLING_ABYSS_ARAM_CLASH = 720, - /// `800`. - /// Co-op vs. AI Intermediate Bot games on Twisted Treeline - /// - /// Deprecated in patch 9.23 - #[deprecated(note="Deprecated in patch 9.23")] - TWISTED_TREELINE_CO_OP_VS_AI_INTERMEDIATE_BOT = 800, - /// `810`. - /// Co-op vs. AI Intro Bot games on Twisted Treeline - /// - /// Deprecated in patch 9.23 - #[deprecated(note="Deprecated in patch 9.23")] - TWISTED_TREELINE_CO_OP_VS_AI_INTRO_BOT = 810, - /// `820`. - /// Co-op vs. AI Beginner Bot games on Twisted Treeline - TWISTED_TREELINE_CO_OP_VS_AI_BEGINNER_BOT = 820, - /// `830`. - /// Co-op vs. AI Intro Bot games on Summoner's Rift - /// - /// Deprecated in March 2024 in favor of queueId 870 - #[deprecated(note="Deprecated in March 2024 in favor of queueId 870")] - SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT_DEPRECATED_830 = 830, - /// `840`. - /// Co-op vs. AI Beginner Bot games on Summoner's Rift - /// - /// Deprecated in March 2024 in favor of queueId 880 - #[deprecated(note="Deprecated in March 2024 in favor of queueId 880")] - SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT_DEPRECATED_840 = 840, - /// `850`. - /// Co-op vs. AI Intermediate Bot games on Summoner's Rift - /// - /// Deprecated in March 2024 in favor of queueId 890 - #[deprecated(note="Deprecated in March 2024 in favor of queueId 890")] - SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT_DEPRECATED_850 = 850, - /// `870`. - /// Co-op vs. AI Intro Bot games on Summoner's Rift - SUMMONERS_RIFT_CO_OP_VS_AI_INTRO_BOT = 870, - /// `880`. - /// Co-op vs. AI Beginner Bot games on Summoner's Rift - SUMMONERS_RIFT_CO_OP_VS_AI_BEGINNER_BOT = 880, - /// `890`. - /// Co-op vs. AI Intermediate Bot games on Summoner's Rift - SUMMONERS_RIFT_CO_OP_VS_AI_INTERMEDIATE_BOT = 890, - /// `900`. - /// ARURF games on Summoner's Rift - SUMMONERS_RIFT_ARURF = 900, - /// `910`. - /// Ascension games on Crystal Scar - CRYSTAL_SCAR_ASCENSION = 910, - /// `920`. - /// Legend of the Poro King games on Howling Abyss - HOWLING_ABYSS_LEGEND_OF_THE_PORO_KING = 920, - /// `940`. - /// Nexus Siege games on Summoner's Rift - SUMMONERS_RIFT_NEXUS_SIEGE = 940, - /// `950`. - /// Doom Bots Voting games on Summoner's Rift - SUMMONERS_RIFT_DOOM_BOTS_VOTING = 950, - /// `960`. - /// Doom Bots Standard games on Summoner's Rift - SUMMONERS_RIFT_DOOM_BOTS_STANDARD = 960, - /// `980`. - /// Star Guardian Invasion: Normal games on Valoran City Park - VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_NORMAL = 980, - /// `990`. - /// Star Guardian Invasion: Onslaught games on Valoran City Park - VALORAN_CITY_PARK_STAR_GUARDIAN_INVASION_ONSLAUGHT = 990, - /// `1000`. - /// PROJECT: Hunters games on Overcharge - OVERCHARGE_PROJECT_HUNTERS = 1000, - /// `1010`. - /// Snow ARURF games on Summoner's Rift - SUMMONERS_RIFT_SNOW_ARURF = 1010, - /// `1020`. - /// One for All games on Summoner's Rift - SUMMONERS_RIFT_ONE_FOR_ALL = 1020, - /// `1030`. - /// Odyssey Extraction: Intro games on Crash Site - CRASH_SITE_ODYSSEY_EXTRACTION_INTRO = 1030, - /// `1040`. - /// Odyssey Extraction: Cadet games on Crash Site - CRASH_SITE_ODYSSEY_EXTRACTION_CADET = 1040, - /// `1050`. - /// Odyssey Extraction: Crewmember games on Crash Site - CRASH_SITE_ODYSSEY_EXTRACTION_CREWMEMBER = 1050, - /// `1060`. - /// Odyssey Extraction: Captain games on Crash Site - CRASH_SITE_ODYSSEY_EXTRACTION_CAPTAIN = 1060, - /// `1070`. - /// Odyssey Extraction: Onslaught games on Crash Site - CRASH_SITE_ODYSSEY_EXTRACTION_ONSLAUGHT = 1070, - /// `1090`. - /// Teamfight Tactics games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS = 1090, - /// `1091`. - /// Teamfight Tactics 1v0 games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_1V0 = 1091, - /// `1092`. - /// Teamfight Tactics 2v0 games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_2V0 = 1092, - /// `1100`. - /// Ranked Teamfight Tactics games on Convergence - CONVERGENCE_RANKED_TEAMFIGHT_TACTICS = 1100, - /// `1110`. - /// Teamfight Tactics Tutorial games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_TUTORIAL = 1110, - /// `1111`. - /// Teamfight Tactics Simluation games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_SIMLUATION = 1111, - /// `1130`. - /// Ranked Teamfight Tactics (Hyper Roll) games on Convergence - CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_HYPER_ROLL = 1130, - /// `1150`. - /// Ranked Teamfight Tactics (Double Up Workshop) games on Convergence - /// - /// Deprecated in patch 12.11 in favor of queueId 1160 - #[deprecated(note="Deprecated in patch 12.11 in favor of queueId 1160")] - CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_WORKSHOP_DEPRECATED_1150 = 1150, - /// `1160`. - /// Ranked Teamfight Tactics (Double Up Workshop) games on Convergence - CONVERGENCE_RANKED_TEAMFIGHT_TACTICS_DOUBLE_UP_WORKSHOP = 1160, - /// `1200`. - /// Nexus Blitz games on Nexus Blitz - /// - /// Deprecated in patch 9.2 in favor of queueId 1300 - #[deprecated(note="Deprecated in patch 9.2 in favor of queueId 1300")] - NEXUS_BLITZ_DEPRECATED_1200 = 1200, - /// `1210`. - /// Teamfight Tactics (Choncc's Treasure) games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_CHONCCS_TREASURE = 1210, - /// `1300`. - /// Nexus Blitz games on Nexus Blitz - NEXUS_BLITZ = 1300, - /// `1400`. - /// Ultimate Spellbook games on Summoner's Rift - SUMMONERS_RIFT_ULTIMATE_SPELLBOOK = 1400, - /// `1700`. - /// 2v2v2v2 `CHERRY` games on Arena - ARENA_2V2V2V2_CHERRY = 1700, - /// `1710`. - /// Arena (`CHERRY` games) games on Rings of Wrath - RINGS_OF_WRATH_ARENA_CHERRY_GAMES = 1710, - /// `1810`. - /// Swarm solo (`STRAWBERRY` games) games on Swarm - SWARM_SOLO_STRAWBERRY_GAMES = 1810, - /// `1820`. - /// Swarm duo (`STRAWBERRY` games) games on Swarm - SWARM_DUO_STRAWBERRY_GAMES = 1820, - /// `1830`. - /// Swarm trio (`STRAWBERRY` games) games on Swarm - SWARM_TRIO_STRAWBERRY_GAMES = 1830, - /// `1840`. - /// Swarm quad (`STRAWBERRY` games) games on Swarm - SWARM_QUAD_STRAWBERRY_GAMES = 1840, - /// `1900`. - /// Pick URF games on Summoner's Rift - SUMMONERS_RIFT_PICK_URF = 1900, - /// `2000`. - /// Tutorial 1 games on Summoner's Rift - SUMMONERS_RIFT_TUTORIAL_1 = 2000, - /// `2010`. - /// Tutorial 2 games on Summoner's Rift - SUMMONERS_RIFT_TUTORIAL_2 = 2010, - /// `2020`. - /// Tutorial 3 games on Summoner's Rift - SUMMONERS_RIFT_TUTORIAL_3 = 2020, - /// `6000`. - /// Teamfight Tactics Set 3.5 Revival games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_SET_3_5_REVIVAL = 6000, - /// `6100`. - /// Teamfight Tactics Revival: Festival of Beasts games on Convergence - CONVERGENCE_TEAMFIGHT_TACTICS_REVIVAL_FESTIVAL_OF_BEASTS = 6100, - } -} diff --git a/riven/src/consts/queue_type.gen.rs b/riven/src/consts/queue_type.gen.rs new file mode 100644 index 00000000..865554a5 --- /dev/null +++ b/riven/src/consts/queue_type.gen.rs @@ -0,0 +1,39 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +use strum_macros::{EnumString, EnumVariantNames, IntoStaticStr}; +///LoL or TFT queue types. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +#[derive(EnumString, EnumVariantNames, IntoStaticStr)] +#[repr(u8)] +pub enum QueueType { + /// Catch-all variant for new/unknown values. + #[strum(default)] + UNKNOWN(String), + ///5v5 Ranked Solo games + RANKED_SOLO_5x5, + ///5v5 Ranked Flex games + RANKED_FLEX_SR, + ///3v3 Ranked Flex games + /// + ///Deprecated in patch 9.23 + #[deprecated(note = "Deprecated in patch 9.23")] + RANKED_FLEX_TT, + ///Ranked Teamfight Tactics games + RANKED_TFT, + ///Ranked Teamfight Tactics (Hyper Roll) games + RANKED_TFT_TURBO, + ///Ranked Teamfight Tactics (Double Up Workshop) games + /// + ///Deprecated in patch 12.11 in favor of queueId 1160 (`RANKED_TFT_DOUBLE_UP`) + #[deprecated( + note = "Deprecated in patch 12.11 in favor of queueId 1160 (`RANKED_TFT_DOUBLE_UP`)" + )] + RANKED_TFT_PAIRS, + ///Ranked Teamfight Tactics (Double Up Workshop) games + RANKED_TFT_DOUBLE_UP, + ///"Arena" games + CHERRY, +} +serde_strum_unknown!(QueueType); + diff --git a/riven/src/consts/queue_type.rs b/riven/src/consts/queue_type.rs index bcff970f..0dafbc11 100644 --- a/riven/src/consts/queue_type.rs +++ b/riven/src/consts/queue_type.rs @@ -1,48 +1,72 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -use strum_macros::{ EnumString, EnumVariantNames, IntoStaticStr }; - -/// LoL or TFT ranked queue types. -#[non_exhaustive] -#[derive(Debug, Clone)] -#[derive(Eq, PartialEq, Hash)] -#[derive(EnumString, EnumVariantNames, IntoStaticStr)] -#[repr(u8)] -pub enum QueueType { - /// Catch-all variant for new, unknown queue types. - #[strum(default)] - UNKNOWN(String), - - /// 5v5 Ranked Solo games - RANKED_SOLO_5x5, - /// 5v5 Ranked Flex games - RANKED_FLEX_SR, - /// 3v3 Ranked Flex games - /// Deprecated in patch 9.23 - #[deprecated(note="Deprecated in patch 9.23")] - RANKED_FLEX_TT, - /// Ranked Teamfight Tactics games - RANKED_TFT, - /// Ranked Teamfight Tactics (Hyper Roll) games - RANKED_TFT_TURBO, - /// Ranked Teamfight Tactics (Double Up Workshop) games - /// Deprecated in patch 12.11 in favor of queueId 1160 (`RANKED_TFT_DOUBLE_UP`) - #[deprecated(note="Deprecated in patch 12.11 in favor of queueId 1160 (`RANKED_TFT_DOUBLE_UP`)")] - RANKED_TFT_PAIRS, - /// Ranked Teamfight Tactics (Double Up Workshop) games - RANKED_TFT_DOUBLE_UP, - /// "Arena" games - CHERRY, -} - -serde_strum_unknown!(QueueType); +include_autogen!("queue_type.gen.rs"); #[cfg(test)] -mod test; +mod test { + use super::*; + + #[test] + fn check_as_ref() { + assert_eq!("RANKED_SOLO_5x5", QueueType::RANKED_SOLO_5x5.as_ref()); + } + + #[test] + fn check_to_string() { + assert_eq!("RANKED_SOLO_5x5", QueueType::RANKED_SOLO_5x5.to_string()); + } + + #[test] + fn check_from_string() { + assert_eq!(QueueType::RANKED_SOLO_5x5, "RANKED_SOLO_5x5".into()); + assert_eq!( + QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned()), + "RANKED_MYSTERY_UNKNOWN".into() + ); + assert_eq!( + "RANKED_MYSTERY_UNKNOWN", + QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned()).as_ref() + ); + } + + #[test] + fn check_serialize() { + assert_eq!( + Some("\"RANKED_TFT_DOUBLE_UP\""), + serde_json::to_string(&QueueType::RANKED_TFT_DOUBLE_UP) + .ok() + .as_deref() + ); + assert_eq!( + Some("\"RANKED_MYSTERY_UNKNOWN\""), + serde_json::to_string(&QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned())) + .ok() + .as_deref() + ); + } + + #[test] + // Note: this test is often not run due to this condition below. + #[cfg(not(feature = "deny-unknown-enum-variants-strings"))] + fn check_deserialize() { + use std::collections::BTreeMap; + + let dict: BTreeMap = serde_json::from_str( + r#"{ + "100": "RANKED_SOLO_5x5", + "200": "RANKED_TFT_TURBO", + "210": "RANKED_TFT_DOUBLE_UP", + "211": "RANKED_TFT_PAIRS", + "900": "RANKED_MYSTERY_UNKNOWN" + }"#, + ) + .unwrap(); + + assert_eq!(Some(&QueueType::RANKED_SOLO_5x5), dict.get(&100)); + assert_eq!(Some(&QueueType::RANKED_TFT_TURBO), dict.get(&200)); + assert_eq!(Some(&QueueType::RANKED_TFT_DOUBLE_UP), dict.get(&210)); + assert_eq!(Some(&QueueType::RANKED_TFT_PAIRS), dict.get(&211)); + assert_eq!( + Some(&QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned())), + dict.get(&900) + ); + } +} diff --git a/riven/src/consts/queue_type/test.rs b/riven/src/consts/queue_type/test.rs deleted file mode 100644 index d4dcbe35..00000000 --- a/riven/src/consts/queue_type/test.rs +++ /dev/null @@ -1,52 +0,0 @@ -use super::*; - -#[test] -fn check_as_ref() { - assert_eq!("RANKED_SOLO_5x5", QueueType::RANKED_SOLO_5x5.as_ref()); -} - -#[test] -fn check_to_string() { - assert_eq!("RANKED_SOLO_5x5", QueueType::RANKED_SOLO_5x5.to_string()); -} - -#[test] -fn check_from_string() { - assert_eq!(QueueType::RANKED_SOLO_5x5, "RANKED_SOLO_5x5".into()); - assert_eq!(QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned()), "RANKED_MYSTERY_UNKNOWN".into()); - assert_eq!("RANKED_MYSTERY_UNKNOWN", QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned()).as_ref()); -} - -#[test] -fn check_serialize() { - assert_eq!(Some("\"RANKED_TFT_DOUBLE_UP\""), - serde_json::to_string(&QueueType::RANKED_TFT_DOUBLE_UP) - .ok().as_deref()); - assert_eq!(Some("\"RANKED_MYSTERY_UNKNOWN\""), - serde_json::to_string(&QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned())) - .ok().as_deref()); -} - -#[test] -// Note: this test is often not run due to this condition below. -#[cfg(not(feature = "deny-unknown-enum-variants-strings"))] -fn check_deserialize() { - use std::collections::BTreeMap; - - let dict: BTreeMap = serde_json::from_str( - r#"{ - "100": "RANKED_SOLO_5x5", - "200": "RANKED_TFT_TURBO", - "210": "RANKED_TFT_DOUBLE_UP", - "211": "RANKED_TFT_PAIRS", - "900": "RANKED_MYSTERY_UNKNOWN" - }"# - ).unwrap(); - - assert_eq!(Some(&QueueType::RANKED_SOLO_5x5), dict.get(&100)); - assert_eq!(Some(&QueueType::RANKED_TFT_TURBO), dict.get(&200)); - assert_eq!(Some(&QueueType::RANKED_TFT_DOUBLE_UP), dict.get(&210)); - assert_eq!(Some(&QueueType::RANKED_TFT_PAIRS), dict.get(&211)); - assert_eq!(Some(&QueueType::UNKNOWN("RANKED_MYSTERY_UNKNOWN".to_owned())), dict.get(&900)); - -} diff --git a/riven/src/consts/route.gen.rs b/riven/src/consts/route.gen.rs new file mode 100644 index 00000000..12137ca1 --- /dev/null +++ b/riven/src/consts/route.gen.rs @@ -0,0 +1,352 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +use num_enum::{IntoPrimitive, TryFromPrimitive}; +use strum_macros::{Display, EnumIter, EnumString, IntoStaticStr}; +///Regional routes, used in tournament services, Legends of Runeterra (LoR), and some other endpoints. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive(IntoPrimitive, TryFromPrimitive)] +#[derive(EnumString, EnumIter, Display, IntoStaticStr)] +#[repr(u8)] +#[non_exhaustive] +pub enum RegionalRoute { + ///North and South America. + /// + ///`1` (riotapi-schema ID/repr) + #[strum(to_string = "AMERICAS")] + AMERICAS = 1, + ///Asia, used for LoL matches (`match-v5`) and TFT matches (`tft-match-v1`). + /// + ///`2` (riotapi-schema ID/repr) + #[strum(to_string = "ASIA")] + ASIA = 2, + ///Europe. + /// + ///`3` (riotapi-schema ID/repr) + #[strum(to_string = "EUROPE")] + EUROPE = 3, + ///South East Asia, used for LoR, LoL matches (`match-v5`), and TFT matches (`tft-match-v1`). + /// + ///`4` (riotapi-schema ID/repr) + #[strum(to_string = "SEA")] + SEA = 4, + ///Asia-Pacific, deprecated, for some old matches in `lor-match-v1`. + /// + ///`10` (riotapi-schema ID/repr) + #[deprecated] + #[strum(to_string = "APAC")] + APAC = 10, + ///Special esports platform for `account-v1`. Do not confuse with the `esports` Valorant platform route. + /// + ///`11` (riotapi-schema ID/repr) + #[strum(to_string = "ESPORTS")] + ESPORTS = 11, + ///Special Europe esports platform for `account-v1`. Do not confuse with the `esports` Valorant platform route. + /// + ///`12` (riotapi-schema ID/repr) + #[strum(to_string = "ESPORTSEU")] + ESPORTSEU = 12, +} +///Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR). +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive(IntoPrimitive, TryFromPrimitive)] +#[derive(EnumString, EnumIter, Display, IntoStaticStr)] +#[repr(u8)] +#[non_exhaustive] +pub enum PlatformRoute { + ///Brazil. + /// + ///`16` (riotapi-schema ID/repr) + #[strum(to_string = "BR1", serialize = "BR")] + BR1 = 16, + ///Europe, Northeast. + /// + ///`17` (riotapi-schema ID/repr) + #[strum(to_string = "EUN1", serialize = "EUNE")] + EUN1 = 17, + ///Europe, West. + /// + ///`18` (riotapi-schema ID/repr) + #[strum(to_string = "EUW1", serialize = "EUW")] + EUW1 = 18, + ///Japan. + /// + ///`19` (riotapi-schema ID/repr) + #[strum(to_string = "JP1", serialize = "JP")] + JP1 = 19, + ///Korea. + /// + ///`20` (riotapi-schema ID/repr) + #[strum(to_string = "KR")] + KR = 20, + ///Latin America, North. + /// + ///`21` (riotapi-schema ID/repr) + #[strum(to_string = "LA1", serialize = "LAN")] + LA1 = 21, + ///Latin America, South. + /// + ///`22` (riotapi-schema ID/repr) + #[strum(to_string = "LA2", serialize = "LAS")] + LA2 = 22, + ///Middle East and North Africa. + /// + ///`37` (riotapi-schema ID/repr) + #[strum(to_string = "ME1", serialize = "MENA")] + ME1 = 37, + ///North America. + /// + ///`23` (riotapi-schema ID/repr) + #[strum(to_string = "NA1", serialize = "NA")] + NA1 = 23, + ///Oceania. + /// + ///`24` (riotapi-schema ID/repr) + #[strum(to_string = "OC1", serialize = "OCE")] + OC1 = 24, + ///Philippines, moved into `sg2` on 2025-01-08. + /// + ///`32` (riotapi-schema ID/repr) + #[deprecated] + #[strum(to_string = "PH2", serialize = "PH")] + PH2 = 32, + ///Russia + /// + ///`25` (riotapi-schema ID/repr) + #[strum(to_string = "RU")] + RU = 25, + ///Singapore, Thailand, Philippines + /// + ///`33` (riotapi-schema ID/repr) + #[strum(to_string = "SG2", serialize = "SG")] + SG2 = 33, + ///Thailand, moved into `sg2` on 2025-01-08. + /// + ///`34` (riotapi-schema ID/repr) + #[deprecated] + #[strum(to_string = "TH2", serialize = "TH")] + TH2 = 34, + ///Turkey + /// + ///`26` (riotapi-schema ID/repr) + #[strum(to_string = "TR1", serialize = "TR")] + TR1 = 26, + ///Taiwan + /// + ///`35` (riotapi-schema ID/repr) + #[strum(to_string = "TW2", serialize = "TW")] + TW2 = 35, + ///Vietnam + /// + ///`36` (riotapi-schema ID/repr) + #[strum(to_string = "VN2", serialize = "VN")] + VN2 = 36, + ///Public Beta Environment, special beta testing platform. Located in North America. + /// + ///`31` (riotapi-schema ID/repr) + #[strum(to_string = "PBE1", serialize = "PBE")] + PBE1 = 31, +} +impl PlatformRoute { + /// Converts this [`PlatformRoute`] into its corresponding + /// [`RegionalRoute`] for LoL and TFT match endpoints such as + /// [`match-v5`](crate::endpoints::MatchV5). + pub fn to_regional(self) -> RegionalRoute { + match self { + Self::BR1 => RegionalRoute::AMERICAS, + Self::EUN1 => RegionalRoute::EUROPE, + Self::EUW1 => RegionalRoute::EUROPE, + Self::JP1 => RegionalRoute::ASIA, + Self::KR => RegionalRoute::ASIA, + Self::LA1 => RegionalRoute::AMERICAS, + Self::LA2 => RegionalRoute::AMERICAS, + Self::ME1 => RegionalRoute::EUROPE, + Self::NA1 => RegionalRoute::AMERICAS, + Self::OC1 => RegionalRoute::SEA, + Self::PH2 => RegionalRoute::SEA, + Self::RU => RegionalRoute::EUROPE, + Self::SG2 => RegionalRoute::SEA, + Self::TH2 => RegionalRoute::SEA, + Self::TR1 => RegionalRoute::EUROPE, + Self::TW2 => RegionalRoute::SEA, + Self::VN2 => RegionalRoute::SEA, + Self::PBE1 => RegionalRoute::AMERICAS, + } + } + /// Converts this [`PlatformRoute`] into its corresponding + /// [`RegionalRoute`] for LoR endpoints such as + /// [`lor-match-v1`](crate::endpoints::LorMatchV1). + pub fn to_regional_lor(self) -> RegionalRoute { + match self { + Self::BR1 => RegionalRoute::AMERICAS, + Self::EUN1 => RegionalRoute::EUROPE, + Self::EUW1 => RegionalRoute::EUROPE, + Self::JP1 => RegionalRoute::ASIA, + Self::KR => RegionalRoute::ASIA, + Self::LA1 => RegionalRoute::AMERICAS, + Self::LA2 => RegionalRoute::AMERICAS, + Self::ME1 => RegionalRoute::EUROPE, + Self::NA1 => RegionalRoute::AMERICAS, + Self::OC1 => RegionalRoute::SEA, + Self::PH2 => RegionalRoute::SEA, + Self::RU => RegionalRoute::SEA, + Self::SG2 => RegionalRoute::SEA, + Self::TH2 => RegionalRoute::SEA, + Self::TR1 => RegionalRoute::SEA, + Self::TW2 => RegionalRoute::SEA, + Self::VN2 => RegionalRoute::SEA, + Self::PBE1 => RegionalRoute::AMERICAS, + } + } + /// Used in the LoL Tournament API. Specifically + /// [`tournament-stub-v5.registerProviderData`](crate::endpoints::TournamentStubV5::register_provider_data) + /// and [`tournament-v5.registerProviderData`](crate::endpoints::TournamentV5::register_provider_data). + /// + /// Returns `None` if the corresponding tournament region is unknown: . + pub fn to_tournament_region(self) -> Option { + match self { + Self::BR1 => Some(TournamentRegion::BR), + Self::EUN1 => Some(TournamentRegion::EUNE), + Self::EUW1 => Some(TournamentRegion::EUW), + Self::JP1 => Some(TournamentRegion::JP), + Self::KR => None, + Self::LA1 => Some(TournamentRegion::LAN), + Self::LA2 => Some(TournamentRegion::LAS), + Self::ME1 => None, + Self::NA1 => Some(TournamentRegion::NA), + Self::OC1 => Some(TournamentRegion::OCE), + Self::PH2 => None, + Self::RU => None, + Self::SG2 => None, + Self::TH2 => None, + Self::TR1 => Some(TournamentRegion::TR), + Self::TW2 => None, + Self::VN2 => None, + Self::PBE1 => Some(TournamentRegion::PBE), + } + } + /// Get the slightly more human-friendly alternate name for this `PlatformRoute`. Specifically + /// excludes any trailing numbers and appends extra N(orth), S(outh), E(ast), and/or W(est) + /// suffixes to some names. Some of these are old region names which are often still used as + /// user-facing names, e.g. on op.gg. + /// + /// Note these strings *are* handled by the `FromStr` implementation, if you wish to parse them + /// back into `PlatformRoute`s. + pub fn as_region_str(self) -> &'static str { + match self { + Self::BR1 => "BR", + Self::EUN1 => "EUNE", + Self::EUW1 => "EUW", + Self::JP1 => "JP", + Self::KR => "KR", + Self::LA1 => "LAN", + Self::LA2 => "LAS", + Self::ME1 => "MENA", + Self::NA1 => "NA", + Self::OC1 => "OCE", + Self::PH2 => "PH", + Self::RU => "RU", + Self::SG2 => "SG", + Self::TH2 => "TH", + Self::TR1 => "TR", + Self::TW2 => "TW", + Self::VN2 => "VN", + Self::PBE1 => "PBE", + } + } +} +///Platform routes for Valorant. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive(IntoPrimitive, TryFromPrimitive)] +#[derive(EnumString, EnumIter, Display, IntoStaticStr)] +#[repr(u8)] +#[non_exhaustive] +pub enum ValPlatformRoute { + ///Asia-Pacific. + /// + ///`64` (riotapi-schema ID/repr) + #[strum(to_string = "AP")] + AP = 64, + ///Brazil. + /// + ///`65` (riotapi-schema ID/repr) + #[strum(to_string = "BR")] + BR = 65, + ///Europe. + /// + ///`66` (riotapi-schema ID/repr) + #[strum(to_string = "EU")] + EU = 66, + ///Korea. + /// + ///`70` (riotapi-schema ID/repr) + #[strum(to_string = "KR")] + KR = 70, + ///Latin America. + /// + ///`68` (riotapi-schema ID/repr) + #[strum(to_string = "LATAM")] + LATAM = 68, + ///North America. + /// + ///`69` (riotapi-schema ID/repr) + #[strum(to_string = "NA")] + NA = 69, + ///Special esports platform. + /// + ///`95` (riotapi-schema ID/repr) + #[strum(to_string = "ESPORTS")] + ESPORTS = 95, +} +/// Tournament regions for League of Legends (LoL) used in +/// [`TournamentStubV5`](crate::endpoints::TournamentStubV5) +/// and [`TournamentV5`](crate::endpoints::TournamentV5). +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive(IntoPrimitive, TryFromPrimitive)] +#[derive(EnumString, EnumIter, Display, IntoStaticStr)] +#[derive(serde::Serialize, crate::de::Deserialize)] +#[repr(u8)] +#[non_exhaustive] +pub enum TournamentRegion { + ///Brazil. + /// + ///`16` (riotapi-schema ID/repr) + BR = 16, + ///Europe, Northeast. + /// + ///`17` (riotapi-schema ID/repr) + EUNE = 17, + ///Europe, West. + /// + ///`18` (riotapi-schema ID/repr) + EUW = 18, + ///Japan. + /// + ///`19` (riotapi-schema ID/repr) + JP = 19, + ///Latin America, North. + /// + ///`21` (riotapi-schema ID/repr) + LAN = 21, + ///Latin America, South. + /// + ///`22` (riotapi-schema ID/repr) + LAS = 22, + ///North America. + /// + ///`23` (riotapi-schema ID/repr) + NA = 23, + ///Oceania. + /// + ///`24` (riotapi-schema ID/repr) + OCE = 24, + ///Turkey + /// + ///`26` (riotapi-schema ID/repr) + TR = 26, + ///Public Beta Environment, special beta testing platform. Located in North America. + /// + ///`31` (riotapi-schema ID/repr) + PBE = 31, +} + diff --git a/riven/src/consts/route.rs b/riven/src/consts/route.rs index 82cb254f..422874d9 100644 --- a/riven/src/consts/route.rs +++ b/riven/src/consts/route.rs @@ -1,360 +1,200 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// #![allow(clippy::upper_case_acronyms)] -use num_enum::{ IntoPrimitive, TryFromPrimitive }; -use strum_macros::{ EnumString, EnumIter, Display, IntoStaticStr }; +include_autogen!("route.gen.rs"); -/// Regional routes, used in tournament services, Legends of Runeterra (LoR), and other some endpoints. -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(Clone, Copy)] +/// Utility enum containing all routing variants. +#[derive(Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Clone, Copy)] #[repr(u8)] #[non_exhaustive] -pub enum RegionalRoute { - /// North and South America. - /// - /// `1` (riotapi-schema ID/repr) - AMERICAS = 1, - - /// Asia, used for LoL matches (`match-v5`) and TFT matches (`tft-match-v1`). - /// - /// `2` (riotapi-schema ID/repr) - ASIA = 2, - - /// Europe. - /// - /// `3` (riotapi-schema ID/repr) - EUROPE = 3, - - /// South East Asia, used for LoR, LoL matches (`match-v5`), and TFT matches (`tft-match-v1`). - /// - /// `4` (riotapi-schema ID/repr) - SEA = 4, - - /// Asia-Pacific, deprecated, for some old matches in `lor-match-v1`. - /// - /// `10` (riotapi-schema ID/repr) - #[deprecated] - APAC = 10, - - /// Special esports platform for `account-v1`. Do not confuse with the `esports` Valorant platform route. - /// - /// `11` (riotapi-schema ID/repr) - ESPORTS = 11, - - /// Special Europe esports platform for `account-v1`. Do not confuse with the `esports` Valorant platform route. - /// - /// `12` (riotapi-schema ID/repr) - ESPORTSEU = 12, - +pub enum Route { + /// Sub-variant for [`RegionalRoute`]s. + Regional(RegionalRoute), + /// Sub-variant for [`PlatformRoute`]s. + Platform(PlatformRoute), + /// Sub-variant for [`ValPlatformRoute`]s. + ValPlatform(ValPlatformRoute), } -/// Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR). -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -// Note: strum(serialize = ...) actually specifies extra DEserialization values. -pub enum PlatformRoute { - /// Brazil. - /// - /// `16` (riotapi-schema ID/repr) - #[strum(to_string="BR1", serialize="BR")] - BR1 = 16, - - /// Europe, Northeast. - /// - /// `17` (riotapi-schema ID/repr) - #[strum(to_string="EUN1", serialize="EUNE")] - EUN1 = 17, - - /// Europe, West. - /// - /// `18` (riotapi-schema ID/repr) - #[strum(to_string="EUW1", serialize="EUW")] - EUW1 = 18, - - /// Japan. - /// - /// `19` (riotapi-schema ID/repr) - #[strum(to_string="JP1", serialize="JP")] - JP1 = 19, - - /// Korea. - /// - /// `20` (riotapi-schema ID/repr) - KR = 20, - - /// Latin America, North. - /// - /// `21` (riotapi-schema ID/repr) - #[strum(to_string="LA1", serialize="LAN")] - LA1 = 21, - - /// Latin America, South. - /// - /// `22` (riotapi-schema ID/repr) - #[strum(to_string="LA2", serialize="LAS")] - LA2 = 22, - - /// Middle East and North Africa. - /// - /// `37` (riotapi-schema ID/repr) - #[strum(to_string="ME1", serialize="MENA")] - ME1 = 37, - - /// North America. - /// - /// `23` (riotapi-schema ID/repr) - #[strum(to_string="NA1", serialize="NA")] - NA1 = 23, - - /// Oceania. - /// - /// `24` (riotapi-schema ID/repr) - #[strum(to_string="OC1", serialize="OCE")] - OC1 = 24, +impl From for &'static str { + fn from(route: Route) -> Self { + match route { + Route::Regional(r) => r.into(), + Route::Platform(r) => r.into(), + Route::ValPlatform(r) => r.into(), + } + } +} - /// Philippines, moved into `sg2` on 2025-01-08. - /// - /// `32` (riotapi-schema ID/repr) - #[deprecated] - #[strum(to_string="PH2", serialize="PH")] - PH2 = 32, +impl From for u8 { + fn from(route: Route) -> Self { + match route { + Route::Regional(r) => r.into(), + Route::Platform(r) => r.into(), + Route::ValPlatform(r) => r.into(), + } + } +} - /// Russia - /// - /// `25` (riotapi-schema ID/repr) - RU = 25, +impl num_enum::TryFromPrimitive for Route { + type Primitive = u8; - /// Singapore, Thailand, Philippines - /// - /// `33` (riotapi-schema ID/repr) - #[strum(to_string="SG2", serialize="SG")] - SG2 = 33, + const NAME: &'static str = stringify!(Route); - /// Thailand, moved into `sg2` on 2025-01-08. - /// - /// `34` (riotapi-schema ID/repr) - #[deprecated] - #[strum(to_string="TH2", serialize="TH")] - TH2 = 34, + fn try_from_primitive( + number: Self::Primitive, + ) -> Result> { + RegionalRoute::try_from_primitive(number) + .map(Route::Regional) + .or_else(|_| PlatformRoute::try_from_primitive(number).map(Route::Platform)) + .or_else(|_| ValPlatformRoute::try_from_primitive(number).map(Route::ValPlatform)) + .map_err(|_| num_enum::TryFromPrimitiveError { number }) + } +} - /// Turkey - /// - /// `26` (riotapi-schema ID/repr) - #[strum(to_string="TR1", serialize="TR")] - TR1 = 26, +impl std::convert::TryFrom for Route { + type Error = num_enum::TryFromPrimitiveError; + fn try_from(number: u8) -> Result> { + ::try_from_primitive(number) + } +} - /// Taiwan - /// - /// `35` (riotapi-schema ID/repr) - #[strum(to_string="TW2", serialize="TW")] - TW2 = 35, +impl std::fmt::Display for Route { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Regional(r) => r.fmt(f), + Self::Platform(r) => r.fmt(f), + Self::ValPlatform(r) => r.fmt(f), + } + } +} - /// Vietnam - /// - /// `36` (riotapi-schema ID/repr) - #[strum(to_string="VN2", serialize="VN")] - VN2 = 36, +impl std::str::FromStr for Route { + type Err = strum::ParseError; + fn from_str(s: &str) -> Result { + RegionalRoute::from_str(s) + .map(Self::Regional) + .or_else(|_| PlatformRoute::from_str(s).map(Self::Platform)) + .or_else(|_| ValPlatformRoute::from_str(s).map(Self::ValPlatform)) + .map_err(|_| strum::ParseError::VariantNotFound) + } +} - /// Public Beta Environment, special beta testing platform. Located in North America. - /// - /// `31` (riotapi-schema ID/repr) - #[strum(to_string="PBE1", serialize="PBE")] - PBE1 = 31, +impl Route { + /// Returns an iterator over all routes. Starts with [`Self::Regional`], + /// then [`Self::Platform`], and finally [`Self::ValPlatform`]. + pub fn iter() -> impl Iterator { + use strum::IntoEnumIterator; -} + let regional = RegionalRoute::iter().map(Self::Regional); + let platform = PlatformRoute::iter().map(Self::Platform); + let val_platform = ValPlatformRoute::iter().map(Self::ValPlatform); -impl PlatformRoute { - /// Converts this [`PlatformRoute`] into its corresponding - /// [`RegionalRoute`] for LoL and TFT match endpoints. - /// For example, [`match-v5`](crate::endpoints::MatchV5). - pub fn to_regional(self) -> RegionalRoute { - match self { - Self::BR1 => RegionalRoute::AMERICAS, - Self::EUN1 => RegionalRoute::EUROPE, - Self::EUW1 => RegionalRoute::EUROPE, - Self::JP1 => RegionalRoute::ASIA, - Self::KR => RegionalRoute::ASIA, - Self::LA1 => RegionalRoute::AMERICAS, - Self::LA2 => RegionalRoute::AMERICAS, - Self::ME1 => RegionalRoute::EUROPE, - Self::NA1 => RegionalRoute::AMERICAS, - Self::OC1 => RegionalRoute::SEA, - Self::PH2 => RegionalRoute::SEA, - Self::RU => RegionalRoute::EUROPE, - Self::SG2 => RegionalRoute::SEA, - Self::TH2 => RegionalRoute::SEA, - Self::TR1 => RegionalRoute::EUROPE, - Self::TW2 => RegionalRoute::SEA, - Self::VN2 => RegionalRoute::SEA, - Self::PBE1 => RegionalRoute::AMERICAS, - } + regional.chain(platform).chain(val_platform) } +} - /// Converts this [`PlatformRoute`] into its corresponding - /// [`RegionalRoute`] for LoR endpoints. - /// For example, [`lor-match-v1`](crate::endpoints::LorMatchV1). - pub fn to_regional_lor(self) -> RegionalRoute { - match self { - Self::BR1 => RegionalRoute::AMERICAS, - Self::EUN1 => RegionalRoute::EUROPE, - Self::EUW1 => RegionalRoute::EUROPE, - Self::JP1 => RegionalRoute::ASIA, - Self::KR => RegionalRoute::ASIA, - Self::LA1 => RegionalRoute::AMERICAS, - Self::LA2 => RegionalRoute::AMERICAS, - Self::ME1 => RegionalRoute::EUROPE, - Self::NA1 => RegionalRoute::AMERICAS, - Self::OC1 => RegionalRoute::SEA, - Self::PH2 => RegionalRoute::SEA, - Self::RU => RegionalRoute::SEA, - Self::SG2 => RegionalRoute::SEA, - Self::TH2 => RegionalRoute::SEA, - Self::TR1 => RegionalRoute::SEA, - Self::TW2 => RegionalRoute::SEA, - Self::VN2 => RegionalRoute::SEA, - Self::PBE1 => RegionalRoute::AMERICAS, - } +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_route_tostring() { + assert_eq!( + "AMERICAS", + Into::<&'static str>::into(Route::Regional(RegionalRoute::AMERICAS)) + ); + assert_eq!( + "KR", + Into::<&'static str>::into(Route::Platform(PlatformRoute::KR)) + ); + assert_eq!( + "KR", + Into::<&'static str>::into(Route::ValPlatform(ValPlatformRoute::KR)) + ); } - /// Used in the LoL Tournament API. Specifically - /// [`TournamentStubV5`](crate::endpoints::TournamentStubV5)/[`TournamentV5`](crate::endpoints::TournamentV5). - pub fn to_tournament_region(self) -> Option { - match self { - Self::BR1 => Some(TournamentRegion::BR), - Self::EUN1 => Some(TournamentRegion::EUNE), - Self::EUW1 => Some(TournamentRegion::EUW), - Self::JP1 => Some(TournamentRegion::JP), - Self::LA1 => Some(TournamentRegion::LAN), - Self::LA2 => Some(TournamentRegion::LAS), - Self::NA1 => Some(TournamentRegion::NA), - Self::OC1 => Some(TournamentRegion::OCE), - Self::TR1 => Some(TournamentRegion::TR), - Self::PBE1 => Some(TournamentRegion::PBE), - _other => None, + #[test] + fn test_route_iter() { + for (i, route) in Route::iter().enumerate() { + println!("{:>2} {:<10} {:>3}", i, route, u8::from(route)); } } - /// Get the slightly more human-friendly alternate name for this `PlatformRoute`. Specifically - /// excludes any trailing numbers and appends extra N(orth), S(outh), E(ast), and/or W(est) - /// suffixes to some names. Some of these are old region names which are often still used as - /// user-facing names, e.g. on op.gg. - /// - /// Note these strings *are* handled by the `FromStr` implementation, if you wish to parse them - /// back into `PlatformRoute`s. - pub fn as_region_str(self) -> &'static str { - match self { - Self::BR1 => "BR", - Self::EUN1 => "EUNE", - Self::EUW1 => "EUW", - Self::JP1 => "JP", - Self::LA1 => "LAN", - Self::LA2 => "LAS", - Self::ME1 => "MENA", - Self::NA1 => "NA", - Self::OC1 => "OCE", - Self::PH2 => "PH", - Self::SG2 => "SG", - Self::TH2 => "TH", - Self::TR1 => "TR", - Self::TW2 => "TW", - Self::VN2 => "VN", - Self::PBE1 => "PBE", - other => other.into(), + #[test] + fn test_route_tryfrom() { + for x in u8::MIN..=u8::MAX { + if let Ok(route) = std::convert::TryInto::::try_into(x) { + println!("{:>3} {:<8}", x, route); + } } } -} -/// Platform routes for Valorant. -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -pub enum ValPlatformRoute { - /// Asia-Pacific. - /// - /// `64` (riotapi-schema ID/repr) - AP = 64, + #[test] + fn test_regional_tostring() { + assert_eq!("AMERICAS", RegionalRoute::AMERICAS.to_string()); + assert_eq!("SEA", RegionalRoute::SEA.to_string()); - /// Brazil. - /// - /// `65` (riotapi-schema ID/repr) - BR = 65, + assert_eq!( + "AMERICAS", + Into::<&'static str>::into(RegionalRoute::AMERICAS) + ); + assert_eq!("SEA", Into::<&'static str>::into(RegionalRoute::SEA)); + } - /// Europe. - /// - /// `66` (riotapi-schema ID/repr) - EU = 66, + #[test] + fn test_regional_parse() { + assert_eq!(Ok(RegionalRoute::AMERICAS), "AMERICAS".parse()); + assert_eq!(Ok(RegionalRoute::SEA), "SEA".parse()); + assert!("NA".parse::().is_err()); + } - /// Korea. - /// - /// `70` (riotapi-schema ID/repr) - KR = 70, + #[test] + fn test_platform_tostring() { + assert_eq!("BR1", PlatformRoute::BR1.to_string()); + assert_eq!("KR", PlatformRoute::KR.to_string()); - /// Latin America. - /// - /// `68` (riotapi-schema ID/repr) - LATAM = 68, + assert_eq!("BR1", Into::<&'static str>::into(PlatformRoute::BR1)); + assert_eq!("KR", Into::<&'static str>::into(PlatformRoute::KR)); + } - /// North America. - /// - /// `69` (riotapi-schema ID/repr) - NA = 69, + #[test] + fn test_platform_parse() { + assert_eq!(Ok(PlatformRoute::BR1), "BR1".parse()); + assert_eq!(Ok(PlatformRoute::KR), "KR".parse()); + assert_eq!(Ok(PlatformRoute::JP1), "JP1".parse()); + assert_eq!(Ok(PlatformRoute::JP1), "JP".parse()); + assert_eq!(Ok(PlatformRoute::NA1), "NA1".parse()); + assert_eq!(Ok(PlatformRoute::NA1), "NA".parse()); + assert!("LA".parse::().is_err()); + } - /// Special esports platform. - /// - /// `95` (riotapi-schema ID/repr) - ESPORTS = 95, + #[test] + fn test_valplatform_tostring() { + assert_eq!("AP", ValPlatformRoute::AP.to_string()); + assert_eq!("KR", ValPlatformRoute::KR.to_string()); + assert_eq!("ESPORTS", ValPlatformRoute::ESPORTS.to_string()); + + assert_eq!("AP", Into::<&'static str>::into(ValPlatformRoute::AP)); + assert_eq!("KR", Into::<&'static str>::into(ValPlatformRoute::KR)); + assert_eq!( + "ESPORTS", + Into::<&'static str>::into(ValPlatformRoute::ESPORTS) + ); + } -} + #[test] + fn test_valplatform_parse() { + assert_eq!(Ok(ValPlatformRoute::AP), "AP".parse()); + assert_eq!(Ok(ValPlatformRoute::KR), "KR".parse()); + assert_eq!(Ok(ValPlatformRoute::ESPORTS), "ESPORTS".parse()); + assert!("SEA".parse::().is_err()); + } -/// Tournament regions for League of Legends (LoL) used in -/// [`TournamentStubV5`](crate::endpoints::TournamentStubV5)/[`TournamentV5`](crate::endpoints::TournamentV5). -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(serde::Serialize, crate::de::Deserialize)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -// Note: strum(serialize = ...) actually specifies extra DEserialization values. -pub enum TournamentRegion { - /// Brazil. - BR = 16, - /// Europe, Northeast. - EUNE = 17, - /// Europe, West. - EUW = 18, - /// Japan. - JP = 19, - /// Latin America, North. - LAN = 21, - /// Latin America, South. - LAS = 22, - /// North America. - NA = 23, - /// Oceania. - OCE = 24, - /// Turkey - TR = 26, - /// Public Beta Environment, special beta testing platform. Located in North America. - PBE = 31, + #[test] + fn test_tournament_region_serde() { + use crate::consts::TournamentRegion; + let json = serde_json::to_string(&TournamentRegion::EUNE); + assert!(json.is_ok()); + assert_eq!("\"EUNE\"", &*json.unwrap()); + } } diff --git a/riven/src/consts/route_ext.rs b/riven/src/consts/route_ext.rs deleted file mode 100644 index 34e592f2..00000000 --- a/riven/src/consts/route_ext.rs +++ /dev/null @@ -1,198 +0,0 @@ -use super::{PlatformRoute, RegionalRoute, ValPlatformRoute}; - -/// Utility enum containing all routing variants. -#[derive(Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -pub enum Route { - /// Sub-variant for [`RegionalRoute`]s. - Regional(RegionalRoute), - /// Sub-variant for [`PlatformRoute`]s. - Platform(PlatformRoute), - /// Sub-variant for [`ValPlatformRoute`]s. - ValPlatform(ValPlatformRoute), -} - -impl From for &'static str { - fn from(route: Route) -> Self { - match route { - Route::Regional(r) => r.into(), - Route::Platform(r) => r.into(), - Route::ValPlatform(r) => r.into(), - } - } -} - -impl From for u8 { - fn from(route: Route) -> Self { - match route { - Route::Regional(r) => r.into(), - Route::Platform(r) => r.into(), - Route::ValPlatform(r) => r.into(), - } - } -} - -impl num_enum::TryFromPrimitive for Route { - type Primitive = u8; - - const NAME: &'static str = stringify!(Route); - - fn try_from_primitive( - number: Self::Primitive, - ) -> Result> { - RegionalRoute::try_from_primitive(number) - .map(Route::Regional) - .or_else(|_| PlatformRoute::try_from_primitive(number).map(Route::Platform)) - .or_else(|_| ValPlatformRoute::try_from_primitive(number).map(Route::ValPlatform)) - .map_err(|_| num_enum::TryFromPrimitiveError { number }) - } -} - -impl std::convert::TryFrom for Route { - type Error = num_enum::TryFromPrimitiveError; - fn try_from(number: u8) -> Result> { - ::try_from_primitive(number) - } -} - -impl std::fmt::Display for Route { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - Self::Regional(r) => r.fmt(f), - Self::Platform(r) => r.fmt(f), - Self::ValPlatform(r) => r.fmt(f), - } - } -} - -impl std::str::FromStr for Route { - type Err = strum::ParseError; - fn from_str(s: &str) -> Result { - RegionalRoute::from_str(s) - .map(Self::Regional) - .or_else(|_| PlatformRoute::from_str(s).map(Self::Platform)) - .or_else(|_| ValPlatformRoute::from_str(s).map(Self::ValPlatform)) - .map_err(|_| strum::ParseError::VariantNotFound) - } -} - -impl Route { - /// Returns an iterator over all routes. Starts with [`Self::Regional`], - /// then [`Self::Platform`], and finally [`Self::ValPlatform`]. - pub fn iter() -> impl Iterator { - use strum::IntoEnumIterator; - - let regional = RegionalRoute::iter().map(Self::Regional); - let platform = PlatformRoute::iter().map(Self::Platform); - let val_platform = ValPlatformRoute::iter().map(Self::ValPlatform); - - regional.chain(platform).chain(val_platform) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_route_tostring() { - assert_eq!( - "AMERICAS", - Into::<&'static str>::into(Route::Regional(RegionalRoute::AMERICAS)) - ); - assert_eq!( - "KR", - Into::<&'static str>::into(Route::Platform(PlatformRoute::KR)) - ); - assert_eq!( - "KR", - Into::<&'static str>::into(Route::ValPlatform(ValPlatformRoute::KR)) - ); - } - - #[test] - fn test_route_iter() { - for (i, route) in Route::iter().enumerate() { - println!("{:>2} {:<10} {:>3}", i, route, u8::from(route)); - } - } - - #[test] - fn test_route_tryfrom() { - for x in u8::MIN..=u8::MAX { - if let Ok(route) = std::convert::TryInto::::try_into(x) { - println!("{:>3} {:<8}", x, route); - } - } - } - - #[test] - fn test_regional_tostring() { - assert_eq!("AMERICAS", RegionalRoute::AMERICAS.to_string()); - assert_eq!("SEA", RegionalRoute::SEA.to_string()); - - assert_eq!( - "AMERICAS", - Into::<&'static str>::into(RegionalRoute::AMERICAS) - ); - assert_eq!("SEA", Into::<&'static str>::into(RegionalRoute::SEA)); - } - - #[test] - fn test_regional_parse() { - assert_eq!(Ok(RegionalRoute::AMERICAS), "AMERICAS".parse()); - assert_eq!(Ok(RegionalRoute::SEA), "SEA".parse()); - assert!("NA".parse::().is_err()); - } - - #[test] - fn test_platform_tostring() { - assert_eq!("BR1", PlatformRoute::BR1.to_string()); - assert_eq!("KR", PlatformRoute::KR.to_string()); - - assert_eq!("BR1", Into::<&'static str>::into(PlatformRoute::BR1)); - assert_eq!("KR", Into::<&'static str>::into(PlatformRoute::KR)); - } - - #[test] - fn test_platform_parse() { - assert_eq!(Ok(PlatformRoute::BR1), "BR1".parse()); - assert_eq!(Ok(PlatformRoute::KR), "KR".parse()); - assert_eq!(Ok(PlatformRoute::JP1), "JP1".parse()); - assert_eq!(Ok(PlatformRoute::JP1), "JP".parse()); - assert_eq!(Ok(PlatformRoute::NA1), "NA1".parse()); - assert_eq!(Ok(PlatformRoute::NA1), "NA".parse()); - assert!("LA".parse::().is_err()); - } - - #[test] - fn test_valplatform_tostring() { - assert_eq!("AP", ValPlatformRoute::AP.to_string()); - assert_eq!("KR", ValPlatformRoute::KR.to_string()); - assert_eq!("ESPORTS", ValPlatformRoute::ESPORTS.to_string()); - - assert_eq!("AP", Into::<&'static str>::into(ValPlatformRoute::AP)); - assert_eq!("KR", Into::<&'static str>::into(ValPlatformRoute::KR)); - assert_eq!( - "ESPORTS", - Into::<&'static str>::into(ValPlatformRoute::ESPORTS) - ); - } - - #[test] - fn test_valplatform_parse() { - assert_eq!(Ok(ValPlatformRoute::AP), "AP".parse()); - assert_eq!(Ok(ValPlatformRoute::KR), "KR".parse()); - assert_eq!(Ok(ValPlatformRoute::ESPORTS), "ESPORTS".parse()); - assert!("SEA".parse::().is_err()); - } - - #[test] - fn test_tournament_region_serde() { - use crate::consts::TournamentRegion; - let json = serde_json::to_string(&TournamentRegion::EUNE); - assert!(json.is_ok()); - assert_eq!("\"EUNE\"", &*json.unwrap()); - } -} diff --git a/riven/src/consts/season.gen.rs b/riven/src/consts/season.gen.rs new file mode 100644 index 00000000..dd28f344 --- /dev/null +++ b/riven/src/consts/season.gen.rs @@ -0,0 +1,41 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +#[macro_rules_attribute::apply(newtype_enum)] +#[repr(u8)] +///A League of Legends season for competitive matchmaking. +pub enum Season { + ///`0` + PRESEASON_3 = 0, + ///`1` + SEASON_3 = 1, + ///`2` + PRESEASON_2014 = 2, + ///`3` + SEASON_2014 = 3, + ///`4` + PRESEASON_2015 = 4, + ///`5` + SEASON_2015 = 5, + ///`6` + PRESEASON_2016 = 6, + ///`7` + SEASON_2016 = 7, + ///`8` + PRESEASON_2017 = 8, + ///`9` + SEASON_2017 = 9, + ///`10` + PRESEASON_2018 = 10, + ///`11` + SEASON_2018 = 11, + ///`12` + PRESEASON_2019 = 12, + ///`13` + SEASON_2019 = 13, + ///`14` + PRESEASON_2020 = 14, + ///`15` + SEASON_2020 = 15, +} + diff --git a/riven/src/endpoints.gen.rs b/riven/src/endpoints.gen.rs new file mode 100644 index 00000000..0e10c942 --- /dev/null +++ b/riven/src/endpoints.gen.rs @@ -0,0 +1,4430 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +use std::future::Future; +use std::vec::Vec; +#[cfg(feature = "metrics")] +use crate::metrics; +#[cfg(feature = "tracing")] +use tracing::Instrument; +use reqwest::Method; +use crate::Result; +use crate::consts::{RegionalRoute, PlatformRoute, ValPlatformRoute}; +use crate::riot_api::RiotApi; +impl RiotApi { + ///Returns a handle for accessing [`account-v1`](crate::endpoints::AccountV1) endpoints. + /// + /// # Riot Developer API Reference + ///`account-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn account_v1(&self) -> AccountV1<'_> { + AccountV1 { base: self } + } + ///Returns a handle for accessing [`champion-mastery-v4`](crate::endpoints::ChampionMasteryV4) endpoints. + /// + /// # Riot Developer API Reference + ///`champion-mastery-v4` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn champion_mastery_v4(&self) -> ChampionMasteryV4<'_> { + ChampionMasteryV4 { base: self } + } + ///Returns a handle for accessing [`champion-v3`](crate::endpoints::ChampionV3) endpoints. + /// + /// # Riot Developer API Reference + ///`champion-v3` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn champion_v3(&self) -> ChampionV3<'_> { + ChampionV3 { base: self } + } + ///Returns a handle for accessing [`clash-v1`](crate::endpoints::ClashV1) endpoints. + /// + /// # Riot Developer API Reference + ///`clash-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn clash_v1(&self) -> ClashV1<'_> { + ClashV1 { base: self } + } + ///Returns a handle for accessing [`league-exp-v4`](crate::endpoints::LeagueExpV4) endpoints. + /// + /// # Riot Developer API Reference + ///`league-exp-v4` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn league_exp_v4(&self) -> LeagueExpV4<'_> { + LeagueExpV4 { base: self } + } + ///Returns a handle for accessing [`league-v4`](crate::endpoints::LeagueV4) endpoints. + /// + /// # Riot Developer API Reference + ///`league-v4` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn league_v4(&self) -> LeagueV4<'_> { + LeagueV4 { base: self } + } + ///Returns a handle for accessing [`lol-challenges-v1`](crate::endpoints::LolChallengesV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lol_challenges_v1(&self) -> LolChallengesV1<'_> { + LolChallengesV1 { base: self } + } + ///Returns a handle for accessing [`lol-rso-match-v1`](crate::endpoints::LolRsoMatchV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lol-rso-match-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lol_rso_match_v1(&self) -> LolRsoMatchV1<'_> { + LolRsoMatchV1 { base: self } + } + ///Returns a handle for accessing [`lol-status-v4`](crate::endpoints::LolStatusV4) endpoints. + /// + /// # Riot Developer API Reference + ///`lol-status-v4` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lol_status_v4(&self) -> LolStatusV4<'_> { + LolStatusV4 { base: self } + } + ///Returns a handle for accessing [`lor-deck-v1`](crate::endpoints::LorDeckV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lor-deck-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lor_deck_v1(&self) -> LorDeckV1<'_> { + LorDeckV1 { base: self } + } + ///Returns a handle for accessing [`lor-inventory-v1`](crate::endpoints::LorInventoryV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lor-inventory-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lor_inventory_v1(&self) -> LorInventoryV1<'_> { + LorInventoryV1 { base: self } + } + ///Returns a handle for accessing [`lor-match-v1`](crate::endpoints::LorMatchV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lor-match-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lor_match_v1(&self) -> LorMatchV1<'_> { + LorMatchV1 { base: self } + } + ///Returns a handle for accessing [`lor-ranked-v1`](crate::endpoints::LorRankedV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lor-ranked-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lor_ranked_v1(&self) -> LorRankedV1<'_> { + LorRankedV1 { base: self } + } + ///Returns a handle for accessing [`lor-status-v1`](crate::endpoints::LorStatusV1) endpoints. + /// + /// # Riot Developer API Reference + ///`lor-status-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn lor_status_v1(&self) -> LorStatusV1<'_> { + LorStatusV1 { base: self } + } + ///Returns a handle for accessing [`match-v5`](crate::endpoints::MatchV5) endpoints. + /// + /// # Riot Developer API Reference + ///`match-v5` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn match_v5(&self) -> MatchV5<'_> { + MatchV5 { base: self } + } + ///Returns a handle for accessing [`spectator-tft-v5`](crate::endpoints::SpectatorTftV5) endpoints. + /// + /// # Riot Developer API Reference + ///`spectator-tft-v5` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn spectator_tft_v5(&self) -> SpectatorTftV5<'_> { + SpectatorTftV5 { base: self } + } + ///Returns a handle for accessing [`spectator-v5`](crate::endpoints::SpectatorV5) endpoints. + /// + /// # Riot Developer API Reference + ///`spectator-v5` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn spectator_v5(&self) -> SpectatorV5<'_> { + SpectatorV5 { base: self } + } + ///Returns a handle for accessing [`summoner-v4`](crate::endpoints::SummonerV4) endpoints. + /// + /// # Riot Developer API Reference + ///`summoner-v4` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn summoner_v4(&self) -> SummonerV4<'_> { + SummonerV4 { base: self } + } + ///Returns a handle for accessing [`tft-league-v1`](crate::endpoints::TftLeagueV1) endpoints. + /// + /// # Riot Developer API Reference + ///`tft-league-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn tft_league_v1(&self) -> TftLeagueV1<'_> { + TftLeagueV1 { base: self } + } + ///Returns a handle for accessing [`tft-match-v1`](crate::endpoints::TftMatchV1) endpoints. + /// + /// # Riot Developer API Reference + ///`tft-match-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn tft_match_v1(&self) -> TftMatchV1<'_> { + TftMatchV1 { base: self } + } + ///Returns a handle for accessing [`tft-status-v1`](crate::endpoints::TftStatusV1) endpoints. + /// + /// # Riot Developer API Reference + ///`tft-status-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn tft_status_v1(&self) -> TftStatusV1<'_> { + TftStatusV1 { base: self } + } + ///Returns a handle for accessing [`tft-summoner-v1`](crate::endpoints::TftSummonerV1) endpoints. + /// + /// # Riot Developer API Reference + ///`tft-summoner-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn tft_summoner_v1(&self) -> TftSummonerV1<'_> { + TftSummonerV1 { base: self } + } + ///Returns a handle for accessing [`tournament-stub-v5`](crate::endpoints::TournamentStubV5) endpoints. + /// + /// # Riot Developer API Reference + ///`tournament-stub-v5` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn tournament_stub_v5(&self) -> TournamentStubV5<'_> { + TournamentStubV5 { base: self } + } + ///Returns a handle for accessing [`tournament-v5`](crate::endpoints::TournamentV5) endpoints. + /// + /// # Riot Developer API Reference + ///`tournament-v5` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn tournament_v5(&self) -> TournamentV5<'_> { + TournamentV5 { base: self } + } + ///Returns a handle for accessing [`val-console-match-v1`](crate::endpoints::ValConsoleMatchV1) endpoints. + /// + /// # Riot Developer API Reference + ///`val-console-match-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn val_console_match_v1(&self) -> ValConsoleMatchV1<'_> { + ValConsoleMatchV1 { base: self } + } + ///Returns a handle for accessing [`val-console-ranked-v1`](crate::endpoints::ValConsoleRankedV1) endpoints. + /// + /// # Riot Developer API Reference + ///`val-console-ranked-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn val_console_ranked_v1(&self) -> ValConsoleRankedV1<'_> { + ValConsoleRankedV1 { base: self } + } + ///Returns a handle for accessing [`val-content-v1`](crate::endpoints::ValContentV1) endpoints. + /// + /// # Riot Developer API Reference + ///`val-content-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn val_content_v1(&self) -> ValContentV1<'_> { + ValContentV1 { base: self } + } + ///Returns a handle for accessing [`val-match-v1`](crate::endpoints::ValMatchV1) endpoints. + /// + /// # Riot Developer API Reference + ///`val-match-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn val_match_v1(&self) -> ValMatchV1<'_> { + ValMatchV1 { base: self } + } + ///Returns a handle for accessing [`val-ranked-v1`](crate::endpoints::ValRankedV1) endpoints. + /// + /// # Riot Developer API Reference + ///`val-ranked-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn val_ranked_v1(&self) -> ValRankedV1<'_> { + ValRankedV1 { base: self } + } + ///Returns a handle for accessing [`val-status-v1`](crate::endpoints::ValStatusV1) endpoints. + /// + /// # Riot Developer API Reference + ///`val-status-v1` + /// + ///Note: this item is generated based on `riotapi-schema`. + #[inline] + pub fn val_status_v1(&self) -> ValStatusV1<'_> { + ValStatusV1 { base: self } + } +} +///account-v1 endpoints handle, accessed by calling [`account_v1()`](crate::RiotApi::account_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`account-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct AccountV1<'a> { + base: &'a RiotApi, +} +///champion-mastery-v4 endpoints handle, accessed by calling [`champion_mastery_v4()`](crate::RiotApi::champion_mastery_v4) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`champion-mastery-v4` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ChampionMasteryV4<'a> { + base: &'a RiotApi, +} +///champion-v3 endpoints handle, accessed by calling [`champion_v3()`](crate::RiotApi::champion_v3) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`champion-v3` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ChampionV3<'a> { + base: &'a RiotApi, +} +///clash-v1 endpoints handle, accessed by calling [`clash_v1()`](crate::RiotApi::clash_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`clash-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ClashV1<'a> { + base: &'a RiotApi, +} +///league-exp-v4 endpoints handle, accessed by calling [`league_exp_v4()`](crate::RiotApi::league_exp_v4) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`league-exp-v4` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LeagueExpV4<'a> { + base: &'a RiotApi, +} +///league-v4 endpoints handle, accessed by calling [`league_v4()`](crate::RiotApi::league_v4) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`league-v4` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LeagueV4<'a> { + base: &'a RiotApi, +} +///lol-challenges-v1 endpoints handle, accessed by calling [`lol_challenges_v1()`](crate::RiotApi::lol_challenges_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lol-challenges-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LolChallengesV1<'a> { + base: &'a RiotApi, +} +///lol-rso-match-v1 endpoints handle, accessed by calling [`lol_rso_match_v1()`](crate::RiotApi::lol_rso_match_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lol-rso-match-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LolRsoMatchV1<'a> { + base: &'a RiotApi, +} +///lol-status-v4 endpoints handle, accessed by calling [`lol_status_v4()`](crate::RiotApi::lol_status_v4) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lol-status-v4` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LolStatusV4<'a> { + base: &'a RiotApi, +} +///lor-deck-v1 endpoints handle, accessed by calling [`lor_deck_v1()`](crate::RiotApi::lor_deck_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lor-deck-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LorDeckV1<'a> { + base: &'a RiotApi, +} +///lor-inventory-v1 endpoints handle, accessed by calling [`lor_inventory_v1()`](crate::RiotApi::lor_inventory_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lor-inventory-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LorInventoryV1<'a> { + base: &'a RiotApi, +} +///lor-match-v1 endpoints handle, accessed by calling [`lor_match_v1()`](crate::RiotApi::lor_match_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lor-match-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LorMatchV1<'a> { + base: &'a RiotApi, +} +///lor-ranked-v1 endpoints handle, accessed by calling [`lor_ranked_v1()`](crate::RiotApi::lor_ranked_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lor-ranked-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LorRankedV1<'a> { + base: &'a RiotApi, +} +///lor-status-v1 endpoints handle, accessed by calling [`lor_status_v1()`](crate::RiotApi::lor_status_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`lor-status-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct LorStatusV1<'a> { + base: &'a RiotApi, +} +///match-v5 endpoints handle, accessed by calling [`match_v5()`](crate::RiotApi::match_v5) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`match-v5` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct MatchV5<'a> { + base: &'a RiotApi, +} +///spectator-tft-v5 endpoints handle, accessed by calling [`spectator_tft_v5()`](crate::RiotApi::spectator_tft_v5) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`spectator-tft-v5` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct SpectatorTftV5<'a> { + base: &'a RiotApi, +} +///spectator-v5 endpoints handle, accessed by calling [`spectator_v5()`](crate::RiotApi::spectator_v5) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`spectator-v5` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct SpectatorV5<'a> { + base: &'a RiotApi, +} +///summoner-v4 endpoints handle, accessed by calling [`summoner_v4()`](crate::RiotApi::summoner_v4) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`summoner-v4` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct SummonerV4<'a> { + base: &'a RiotApi, +} +///tft-league-v1 endpoints handle, accessed by calling [`tft_league_v1()`](crate::RiotApi::tft_league_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`tft-league-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct TftLeagueV1<'a> { + base: &'a RiotApi, +} +///tft-match-v1 endpoints handle, accessed by calling [`tft_match_v1()`](crate::RiotApi::tft_match_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`tft-match-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct TftMatchV1<'a> { + base: &'a RiotApi, +} +///tft-status-v1 endpoints handle, accessed by calling [`tft_status_v1()`](crate::RiotApi::tft_status_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`tft-status-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct TftStatusV1<'a> { + base: &'a RiotApi, +} +///tft-summoner-v1 endpoints handle, accessed by calling [`tft_summoner_v1()`](crate::RiotApi::tft_summoner_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`tft-summoner-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct TftSummonerV1<'a> { + base: &'a RiotApi, +} +///tournament-stub-v5 endpoints handle, accessed by calling [`tournament_stub_v5()`](crate::RiotApi::tournament_stub_v5) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`tournament-stub-v5` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct TournamentStubV5<'a> { + base: &'a RiotApi, +} +///tournament-v5 endpoints handle, accessed by calling [`tournament_v5()`](crate::RiotApi::tournament_v5) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`tournament-v5` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct TournamentV5<'a> { + base: &'a RiotApi, +} +///val-console-match-v1 endpoints handle, accessed by calling [`val_console_match_v1()`](crate::RiotApi::val_console_match_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`val-console-match-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ValConsoleMatchV1<'a> { + base: &'a RiotApi, +} +///val-console-ranked-v1 endpoints handle, accessed by calling [`val_console_ranked_v1()`](crate::RiotApi::val_console_ranked_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`val-console-ranked-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ValConsoleRankedV1<'a> { + base: &'a RiotApi, +} +///val-content-v1 endpoints handle, accessed by calling [`val_content_v1()`](crate::RiotApi::val_content_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`val-content-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ValContentV1<'a> { + base: &'a RiotApi, +} +///val-match-v1 endpoints handle, accessed by calling [`val_match_v1()`](crate::RiotApi::val_match_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`val-match-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ValMatchV1<'a> { + base: &'a RiotApi, +} +///val-ranked-v1 endpoints handle, accessed by calling [`val_ranked_v1()`](crate::RiotApi::val_ranked_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`val-ranked-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ValRankedV1<'a> { + base: &'a RiotApi, +} +///val-status-v1 endpoints handle, accessed by calling [`val_status_v1()`](crate::RiotApi::val_status_v1) on a [`RiotApi`] instance. +/// +/// # Riot Developer API Reference +///`val-status-v1` +/// +///Note: this item is generated based on `riotapi-schema`. +#[repr(transparent)] +pub struct ValStatusV1<'a> { + base: &'a RiotApi, +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> AccountV1<'a> { + ///Get account by puuid + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`account-v1.getByPuuid` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_puuid( + &self, + route: RegionalRoute, + puuid: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/riot/account/v1/accounts/by-puuid/{}", puuid), + ); + let future = self + .base + .execute_val::< + crate::models::account_v1::Account, + >("account-v1.getByPuuid", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("account-v1.getByPuuid", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "account-v1.getByPuuid", route_str); + future + } + ///Get account by riot id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `game_name` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. + ///- `tag_line` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. + /// + /// # Riot Developer API Reference + ///`account-v1.getByRiotId` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_riot_id( + &self, + route: RegionalRoute, + game_name: &str, + tag_line: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/riot/account/v1/accounts/by-riot-id/{}/{}", game_name, tag_line + ), + ); + let future = self + .base + .execute_opt::< + crate::models::account_v1::Account, + >("account-v1.getByRiotId", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("account-v1.getByRiotId", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "account-v1.getByRiotId", route_str); + future + } + ///Get account by access token + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`account-v1.getByAccessToken` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_access_token( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/riot/account/v1/accounts/me"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + crate::models::account_v1::Account, + >("account-v1.getByAccessToken", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("account-v1.getByAccessToken", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "account-v1.getByAccessToken", route_str); + future + } + ///Get active shard for a player + /// + /// # Parameters + ///- `route` - Route to query. + ///- `game` (required, in path) + ///- `puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`account-v1.getActiveShard` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_active_shard( + &self, + route: RegionalRoute, + game: &str, + puuid: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/riot/account/v1/active-shards/by-game/{}/by-puuid/{}", game, puuid + ), + ); + let future = self + .base + .execute_opt::< + crate::models::account_v1::ActiveShard, + >("account-v1.getActiveShard", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("account-v1.getActiveShard", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "account-v1.getActiveShard", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ChampionMasteryV4<'a> { + ///Get all champion mastery entries sorted by number of champion points descending. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`champion-mastery-v4.getAllChampionMasteriesByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_all_champion_masteries_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/champion-mastery/v4/champion-masteries/by-puuid/{}", + encrypted_puuid + ), + ); + let future = self + .base + .execute_val::< + Vec, + >("champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "champion-mastery-v4.getAllChampionMasteriesByPUUID", route = + route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "champion-mastery-v4.getAllChampionMasteriesByPUUID", + route_str, + ); + future + } + ///Get a champion mastery by puuid and champion ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) + ///- `champion_id` (required, in path) - Champion ID to retrieve Champion Mastery. + /// + /// # Riot Developer API Reference + ///`champion-mastery-v4.getChampionMasteryByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_champion_mastery_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + champion_id: crate::consts::Champion, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/by-champion/{}", + encrypted_puuid, champion_id + ), + ); + let future = self + .base + .execute_val::< + crate::models::champion_mastery_v4::ChampionMastery, + >("champion-mastery-v4.getChampionMasteryByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "champion-mastery-v4.getChampionMasteryByPUUID", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "champion-mastery-v4.getChampionMasteryByPUUID", + route_str, + ); + future + } + ///Get specified number of top champion mastery entries sorted by number of champion points descending. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) + ///- `count` (optional, in query) - Number of entries to retrieve, defaults to 3. + /// + /// # Riot Developer API Reference + ///`champion-mastery-v4.getTopChampionMasteriesByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_top_champion_masteries_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + count: Option, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/top", + encrypted_puuid + ), + ); + let request = if let Some(count) = count { + request.query(&[("count", count)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "champion-mastery-v4.getTopChampionMasteriesByPUUID", route = + route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "champion-mastery-v4.getTopChampionMasteriesByPUUID", + route_str, + ); + future + } + ///Get a player's total champion mastery score, which is the sum of individual champion mastery levels. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`champion-mastery-v4.getChampionMasteryScoreByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_champion_mastery_score_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/champion-mastery/v4/scores/by-puuid/{}", encrypted_puuid), + ); + let future = self + .base + .execute_val::< + i32, + >("champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "champion-mastery-v4.getChampionMasteryScoreByPUUID", route = + route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "champion-mastery-v4.getChampionMasteryScoreByPUUID", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ChampionV3<'a> { + ///Returns champion rotations, including free-to-play and low-level free-to-play rotations (REST) + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`champion-v3.getChampionInfo` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_champion_info( + &self, + route: PlatformRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/platform/v3/champion-rotations"); + let future = self + .base + .execute_val::< + crate::models::champion_v3::ChampionInfo, + >("champion-v3.getChampionInfo", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("champion-v3.getChampionInfo", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "champion-v3.getChampionInfo", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ClashV1<'a> { + ///Get players by puuid + ///## Implementation Notes + ///This endpoint returns a list of active Clash players for a given PUUID. 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 + ///- `route` - Route to query. + ///- `puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`clash-v1.getPlayersByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_players_by_puuid( + &self, + route: PlatformRoute, + puuid: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/clash/v1/players/by-puuid/{}", puuid), + ); + let future = self + .base + .execute_val::< + Vec, + >("clash-v1.getPlayersByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("clash-v1.getPlayersByPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "clash-v1.getPlayersByPUUID", route_str); + future + } + ///Get team by ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `team_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`clash-v1.getTeamById` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_team_by_id( + &self, + route: PlatformRoute, + team_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/clash/v1/teams/{}", team_id), + ); + let future = self + .base + .execute_opt::< + crate::models::clash_v1::Team, + >("clash-v1.getTeamById", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("clash-v1.getTeamById", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "clash-v1.getTeamById", route_str); + future + } + ///Get all active or upcoming tournaments. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`clash-v1.getTournaments` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_tournaments( + &self, + route: PlatformRoute, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/clash/v1/tournaments"); + let future = self + .base + .execute_val::< + Vec, + >("clash-v1.getTournaments", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("clash-v1.getTournaments", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "clash-v1.getTournaments", route_str); + future + } + ///Get tournament by team ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `team_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`clash-v1.getTournamentByTeam` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_tournament_by_team( + &self, + route: PlatformRoute, + team_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/clash/v1/tournaments/by-team/{}", team_id), + ); + let future = self + .base + .execute_opt::< + crate::models::clash_v1::Tournament, + >("clash-v1.getTournamentByTeam", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("clash-v1.getTournamentByTeam", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "clash-v1.getTournamentByTeam", route_str); + future + } + ///Get tournament by ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `tournament_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`clash-v1.getTournamentById` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_tournament_by_id( + &self, + route: PlatformRoute, + tournament_id: i32, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/clash/v1/tournaments/{}", tournament_id), + ); + let future = self + .base + .execute_opt::< + crate::models::clash_v1::Tournament, + >("clash-v1.getTournamentById", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("clash-v1.getTournamentById", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "clash-v1.getTournamentById", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LeagueExpV4<'a> { + ///Get all the league entries. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) - Note that the queue value must be a valid ranked queue. + ///- `tier` (required, in path) + ///- `division` (required, in path) + ///- `page` (optional, in query) - Defaults to 1. Starts with page 1. + /// + /// # Riot Developer API Reference + ///`league-exp-v4.getLeagueEntries` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_entries( + &self, + route: PlatformRoute, + queue: crate::consts::QueueType, + tier: crate::consts::Tier, + division: crate::consts::Division, + page: Option, + ) -> impl 'a + Future< + Output = Result>>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league-exp/v4/entries/{}/{}/{}", queue, tier, division), + ); + let request = if let Some(page) = page { + request.query(&[("page", page)]) + } else { + request + }; + let future = self + .base + .execute_opt::< + Vec, + >("league-exp-v4.getLeagueEntries", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("league-exp-v4.getLeagueEntries", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "league-exp-v4.getLeagueEntries", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LeagueV4<'a> { + ///Get the challenger league for given queue. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) + /// + /// # Riot Developer API Reference + ///`league-v4.getChallengerLeague` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_challenger_league( + &self, + route: PlatformRoute, + queue: crate::consts::QueueType, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/challengerleagues/by-queue/{}", queue), + ); + let future = self + .base + .execute_val::< + crate::models::league_v4::LeagueList, + >("league-v4.getChallengerLeague", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("league-v4.getChallengerLeague", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "league-v4.getChallengerLeague", route_str); + future + } + ///Get league entries in all queues for a given puuid + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`league-v4.getLeagueEntriesByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_entries_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/entries/by-puuid/{}", encrypted_puuid), + ); + let future = self + .base + .execute_val::< + Vec, + >("league-v4.getLeagueEntriesByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "league-v4.getLeagueEntriesByPUUID", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "league-v4.getLeagueEntriesByPUUID", + route_str, + ); + future + } + ///Get league entries in all queues for a given summoner ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_summoner_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`league-v4.getLeagueEntriesForSummoner` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_entries_for_summoner( + &self, + route: PlatformRoute, + encrypted_summoner_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/entries/by-summoner/{}", encrypted_summoner_id), + ); + let future = self + .base + .execute_val::< + Vec, + >("league-v4.getLeagueEntriesForSummoner", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "league-v4.getLeagueEntriesForSummoner", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "league-v4.getLeagueEntriesForSummoner", + route_str, + ); + future + } + ///Get all the league entries. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) - Note that the queue value must be a valid ranked queue. + ///- `tier` (required, in path) + ///- `division` (required, in path) + ///- `page` (optional, in query) - Defaults to 1. Starts with page 1. + /// + /// # Riot Developer API Reference + ///`league-v4.getLeagueEntries` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_entries( + &self, + route: PlatformRoute, + queue: crate::consts::QueueType, + tier: crate::consts::Tier, + division: crate::consts::Division, + page: Option, + ) -> impl 'a + Future< + Output = Result>>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/entries/{}/{}/{}", queue, tier, division), + ); + let request = if let Some(page) = page { + request.query(&[("page", page)]) + } else { + request + }; + let future = self + .base + .execute_opt::< + Vec, + >("league-v4.getLeagueEntries", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("league-v4.getLeagueEntries", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "league-v4.getLeagueEntries", route_str); + future + } + ///Get the grandmaster league of a specific queue. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) + /// + /// # Riot Developer API Reference + ///`league-v4.getGrandmasterLeague` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_grandmaster_league( + &self, + route: PlatformRoute, + queue: crate::consts::QueueType, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/grandmasterleagues/by-queue/{}", queue), + ); + let future = self + .base + .execute_val::< + crate::models::league_v4::LeagueList, + >("league-v4.getGrandmasterLeague", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("league-v4.getGrandmasterLeague", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "league-v4.getGrandmasterLeague", route_str); + future + } + ///Get league with given ID, including inactive entries. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `league_id` (required, in path) - The UUID of the league. + /// + /// # Riot Developer API Reference + ///`league-v4.getLeagueById` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_by_id( + &self, + route: PlatformRoute, + league_id: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/leagues/{}", league_id), + ); + let future = self + .base + .execute_opt::< + crate::models::league_v4::LeagueList, + >("league-v4.getLeagueById", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("league-v4.getLeagueById", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "league-v4.getLeagueById", route_str); + future + } + ///Get the master league for given queue. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) + /// + /// # Riot Developer API Reference + ///`league-v4.getMasterLeague` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_master_league( + &self, + route: PlatformRoute, + queue: crate::consts::QueueType, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/league/v4/masterleagues/by-queue/{}", queue), + ); + let future = self + .base + .execute_val::< + crate::models::league_v4::LeagueList, + >("league-v4.getMasterLeague", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("league-v4.getMasterLeague", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "league-v4.getMasterLeague", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LolChallengesV1<'a> { + ///List of all basic challenge configuration information (includes all translations for names and descriptions) + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1.getAllChallengeConfigs` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_all_challenge_configs( + &self, + route: PlatformRoute, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/challenges/v1/challenges/config"); + let future = self + .base + .execute_val::< + Vec, + >("lol-challenges-v1.getAllChallengeConfigs", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "lol-challenges-v1.getAllChallengeConfigs", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lol-challenges-v1.getAllChallengeConfigs", + route_str, + ); + future + } + ///Map of level to percentile of players who have achieved it - keys: ChallengeId -> Season -> Level -> percentile of players who achieved it + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1.getAllChallengePercentiles` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_all_challenge_percentiles( + &self, + route: PlatformRoute, + ) -> impl 'a + Future< + Output = Result< + ::std::collections::HashMap< + i64, + ::std::collections::HashMap, + >, + >, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + "/lol/challenges/v1/challenges/percentiles", + ); + let future = self + .base + .execute_val::< + ::std::collections::HashMap< + i64, + ::std::collections::HashMap, + >, + >("lol-challenges-v1.getAllChallengePercentiles", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "lol-challenges-v1.getAllChallengePercentiles", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lol-challenges-v1.getAllChallengePercentiles", + route_str, + ); + future + } + ///Get challenge configuration (REST) + /// + /// # Parameters + ///- `route` - Route to query. + ///- `challenge_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1.getChallengeConfigs` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_challenge_configs( + &self, + route: PlatformRoute, + challenge_id: i64, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/challenges/v1/challenges/{}/config", challenge_id), + ); + let future = self + .base + .execute_opt::< + crate::models::lol_challenges_v1::ChallengeConfigInfo, + >("lol-challenges-v1.getChallengeConfigs", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "lol-challenges-v1.getChallengeConfigs", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lol-challenges-v1.getChallengeConfigs", + route_str, + ); + future + } + ///Return top players for each level. Level must be MASTER, GRANDMASTER or CHALLENGER. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `challenge_id` (required, in path) + ///- `level` (required, in path) + ///- `limit` (optional, in query) + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1.getChallengeLeaderboards` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_challenge_leaderboards( + &self, + route: PlatformRoute, + challenge_id: i64, + level: crate::consts::Tier, + limit: Option, + ) -> impl 'a + Future< + Output = Result>>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/challenges/v1/challenges/{}/leaderboards/by-level/{}", + challenge_id, level + ), + ); + let request = if let Some(limit) = limit { + request.query(&[("limit", limit)]) + } else { + request + }; + let future = self + .base + .execute_opt::< + Vec, + >("lol-challenges-v1.getChallengeLeaderboards", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "lol-challenges-v1.getChallengeLeaderboards", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lol-challenges-v1.getChallengeLeaderboards", + route_str, + ); + future + } + ///Map of level to percentile of players who have achieved it + /// + /// # Parameters + ///- `route` - Route to query. + ///- `challenge_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1.getChallengePercentiles` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_challenge_percentiles( + &self, + route: PlatformRoute, + challenge_id: i64, + ) -> impl 'a + Future< + Output = Result>>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/challenges/v1/challenges/{}/percentiles", challenge_id), + ); + let future = self + .base + .execute_opt::< + ::std::collections::HashMap, + >("lol-challenges-v1.getChallengePercentiles", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "lol-challenges-v1.getChallengePercentiles", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lol-challenges-v1.getChallengePercentiles", + route_str, + ); + future + } + ///Returns player information with list of all progressed challenges (REST) + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`lol-challenges-v1.getPlayerData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_player_data( + &self, + route: PlatformRoute, + puuid: &str, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/challenges/v1/player-data/{}", puuid), + ); + let future = self + .base + .execute_val::< + crate::models::lol_challenges_v1::PlayerInfo, + >("lol-challenges-v1.getPlayerData", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lol-challenges-v1.getPlayerData", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lol-challenges-v1.getPlayerData", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LolRsoMatchV1<'a> { + ///Get a list of match ids by player access token - Includes custom matches + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + ///- `count` (optional, in query) - Defaults to 20. Valid values: 0 to 100. Number of match ids to return. + ///- `start` (optional, in query) - Defaults to 0. Start index. + ///- `r#type` (optional, in query) - Filter the list of match ids by the type of match. This filter is mutually inclusive of the queue filter meaning any match ids returned must match both the queue and type filters. + ///- `queue` (optional, in query) - Filter the list of match ids by a specific queue id. This filter is mutually inclusive of the type filter meaning any match ids returned must match both the queue and type filters. + ///- `end_time` (optional, in query) - Epoch timestamp in seconds. + ///- `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set. + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`lol-rso-match-v1.getMatchIds` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match_ids( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + count: Option, + start: Option, + r#type: Option<&str>, + queue: Option, + end_time: Option, + start_time: Option, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/rso-match/v1/matches/ids"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let request = if let Some(count) = count { + request.query(&[("count", count)]) + } else { + request + }; + let request = if let Some(start) = start { + request.query(&[("start", start)]) + } else { + request + }; + let request = if let Some(r#type) = r#type { + request.query(&[("type", r#type)]) + } else { + request + }; + let request = if let Some(queue) = queue { + request.query(&[("queue", queue)]) + } else { + request + }; + let request = if let Some(end_time) = end_time { + request.query(&[("endTime", end_time)]) + } else { + request + }; + let request = if let Some(start_time) = start_time { + request.query(&[("startTime", start_time)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("lol-rso-match-v1.getMatchIds", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lol-rso-match-v1.getMatchIds", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lol-rso-match-v1.getMatchIds", route_str); + future + } + ///Get a match by match id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + ///- `match_id` (required, in path) + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`lol-rso-match-v1.getMatch` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + match_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/rso-match/v1/matches/{}", match_id), + ); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + crate::models::match_v5::Match, + >("lol-rso-match-v1.getMatch", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lol-rso-match-v1.getMatch", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lol-rso-match-v1.getMatch", route_str); + future + } + ///Get a match timeline by match id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + ///- `match_id` (required, in path) + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`lol-rso-match-v1.getTimeline` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_timeline( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + match_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/rso-match/v1/matches/{}/timeline", match_id), + ); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + crate::models::match_v5::Timeline, + >("lol-rso-match-v1.getTimeline", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lol-rso-match-v1.getTimeline", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lol-rso-match-v1.getTimeline", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LolStatusV4<'a> { + ///Get League of Legends status for the given platform. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`lol-status-v4.getPlatformData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_platform_data( + &self, + route: PlatformRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/status/v4/platform-data"); + let future = self + .base + .execute_val::< + crate::models::lol_status_v4::PlatformData, + >("lol-status-v4.getPlatformData", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lol-status-v4.getPlatformData", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lol-status-v4.getPlatformData", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LorDeckV1<'a> { + ///Get a list of the calling user's decks. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`lor-deck-v1.getDecks` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_decks( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self.base.request(Method::GET, route_str, "/lor/deck/v1/decks/me"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + Vec, + >("lor-deck-v1.getDecks", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("lor-deck-v1.getDecks", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lor-deck-v1.getDecks", route_str); + future + } + ///Create a new deck for the calling user. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + ///- `body` (required, in body) + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`lor-deck-v1.createDeck` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn create_deck( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + body: &crate::models::lor_deck_v1::NewDeck, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::POST, route_str, "/lor/deck/v1/decks/me"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let request = request + .body(serde_json::ser::to_vec(body).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + let future = self + .base + .execute_val::("lor-deck-v1.createDeck", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lor-deck-v1.createDeck", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lor-deck-v1.createDeck", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LorInventoryV1<'a> { + ///Return a list of cards owned by the calling user. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`lor-inventory-v1.getCards` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_cards( + &self, + route: RegionalRoute, + access_token: impl std::fmt::Display, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lor/inventory/v1/cards/me"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + Vec, + >("lor-inventory-v1.getCards", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lor-inventory-v1.getCards", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lor-inventory-v1.getCards", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LorMatchV1<'a> { + ///Get a list of match ids by PUUID + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`lor-match-v1.getMatchIdsByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match_ids_by_puuid( + &self, + route: RegionalRoute, + puuid: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lor/match/v1/matches/by-puuid/{}/ids", puuid), + ); + let future = self + .base + .execute_val::< + Vec, + >("lor-match-v1.getMatchIdsByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lor-match-v1.getMatchIdsByPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "lor-match-v1.getMatchIdsByPUUID", + route_str, + ); + future + } + ///Get match by id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `match_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`lor-match-v1.getMatch` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match( + &self, + route: RegionalRoute, + match_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lor/match/v1/matches/{}", match_id), + ); + let future = self + .base + .execute_val::< + crate::models::lor_match_v1::Match, + >("lor-match-v1.getMatch", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("lor-match-v1.getMatch", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lor-match-v1.getMatch", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LorRankedV1<'a> { + ///Get the players in Master tier. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`lor-ranked-v1.getLeaderboards` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_leaderboards( + &self, + route: RegionalRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lor/ranked/v1/leaderboards"); + let future = self + .base + .execute_val::< + crate::models::lor_ranked_v1::Leaderboard, + >("lor-ranked-v1.getLeaderboards", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lor-ranked-v1.getLeaderboards", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lor-ranked-v1.getLeaderboards", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> LorStatusV1<'a> { + ///Get Legends of Runeterra status for the given platform. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`lor-status-v1.getPlatformData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_platform_data( + &self, + route: RegionalRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lor/status/v1/platform-data"); + let future = self + .base + .execute_val::< + crate::models::lor_status_v1::PlatformData, + >("lor-status-v1.getPlatformData", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("lor-status-v1.getPlatformData", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "lor-status-v1.getPlatformData", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> MatchV5<'a> { + ///Get a list of match ids by puuid + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + ///- `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set. + ///- `end_time` (optional, in query) - Epoch timestamp in seconds. + ///- `queue` (optional, in query) - Filter the list of match ids by a specific queue id. This filter is mutually inclusive of the type filter meaning any match ids returned must match both the queue and type filters. + ///- `r#type` (optional, in query) - Filter the list of match ids by the type of match. This filter is mutually inclusive of the queue filter meaning any match ids returned must match both the queue and type filters. + ///- `start` (optional, in query) - Defaults to 0. Start index. + ///- `count` (optional, in query) - Defaults to 20. Valid values: 0 to 100. Number of match ids to return. + /// + /// # Riot Developer API Reference + ///`match-v5.getMatchIdsByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match_ids_by_puuid( + &self, + route: RegionalRoute, + puuid: &str, + start_time: Option, + end_time: Option, + queue: Option, + r#type: Option<&str>, + start: Option, + count: Option, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/match/v5/matches/by-puuid/{}/ids", puuid), + ); + let request = if let Some(start_time) = start_time { + request.query(&[("startTime", start_time)]) + } else { + request + }; + let request = if let Some(end_time) = end_time { + request.query(&[("endTime", end_time)]) + } else { + request + }; + let request = if let Some(queue) = queue { + request.query(&[("queue", queue)]) + } else { + request + }; + let request = if let Some(r#type) = r#type { + request.query(&[("type", r#type)]) + } else { + request + }; + let request = if let Some(start) = start { + request.query(&[("start", start)]) + } else { + request + }; + let request = if let Some(count) = count { + request.query(&[("count", count)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("match-v5.getMatchIdsByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("match-v5.getMatchIdsByPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "match-v5.getMatchIdsByPUUID", route_str); + future + } + ///Get a match by match id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `match_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`match-v5.getMatch` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match( + &self, + route: RegionalRoute, + match_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/match/v5/matches/{}", match_id), + ); + let future = self + .base + .execute_opt::< + crate::models::match_v5::Match, + >("match-v5.getMatch", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("match-v5.getMatch", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "match-v5.getMatch", route_str); + future + } + ///Get a match timeline by match id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `match_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`match-v5.getTimeline` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_timeline( + &self, + route: RegionalRoute, + match_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/match/v5/matches/{}/timeline", match_id), + ); + let future = self + .base + .execute_opt::< + crate::models::match_v5::Timeline, + >("match-v5.getTimeline", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("match-v5.getTimeline", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "match-v5.getTimeline", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> SpectatorTftV5<'a> { + ///Get current game information for the given puuid. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) - The puuid of the summoner. + /// + /// # Riot Developer API Reference + ///`spectator-tft-v5.getCurrentGameInfoByPuuid` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_current_game_info_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/spectator/tft/v5/active-games/by-puuid/{}", encrypted_puuid + ), + ); + let future = self + .base + .execute_opt::< + crate::models::spectator_tft_v5::CurrentGameInfo, + >("spectator-tft-v5.getCurrentGameInfoByPuuid", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "spectator-tft-v5.getCurrentGameInfoByPuuid", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "spectator-tft-v5.getCurrentGameInfoByPuuid", + route_str, + ); + future + } + ///Get list of featured games. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`spectator-tft-v5.getFeaturedGames` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_featured_games( + &self, + route: PlatformRoute, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/spectator/tft/v5/featured-games"); + let future = self + .base + .execute_val::< + crate::models::spectator_tft_v5::FeaturedGames, + >("spectator-tft-v5.getFeaturedGames", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "spectator-tft-v5.getFeaturedGames", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "spectator-tft-v5.getFeaturedGames", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> SpectatorV5<'a> { + ///Get current game information for the given puuid. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) - The puuid of the summoner. + /// + /// # Riot Developer API Reference + ///`spectator-v5.getCurrentGameInfoByPuuid` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_current_game_info_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/spectator/v5/active-games/by-summoner/{}", encrypted_puuid + ), + ); + let future = self + .base + .execute_opt::< + crate::models::spectator_v5::CurrentGameInfo, + >("spectator-v5.getCurrentGameInfoByPuuid", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "spectator-v5.getCurrentGameInfoByPuuid", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "spectator-v5.getCurrentGameInfoByPuuid", + route_str, + ); + future + } + ///Get list of featured games. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`spectator-v5.getFeaturedGames` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_featured_games( + &self, + route: PlatformRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/spectator/v5/featured-games"); + let future = self + .base + .execute_val::< + crate::models::spectator_v5::FeaturedGames, + >("spectator-v5.getFeaturedGames", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("spectator-v5.getFeaturedGames", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "spectator-v5.getFeaturedGames", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> SummonerV4<'a> { + ///Get a summoner by its RSO encrypted PUUID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `rso_puuid` (required, in path) - Summoner ID. + /// + /// # Riot Developer API Reference + ///`summoner-v4.getByRSOPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_rsopuuid( + &self, + route: PlatformRoute, + rso_puuid: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/fulfillment/v1/summoners/by-puuid/{}", rso_puuid), + ); + let future = self + .base + .execute_val::< + crate::models::summoner_v4::Summoner, + >("summoner-v4.getByRSOPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("summoner-v4.getByRSOPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "summoner-v4.getByRSOPUUID", route_str); + future + } + ///Get a summoner by account ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_account_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`summoner-v4.getByAccountId` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_account_id( + &self, + route: PlatformRoute, + encrypted_account_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/lol/summoner/v4/summoners/by-account/{}", encrypted_account_id + ), + ); + let future = self + .base + .execute_val::< + crate::models::summoner_v4::Summoner, + >("summoner-v4.getByAccountId", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("summoner-v4.getByAccountId", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "summoner-v4.getByAccountId", route_str); + future + } + ///Get a summoner by PUUID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) - Summoner ID. + /// + /// # Riot Developer API Reference + ///`summoner-v4.getByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/summoner/v4/summoners/by-puuid/{}", encrypted_puuid), + ); + let future = self + .base + .execute_val::< + crate::models::summoner_v4::Summoner, + >("summoner-v4.getByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("summoner-v4.getByPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "summoner-v4.getByPUUID", route_str); + future + } + ///Get a summoner by access token. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`summoner-v4.getByAccessToken` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_access_token( + &self, + route: PlatformRoute, + access_token: impl std::fmt::Display, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/lol/summoner/v4/summoners/me"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + crate::models::summoner_v4::Summoner, + >("summoner-v4.getByAccessToken", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("summoner-v4.getByAccessToken", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "summoner-v4.getByAccessToken", route_str); + future + } + ///Get a summoner by summoner ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_summoner_id` (required, in path) - Summoner ID. + /// + /// # Riot Developer API Reference + ///`summoner-v4.getBySummonerId` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_summoner_id( + &self, + route: PlatformRoute, + encrypted_summoner_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/summoner/v4/summoners/{}", encrypted_summoner_id), + ); + let future = self + .base + .execute_val::< + crate::models::summoner_v4::Summoner, + >("summoner-v4.getBySummonerId", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("summoner-v4.getBySummonerId", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "summoner-v4.getBySummonerId", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> TftLeagueV1<'a> { + ///Get the challenger league. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (optional, in query) - Defaults to RANKED_TFT. + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getChallengerLeague` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_challenger_league( + &self, + route: PlatformRoute, + queue: Option<&str>, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/tft/league/v1/challenger"); + let request = if let Some(queue) = queue { + request.query(&[("queue", queue)]) + } else { + request + }; + let future = self + .base + .execute_val::< + crate::models::tft_league_v1::LeagueList, + >("tft-league-v1.getChallengerLeague", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tft-league-v1.getChallengerLeague", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-league-v1.getChallengerLeague", + route_str, + ); + future + } + ///Get league entries for a given summoner ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `summoner_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getLeagueEntriesForSummoner` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_entries_for_summoner( + &self, + route: PlatformRoute, + summoner_id: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/league/v1/entries/by-summoner/{}", summoner_id), + ); + let future = self + .base + .execute_val::< + Vec, + >("tft-league-v1.getLeagueEntriesForSummoner", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tft-league-v1.getLeagueEntriesForSummoner", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-league-v1.getLeagueEntriesForSummoner", + route_str, + ); + future + } + ///Get all the league entries. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `tier` (required, in path) + ///- `division` (required, in path) + ///- `queue` (optional, in query) - Defaults to RANKED_TFT. + ///- `page` (optional, in query) - Defaults to 1. Starts with page 1. + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getLeagueEntries` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_entries( + &self, + route: PlatformRoute, + tier: crate::consts::Tier, + division: &str, + queue: Option<&str>, + page: Option, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/league/v1/entries/{}/{}", tier, division), + ); + let request = if let Some(queue) = queue { + request.query(&[("queue", queue)]) + } else { + request + }; + let request = if let Some(page) = page { + request.query(&[("page", page)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("tft-league-v1.getLeagueEntries", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-league-v1.getLeagueEntries", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-league-v1.getLeagueEntries", route_str); + future + } + ///Get the grandmaster league. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (optional, in query) - Defaults to RANKED_TFT. + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getGrandmasterLeague` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_grandmaster_league( + &self, + route: PlatformRoute, + queue: Option<&str>, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/tft/league/v1/grandmaster"); + let request = if let Some(queue) = queue { + request.query(&[("queue", queue)]) + } else { + request + }; + let future = self + .base + .execute_val::< + crate::models::tft_league_v1::LeagueList, + >("tft-league-v1.getGrandmasterLeague", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tft-league-v1.getGrandmasterLeague", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-league-v1.getGrandmasterLeague", + route_str, + ); + future + } + ///Get league with given ID, including inactive entries. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `league_id` (required, in path) - The UUID of the league. + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getLeagueById` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_league_by_id( + &self, + route: PlatformRoute, + league_id: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/league/v1/leagues/{}", league_id), + ); + let future = self + .base + .execute_opt::< + crate::models::tft_league_v1::LeagueList, + >("tft-league-v1.getLeagueById", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-league-v1.getLeagueById", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-league-v1.getLeagueById", route_str); + future + } + ///Get the master league. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (optional, in query) - Defaults to RANKED_TFT. + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getMasterLeague` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_master_league( + &self, + route: PlatformRoute, + queue: Option<&str>, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self.base.request(Method::GET, route_str, "/tft/league/v1/master"); + let request = if let Some(queue) = queue { + request.query(&[("queue", queue)]) + } else { + request + }; + let future = self + .base + .execute_val::< + crate::models::tft_league_v1::LeagueList, + >("tft-league-v1.getMasterLeague", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-league-v1.getMasterLeague", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-league-v1.getMasterLeague", route_str); + future + } + ///Get the top rated ladder for given queue + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) + /// + /// # Riot Developer API Reference + ///`tft-league-v1.getTopRatedLadder` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_top_rated_ladder( + &self, + route: PlatformRoute, + queue: crate::consts::QueueType, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/league/v1/rated-ladders/{}/top", queue), + ); + let future = self + .base + .execute_val::< + Vec, + >("tft-league-v1.getTopRatedLadder", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-league-v1.getTopRatedLadder", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-league-v1.getTopRatedLadder", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> TftMatchV1<'a> { + ///Get a list of match ids by PUUID + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + ///- `start` (optional, in query) - Defaults to 0. Start index. + ///- `end_time` (optional, in query) - Epoch timestamp in seconds. + ///- `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set. + ///- `count` (optional, in query) - Defaults to 20. Number of match ids to return. + /// + /// # Riot Developer API Reference + ///`tft-match-v1.getMatchIdsByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match_ids_by_puuid( + &self, + route: RegionalRoute, + puuid: &str, + start: Option, + end_time: Option, + start_time: Option, + count: Option, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/match/v1/matches/by-puuid/{}/ids", puuid), + ); + let request = if let Some(start) = start { + request.query(&[("start", start)]) + } else { + request + }; + let request = if let Some(end_time) = end_time { + request.query(&[("endTime", end_time)]) + } else { + request + }; + let request = if let Some(start_time) = start_time { + request.query(&[("startTime", start_time)]) + } else { + request + }; + let request = if let Some(count) = count { + request.query(&[("count", count)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("tft-match-v1.getMatchIdsByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-match-v1.getMatchIdsByPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-match-v1.getMatchIdsByPUUID", + route_str, + ); + future + } + ///Get a match by match id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `match_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`tft-match-v1.getMatch` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match( + &self, + route: RegionalRoute, + match_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/match/v1/matches/{}", match_id), + ); + let future = self + .base + .execute_opt::< + crate::models::tft_match_v1::Match, + >("tft-match-v1.getMatch", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("tft-match-v1.getMatch", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-match-v1.getMatch", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> TftStatusV1<'a> { + ///Get Teamfight Tactics status for the given platform. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`tft-status-v1.getPlatformData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_platform_data( + &self, + route: PlatformRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/tft/status/v1/platform-data"); + let future = self + .base + .execute_val::< + crate::models::tft_status_v1::PlatformData, + >("tft-status-v1.getPlatformData", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-status-v1.getPlatformData", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-status-v1.getPlatformData", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> TftSummonerV1<'a> { + ///Get a summoner by account ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_account_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`tft-summoner-v1.getByAccountId` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_account_id( + &self, + route: PlatformRoute, + encrypted_account_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!( + "/tft/summoner/v1/summoners/by-account/{}", encrypted_account_id + ), + ); + let future = self + .base + .execute_val::< + crate::models::tft_summoner_v1::Summoner, + >("tft-summoner-v1.getByAccountId", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-summoner-v1.getByAccountId", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-summoner-v1.getByAccountId", route_str); + future + } + ///Get a summoner by PUUID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_puuid` (required, in path) - Summoner ID. + /// + /// # Riot Developer API Reference + ///`tft-summoner-v1.getByPUUID` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_puuid( + &self, + route: PlatformRoute, + encrypted_puuid: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/summoner/v1/summoners/by-puuid/{}", encrypted_puuid), + ); + let future = self + .base + .execute_val::< + crate::models::tft_summoner_v1::Summoner, + >("tft-summoner-v1.getByPUUID", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-summoner-v1.getByPUUID", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tft-summoner-v1.getByPUUID", route_str); + future + } + ///Get a summoner by access token. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `access_token` - RSO access token. + /// + /// # RSO + /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) + /// via the `access_token` parameter, instead of the Riot API key. + /// + /// # Riot Developer API Reference + ///`tft-summoner-v1.getByAccessToken` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_access_token( + &self, + route: PlatformRoute, + access_token: impl std::fmt::Display, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/tft/summoner/v1/summoners/me"); + let mut request = request.bearer_auth(access_token); + if let Some(clear) = self.base.get_rso_clear_header() { + request = request.header(clear, ""); + } + let future = self + .base + .execute_val::< + crate::models::tft_summoner_v1::Summoner, + >("tft-summoner-v1.getByAccessToken", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tft-summoner-v1.getByAccessToken", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-summoner-v1.getByAccessToken", + route_str, + ); + future + } + ///Get a summoner by summoner ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `encrypted_summoner_id` (required, in path) - Summoner ID. + /// + /// # Riot Developer API Reference + ///`tft-summoner-v1.getBySummonerId` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_by_summoner_id( + &self, + route: PlatformRoute, + encrypted_summoner_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/tft/summoner/v1/summoners/{}", encrypted_summoner_id), + ); + let future = self + .base + .execute_val::< + crate::models::tft_summoner_v1::Summoner, + >("tft-summoner-v1.getBySummonerId", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tft-summoner-v1.getBySummonerId", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tft-summoner-v1.getBySummonerId", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> TournamentStubV5<'a> { + ///Create a tournament code for the given tournament - Stub method + /// + /// # Parameters + ///- `route` - Route to query. + ///- `body` (required, in body) - Metadata for the generated code. + ///- `tournament_id` (required, in query) - The tournament ID. + ///- `count` (optional, in query) - The number of codes to create (max 1000). + /// + /// # Riot Developer API Reference + ///`tournament-stub-v5.createTournamentCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn create_tournament_code( + &self, + route: RegionalRoute, + body: &crate::models::tournament_stub_v5::TournamentCodeParametersV5, + tournament_id: i64, + count: Option, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request(Method::POST, route_str, "/lol/tournament-stub/v5/codes"); + let request = request + .body(serde_json::ser::to_vec(body).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + let request = request.query(&[("tournamentId", tournament_id)]); + let request = if let Some(count) = count { + request.query(&[("count", count)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("tournament-stub-v5.createTournamentCode", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tournament-stub-v5.createTournamentCode", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-stub-v5.createTournamentCode", + route_str, + ); + 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 + ///`tournament-stub-v5.getTournamentCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_tournament_code( + &self, + route: RegionalRoute, + tournament_code: &str, + ) -> impl 'a + Future< + Output = Result, + > { + 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::< + crate::models::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", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-stub-v5.getTournamentCode", + route_str, + ); + 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 + ///`tournament-stub-v5.getLobbyEventsByCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_lobby_events_by_code( + &self, + route: RegionalRoute, + tournament_code: &str, + ) -> impl 'a + Future< + Output = Result, + > { + 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::< + crate::models::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", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-stub-v5.getLobbyEventsByCode", + route_str, + ); + 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. + ///- `body` (required, in body) - The provider definition. + /// + /// # Riot Developer API Reference + ///`tournament-stub-v5.registerProviderData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn register_provider_data( + &self, + route: RegionalRoute, + body: &crate::models::tournament_stub_v5::ProviderRegistrationParametersV5, + ) -> impl 'a + Future> { + 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()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + 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", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-stub-v5.registerProviderData", + route_str, + ); + future + } + ///Creates a tournament and returns its ID - Stub method + /// + /// # Parameters + ///- `route` - Route to query. + ///- `body` (required, in body) - The tournament definition. + /// + /// # Riot Developer API Reference + ///`tournament-stub-v5.registerTournament` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn register_tournament( + &self, + route: RegionalRoute, + body: &crate::models::tournament_stub_v5::TournamentRegistrationParametersV5, + ) -> impl 'a + Future> { + 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()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + 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", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-stub-v5.registerTournament", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> TournamentV5<'a> { + ///Create a tournament code for the given tournament. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `body` (required, in body) - Metadata for the generated code. + ///- `tournament_id` (required, in query) - The tournament ID. + ///- `count` (optional, in query) - The number of codes to create (max 1000). + /// + /// # Riot Developer API Reference + ///`tournament-v5.createTournamentCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn create_tournament_code( + &self, + route: RegionalRoute, + body: &crate::models::tournament_v5::TournamentCodeParametersV5, + tournament_id: i64, + count: Option, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request(Method::POST, route_str, "/lol/tournament/v5/codes"); + let request = request + .body(serde_json::ser::to_vec(body).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + let request = request.query(&[("tournamentId", tournament_id)]); + let request = if let Some(count) = count { + request.query(&[("count", count)]) + } else { + request + }; + let future = self + .base + .execute_val::< + Vec, + >("tournament-v5.createTournamentCode", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tournament-v5.createTournamentCode", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-v5.createTournamentCode", + route_str, + ); + future + } + ///Returns the tournament code DTO associated with a tournament code string. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `tournament_code` (required, in path) - The tournament code string. + /// + /// # Riot Developer API Reference + ///`tournament-v5.getTournamentCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_tournament_code( + &self, + route: RegionalRoute, + tournament_code: &str, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/tournament/v5/codes/{}", tournament_code), + ); + let future = self + .base + .execute_val::< + crate::models::tournament_v5::TournamentCodeV5, + >("tournament-v5.getTournamentCode", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tournament-v5.getTournamentCode", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-v5.getTournamentCode", + route_str, + ); + future + } + ///Update the pick type, map, spectator type, or allowed puuids for a code. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `tournament_code` (required, in path) - The tournament code to update. + ///- `body` (optional, in body) - The fields to update. + /// + /// # Riot Developer API Reference + ///`tournament-v5.updateCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn update_code( + &self, + route: RegionalRoute, + tournament_code: &str, + body: &Option, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::PUT, + route_str, + &format!("/lol/tournament/v5/codes/{}", tournament_code), + ); + let request = if let Some(body) = body { + request + .body(serde_json::ser::to_vec(body).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json") + } else { + request + }; + let future = self.base.execute("tournament-v5.updateCode", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tournament-v5.updateCode", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tournament-v5.updateCode", route_str); + future + } + ///Get games details + ///## Implementation Notes + ///Additional endpoint to get tournament games. From this endpoint, you are able to get participants PUUID (the callback doesn't contain this info). + /// + ///You can also use it to check if the game was recorded and validate callbacks. If the endpoint returns the game, it means a callback was attempted. + /// + ///This will only work for tournament codes created after November 10, 2023. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `tournament_code` (required, in path) + /// + /// # Riot Developer API Reference + ///`tournament-v5.getGames` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_games( + &self, + route: RegionalRoute, + tournament_code: &str, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/tournament/v5/games/by-code/{}", tournament_code), + ); + let future = self + .base + .execute_val::< + Vec, + >("tournament-v5.getGames", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("tournament-v5.getGames", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "tournament-v5.getGames", route_str); + future + } + ///Gets a list of lobby events by tournament code. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `tournament_code` (required, in path) - The short code to look up lobby events for. + /// + /// # Riot Developer API Reference + ///`tournament-v5.getLobbyEventsByCode` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_lobby_events_by_code( + &self, + route: RegionalRoute, + tournament_code: &str, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/lol/tournament/v5/lobby-events/by-code/{}", tournament_code), + ); + let future = self + .base + .execute_val::< + crate::models::tournament_v5::LobbyEventV5Wrapper, + >("tournament-v5.getLobbyEventsByCode", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tournament-v5.getLobbyEventsByCode", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-v5.getLobbyEventsByCode", + route_str, + ); + future + } + ///Creates a tournament provider and returns its ID. + ///## 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. + ///- `body` (required, in body) - The provider definition. + /// + /// # Riot Developer API Reference + ///`tournament-v5.registerProviderData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn register_provider_data( + &self, + route: RegionalRoute, + body: &crate::models::tournament_v5::ProviderRegistrationParametersV5, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::POST, route_str, "/lol/tournament/v5/providers"); + let request = request + .body(serde_json::ser::to_vec(body).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + let future = self + .base + .execute_val::< + i32, + >("tournament-v5.registerProviderData", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tournament-v5.registerProviderData", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-v5.registerProviderData", + route_str, + ); + future + } + ///Creates a tournament and returns its ID. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `body` (required, in body) - The tournament definition. + /// + /// # Riot Developer API Reference + ///`tournament-v5.registerTournament` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn register_tournament( + &self, + route: RegionalRoute, + body: &crate::models::tournament_v5::TournamentRegistrationParametersV5, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::POST, route_str, "/lol/tournament/v5/tournaments"); + let request = request + .body(serde_json::ser::to_vec(body).unwrap()) + .header(reqwest::header::CONTENT_TYPE, "application/json"); + let future = self + .base + .execute_val::("tournament-v5.registerTournament", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "tournament-v5.registerTournament", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "tournament-v5.registerTournament", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ValConsoleMatchV1<'a> { + ///Get match by id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `match_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`val-console-match-v1.getMatch` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match( + &self, + route: ValPlatformRoute, + match_id: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/match/console/v1/matches/{}", match_id), + ); + let future = self + .base + .execute_val::< + crate::models::val_console_match_v1::Match, + >("val-console-match-v1.getMatch", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-console-match-v1.getMatch", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-console-match-v1.getMatch", route_str); + future + } + ///Get matchlist for games played by puuid and platform type + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + ///- `platform_type` (required, in query) + /// + /// # Riot Developer API Reference + ///`val-console-match-v1.getMatchlist` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_matchlist( + &self, + route: ValPlatformRoute, + puuid: &str, + platform_type: &str, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/match/console/v1/matchlists/by-puuid/{}", puuid), + ); + let request = request.query(&[("platformType", platform_type)]); + let future = self + .base + .execute_val::< + crate::models::val_console_match_v1::Matchlist, + >("val-console-match-v1.getMatchlist", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "val-console-match-v1.getMatchlist", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "val-console-match-v1.getMatchlist", + route_str, + ); + future + } + ///Get recent matches + ///## Implementation Notes + ///Returns a list of match ids that have completed in the last 10 minutes for live regions and 12 hours for the esports routing value. NA/LATAM/BR share a match history deployment. As such, recent matches will return a combined list of matches from those three regions. Requests are load balanced so you may see some inconsistencies as matches are added/removed from the list. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) + /// + /// # Riot Developer API Reference + ///`val-console-match-v1.getRecent` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_recent( + &self, + route: ValPlatformRoute, + queue: &str, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/match/console/v1/recent-matches/by-queue/{}", queue), + ); + let future = self + .base + .execute_val::< + crate::models::val_console_match_v1::RecentMatches, + >("val-console-match-v1.getRecent", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-console-match-v1.getRecent", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-console-match-v1.getRecent", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ValConsoleRankedV1<'a> { + ///Get leaderboard for the competitive queue + /// + /// # Parameters + ///- `route` - Route to query. + ///- `act_id` (required, in path) - Act ids can be found using the val-content API. + ///- `platform_type` (required, in query) + ///- `start_index` (optional, in query) - Defaults to 0. + ///- `size` (optional, in query) - Defaults to 200. Valid values: 1 to 200. + /// + /// # Riot Developer API Reference + ///`val-console-ranked-v1.getLeaderboard` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_leaderboard( + &self, + route: ValPlatformRoute, + act_id: &str, + platform_type: &str, + start_index: Option, + size: Option, + ) -> impl 'a + Future< + Output = Result, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/console/ranked/v1/leaderboards/by-act/{}", act_id), + ); + let request = request.query(&[("platformType", platform_type)]); + let request = if let Some(start_index) = start_index { + request.query(&[("startIndex", start_index)]) + } else { + request + }; + let request = if let Some(size) = size { + request.query(&[("size", size)]) + } else { + request + }; + let future = self + .base + .execute_val::< + crate::models::val_console_ranked_v1::Leaderboard, + >("val-console-ranked-v1.getLeaderboard", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!( + "val-console-ranked-v1.getLeaderboard", route = route_str + ), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed( + future, + "val-console-ranked-v1.getLeaderboard", + route_str, + ); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ValContentV1<'a> { + ///Get content optionally filtered by locale + /// + /// # Parameters + ///- `route` - Route to query. + ///- `locale` (optional, in query) + /// + /// # Riot Developer API Reference + ///`val-content-v1.getContent` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_content( + &self, + route: ValPlatformRoute, + locale: Option<&str>, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/val/content/v1/contents"); + let request = if let Some(locale) = locale { + request.query(&[("locale", locale)]) + } else { + request + }; + let future = self + .base + .execute_val::< + crate::models::val_content_v1::Content, + >("val-content-v1.getContent", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-content-v1.getContent", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-content-v1.getContent", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ValMatchV1<'a> { + ///Get match by id + /// + /// # Parameters + ///- `route` - Route to query. + ///- `match_id` (required, in path) + /// + /// # Riot Developer API Reference + ///`val-match-v1.getMatch` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_match( + &self, + route: ValPlatformRoute, + match_id: &str, + ) -> impl 'a + Future>> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/match/v1/matches/{}", match_id), + ); + let future = self + .base + .execute_opt::< + crate::models::val_match_v1::Match, + >("val-match-v1.getMatch", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument(tracing::info_span!("val-match-v1.getMatch", route = route_str)); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-match-v1.getMatch", route_str); + future + } + ///Get matchlist for games played by puuid + /// + /// # Parameters + ///- `route` - Route to query. + ///- `puuid` (required, in path) + /// + /// # Riot Developer API Reference + ///`val-match-v1.getMatchlist` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_matchlist( + &self, + route: ValPlatformRoute, + puuid: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/match/v1/matchlists/by-puuid/{}", puuid), + ); + let future = self + .base + .execute_val::< + crate::models::val_match_v1::Matchlist, + >("val-match-v1.getMatchlist", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-match-v1.getMatchlist", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-match-v1.getMatchlist", route_str); + future + } + ///Get recent matches + ///## Implementation Notes + ///Returns a list of match ids that have completed in the last 10 minutes for live regions and 12 hours for the esports routing value. NA/LATAM/BR share a match history deployment. As such, recent matches will return a combined list of matches from those three regions. Requests are load balanced so you may see some inconsistencies as matches are added/removed from the list. + /// + /// # Parameters + ///- `route` - Route to query. + ///- `queue` (required, in path) + /// + /// # Riot Developer API Reference + ///`val-match-v1.getRecent` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_recent( + &self, + route: ValPlatformRoute, + queue: &str, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/match/v1/recent-matches/by-queue/{}", queue), + ); + let future = self + .base + .execute_val::< + crate::models::val_match_v1::RecentMatches, + >("val-match-v1.getRecent", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-match-v1.getRecent", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-match-v1.getRecent", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ValRankedV1<'a> { + ///Get leaderboard for the competitive queue + /// + /// # Parameters + ///- `route` - Route to query. + ///- `act_id` (required, in path) - Act ids can be found using the val-content API. + ///- `size` (optional, in query) - Defaults to 200. Valid values: 1 to 200. + ///- `start_index` (optional, in query) - Defaults to 0. + /// + /// # Riot Developer API Reference + ///`val-ranked-v1.getLeaderboard` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_leaderboard( + &self, + route: ValPlatformRoute, + act_id: &str, + size: Option, + start_index: Option, + ) -> impl 'a + Future< + Output = Result>, + > { + let route_str = route.into(); + let request = self + .base + .request( + Method::GET, + route_str, + &format!("/val/ranked/v1/leaderboards/by-act/{}", act_id), + ); + let request = if let Some(size) = size { + request.query(&[("size", size)]) + } else { + request + }; + let request = if let Some(start_index) = start_index { + request.query(&[("startIndex", start_index)]) + } else { + request + }; + let future = self + .base + .execute_opt::< + crate::models::val_ranked_v1::Leaderboard, + >("val-ranked-v1.getLeaderboard", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-ranked-v1.getLeaderboard", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-ranked-v1.getLeaderboard", route_str); + future + } +} +///Note: this item is generated based on `riotapi-schema`. +impl<'a> ValStatusV1<'a> { + ///Get VALORANT status for the given platform. + /// + /// # Parameters + ///- `route` - Route to query. + /// + /// # Riot Developer API Reference + ///`val-status-v1.getPlatformData` + /// + ///Note: this item is generated based on `riotapi-schema`. + pub fn get_platform_data( + &self, + route: ValPlatformRoute, + ) -> impl 'a + Future> { + let route_str = route.into(); + let request = self + .base + .request(Method::GET, route_str, "/val/status/v1/platform-data"); + let future = self + .base + .execute_val::< + crate::models::val_status_v1::PlatformData, + >("val-status-v1.getPlatformData", route_str, request); + #[cfg(feature = "tracing")] + let future = future + .instrument( + tracing::info_span!("val-status-v1.getPlatformData", route = route_str), + ); + #[cfg(feature = "metrics")] + let future = metrics::timed(future, "val-status-v1.getPlatformData", route_str); + future + } +} + diff --git a/riven/src/endpoints.rs b/riven/src/endpoints.rs index 165078e0..05bfd343 100644 --- a/riven/src/endpoints.rs +++ b/riven/src/endpoints.rs @@ -1,2635 +1,4 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// +#![allow(clippy::too_many_arguments)] +//! Automatically generated endpoint handles and methods. -// http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 996d171a2b79e9bb85c549f47b07c6ef2721fc8a - -//! Automatically generated endpoint handles. -#![allow(clippy::let_and_return, clippy::too_many_arguments)] - -use std::future::Future; -use std::vec::Vec; - -#[cfg(feature="metrics")] -use crate::metrics; - -#[cfg(feature="tracing")] -use tracing::Instrument; -use reqwest::Method; - -use crate::Result; -use crate::consts::{ RegionalRoute, PlatformRoute, ValPlatformRoute }; -use crate::riot_api::RiotApi; - -impl RiotApi { - /// Returns a handle for accessing [AccountV1](crate::endpoints::AccountV1) endpoints. - /// # Riot Developer API Reference - /// `account-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn account_v1(&self) -> AccountV1 { - AccountV1 { base: self } - } - /// Returns a handle for accessing [ChampionMasteryV4](crate::endpoints::ChampionMasteryV4) endpoints. - /// # Riot Developer API Reference - /// `champion-mastery-v4` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn champion_mastery_v4(&self) -> ChampionMasteryV4 { - ChampionMasteryV4 { base: self } - } - /// Returns a handle for accessing [ChampionV3](crate::endpoints::ChampionV3) endpoints. - /// # Riot Developer API Reference - /// `champion-v3` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn champion_v3(&self) -> ChampionV3 { - ChampionV3 { base: self } - } - /// Returns a handle for accessing [ClashV1](crate::endpoints::ClashV1) endpoints. - /// # Riot Developer API Reference - /// `clash-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn clash_v1(&self) -> ClashV1 { - ClashV1 { base: self } - } - /// Returns a handle for accessing [LeagueExpV4](crate::endpoints::LeagueExpV4) endpoints. - /// # Riot Developer API Reference - /// `league-exp-v4` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn league_exp_v4(&self) -> LeagueExpV4 { - LeagueExpV4 { base: self } - } - /// Returns a handle for accessing [LeagueV4](crate::endpoints::LeagueV4) endpoints. - /// # Riot Developer API Reference - /// `league-v4` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn league_v4(&self) -> LeagueV4 { - LeagueV4 { base: self } - } - /// Returns a handle for accessing [LolChallengesV1](crate::endpoints::LolChallengesV1) endpoints. - /// # Riot Developer API Reference - /// `lol-challenges-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lol_challenges_v1(&self) -> LolChallengesV1 { - LolChallengesV1 { base: self } - } - /// Returns a handle for accessing [LolRsoMatchV1](crate::endpoints::LolRsoMatchV1) endpoints. - /// # Riot Developer API Reference - /// `lol-rso-match-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lol_rso_match_v1(&self) -> LolRsoMatchV1 { - LolRsoMatchV1 { base: self } - } - /// Returns a handle for accessing [LolStatusV4](crate::endpoints::LolStatusV4) endpoints. - /// # Riot Developer API Reference - /// `lol-status-v4` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lol_status_v4(&self) -> LolStatusV4 { - LolStatusV4 { base: self } - } - /// Returns a handle for accessing [LorDeckV1](crate::endpoints::LorDeckV1) endpoints. - /// # Riot Developer API Reference - /// `lor-deck-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lor_deck_v1(&self) -> LorDeckV1 { - LorDeckV1 { base: self } - } - /// Returns a handle for accessing [LorInventoryV1](crate::endpoints::LorInventoryV1) endpoints. - /// # Riot Developer API Reference - /// `lor-inventory-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lor_inventory_v1(&self) -> LorInventoryV1 { - LorInventoryV1 { 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` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lor_ranked_v1(&self) -> LorRankedV1 { - LorRankedV1 { base: self } - } - /// Returns a handle for accessing [LorStatusV1](crate::endpoints::LorStatusV1) endpoints. - /// # Riot Developer API Reference - /// `lor-status-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn lor_status_v1(&self) -> LorStatusV1 { - LorStatusV1 { base: self } - } - /// Returns a handle for accessing [MatchV5](crate::endpoints::MatchV5) endpoints. - /// # Riot Developer API Reference - /// `match-v5` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn match_v5(&self) -> MatchV5 { - MatchV5 { base: self } - } - /// Returns a handle for accessing [SpectatorTftV5](crate::endpoints::SpectatorTftV5) endpoints. - /// # Riot Developer API Reference - /// `spectator-tft-v5` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn spectator_tft_v5(&self) -> SpectatorTftV5 { - SpectatorTftV5 { base: self } - } - /// Returns a handle for accessing [SpectatorV5](crate::endpoints::SpectatorV5) endpoints. - /// # Riot Developer API Reference - /// `spectator-v5` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn spectator_v5(&self) -> SpectatorV5 { - SpectatorV5 { base: self } - } - /// Returns a handle for accessing [SummonerV4](crate::endpoints::SummonerV4) endpoints. - /// # Riot Developer API Reference - /// `summoner-v4` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn summoner_v4(&self) -> SummonerV4 { - SummonerV4 { base: self } - } - /// Returns a handle for accessing [TftLeagueV1](crate::endpoints::TftLeagueV1) endpoints. - /// # Riot Developer API Reference - /// `tft-league-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn tft_league_v1(&self) -> TftLeagueV1 { - TftLeagueV1 { base: self } - } - /// Returns a handle for accessing [TftMatchV1](crate::endpoints::TftMatchV1) endpoints. - /// # Riot Developer API Reference - /// `tft-match-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn tft_match_v1(&self) -> TftMatchV1 { - TftMatchV1 { base: self } - } - /// Returns a handle for accessing [TftStatusV1](crate::endpoints::TftStatusV1) endpoints. - /// # Riot Developer API Reference - /// `tft-status-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn tft_status_v1(&self) -> TftStatusV1 { - TftStatusV1 { base: self } - } - /// Returns a handle for accessing [TftSummonerV1](crate::endpoints::TftSummonerV1) endpoints. - /// # Riot Developer API Reference - /// `tft-summoner-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn tft_summoner_v1(&self) -> TftSummonerV1 { - TftSummonerV1 { base: self } - } - /// Returns a handle for accessing [TournamentStubV5](crate::endpoints::TournamentStubV5) endpoints. - /// # Riot Developer API Reference - /// `tournament-stub-v5` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn tournament_stub_v5(&self) -> TournamentStubV5 { - TournamentStubV5 { base: self } - } - /// Returns a handle for accessing [TournamentV5](crate::endpoints::TournamentV5) endpoints. - /// # Riot Developer API Reference - /// `tournament-v5` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn tournament_v5(&self) -> TournamentV5 { - TournamentV5 { base: self } - } - /// Returns a handle for accessing [ValConsoleMatchV1](crate::endpoints::ValConsoleMatchV1) endpoints. - /// # Riot Developer API Reference - /// `val-console-match-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn val_console_match_v1(&self) -> ValConsoleMatchV1 { - ValConsoleMatchV1 { base: self } - } - /// Returns a handle for accessing [ValConsoleRankedV1](crate::endpoints::ValConsoleRankedV1) endpoints. - /// # Riot Developer API Reference - /// `val-console-ranked-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn val_console_ranked_v1(&self) -> ValConsoleRankedV1 { - ValConsoleRankedV1 { base: self } - } - /// Returns a handle for accessing [ValContentV1](crate::endpoints::ValContentV1) endpoints. - /// # Riot Developer API Reference - /// `val-content-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn val_content_v1(&self) -> ValContentV1 { - ValContentV1 { base: self } - } - /// Returns a handle for accessing [ValMatchV1](crate::endpoints::ValMatchV1) endpoints. - /// # Riot Developer API Reference - /// `val-match-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn val_match_v1(&self) -> ValMatchV1 { - ValMatchV1 { base: self } - } - /// Returns a handle for accessing [ValRankedV1](crate::endpoints::ValRankedV1) endpoints. - /// # Riot Developer API Reference - /// `val-ranked-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn val_ranked_v1(&self) -> ValRankedV1 { - ValRankedV1 { base: self } - } - /// Returns a handle for accessing [ValStatusV1](crate::endpoints::ValStatusV1) endpoints. - /// # Riot Developer API Reference - /// `val-status-v1` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn val_status_v1(&self) -> ValStatusV1 { - ValStatusV1 { base: self } - } -} - -/// AccountV1 endpoints handle, accessed by calling [`account_v1()`](RiotApi::account_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `account-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct AccountV1<'a> { - base: &'a RiotApi, -} -impl<'a> AccountV1<'a> { - /// Get account by puuid - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `account-v1.getByPuuid` - /// - /// Note: this method is automatically generated. - pub fn get_by_puuid(&self, route: RegionalRoute, puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/riot/account/v1/accounts/by-puuid/{}", puuid)); - let future = self.base.execute_val::("account-v1.getByPuuid", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getByPuuid", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "account-v1.getByPuuid", route_str); - future - } - - /// Get account by riot id - /// # Parameters - /// * `route` - Route to query. - /// * `tag_line` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. - /// * `game_name` (required, in path) - When querying for a player by their riot id, the gameName and tagLine query params are required. - /// # Riot Developer API Reference - /// `account-v1.getByRiotId` - /// - /// Note: this method is automatically generated. - pub fn get_by_riot_id(&self, route: RegionalRoute, game_name: &str, tag_line: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/riot/account/v1/accounts/by-riot-id/{}/{}", game_name, tag_line)); - let future = self.base.execute_opt::("account-v1.getByRiotId", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getByRiotId", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "account-v1.getByRiotId", route_str); - future - } - - /// Get account by access token - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `account-v1.getByAccessToken` - /// - /// Note: this method is automatically generated. - pub fn get_by_access_token(&self, route: RegionalRoute, access_token: impl std::fmt::Display) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/riot/account/v1/accounts/me"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::("account-v1.getByAccessToken", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getByAccessToken", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "account-v1.getByAccessToken", route_str); - future - } - - /// Get active shard for a player - /// # Parameters - /// * `route` - Route to query. - /// * `game` (required, in path) - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `account-v1.getActiveShard` - /// - /// Note: this method is automatically generated. - pub fn get_active_shard(&self, route: RegionalRoute, game: &str, puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/riot/account/v1/active-shards/by-game/{}/by-puuid/{}", game, puuid)); - let future = self.base.execute_opt::("account-v1.getActiveShard", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("account-v1.getActiveShard", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "account-v1.getActiveShard", route_str); - future - } - -} - -/// ChampionMasteryV4 endpoints handle, accessed by calling [`champion_mastery_v4()`](RiotApi::champion_mastery_v4) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `champion-mastery-v4` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ChampionMasteryV4<'a> { - base: &'a RiotApi, -} -impl<'a> ChampionMasteryV4<'a> { - /// Get all champion mastery entries sorted by number of champion points descending. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - /// # Riot Developer API Reference - /// `champion-mastery-v4.getAllChampionMasteriesByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_all_champion_masteries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}", encrypted_puuid)); - let future = self.base.execute_val::>("champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getAllChampionMasteriesByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "champion-mastery-v4.getAllChampionMasteriesByPUUID", route_str); - future - } - - /// Get a champion mastery by puuid and champion ID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - /// * `champion_id` (required, in path) - Champion ID to retrieve Champion Mastery. - /// # Riot Developer API Reference - /// `champion-mastery-v4.getChampionMasteryByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_champion_mastery_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str, champion_id: crate::consts::Champion) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/by-champion/{}", encrypted_puuid, champion_id)); - let future = self.base.execute_val::("champion-mastery-v4.getChampionMasteryByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "champion-mastery-v4.getChampionMasteryByPUUID", route_str); - future - } - - /// Get specified number of top champion mastery entries sorted by number of champion points descending. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - /// * `count` (optional, in query) - Number of entries to retrieve, defaults to 3. - /// # Riot Developer API Reference - /// `champion-mastery-v4.getTopChampionMasteriesByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_top_champion_masteries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str, count: Option) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/champion-masteries/by-puuid/{}/top", encrypted_puuid)); - let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request }; - let future = self.base.execute_val::>("champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getTopChampionMasteriesByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "champion-mastery-v4.getTopChampionMasteriesByPUUID", route_str); - future - } - - /// Get a player's total champion mastery score, which is the sum of individual champion mastery levels. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - /// # Riot Developer API Reference - /// `champion-mastery-v4.getChampionMasteryScoreByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_champion_mastery_score_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/champion-mastery/v4/scores/by-puuid/{}", encrypted_puuid)); - let future = self.base.execute_val::("champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-mastery-v4.getChampionMasteryScoreByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "champion-mastery-v4.getChampionMasteryScoreByPUUID", route_str); - future - } - -} - -/// ChampionV3 endpoints handle, accessed by calling [`champion_v3()`](RiotApi::champion_v3) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `champion-v3` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ChampionV3<'a> { - base: &'a RiotApi, -} -impl<'a> ChampionV3<'a> { - /// Returns champion rotations, including free-to-play and low-level free-to-play rotations (REST) - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `champion-v3.getChampionInfo` - /// - /// Note: this method is automatically generated. - pub fn get_champion_info(&self, route: PlatformRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/platform/v3/champion-rotations"); - let future = self.base.execute_val::("champion-v3.getChampionInfo", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("champion-v3.getChampionInfo", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "champion-v3.getChampionInfo", route_str); - future - } - -} - -/// ClashV1 endpoints handle, accessed by calling [`clash_v1()`](RiotApi::clash_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `clash-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ClashV1<'a> { - base: &'a RiotApi, -} -impl<'a> ClashV1<'a> { - /// Get players by puuid - /// ## Implementation Notes - /// This endpoint returns a list of active Clash players for a given PUUID. 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 - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `clash-v1.getPlayersByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_players_by_puuid(&self, route: PlatformRoute, puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/players/by-puuid/{}", puuid)); - let future = self.base.execute_val::>("clash-v1.getPlayersByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getPlayersByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "clash-v1.getPlayersByPUUID", route_str); - future - } - - /// Get team by ID. - /// # Parameters - /// * `route` - Route to query. - /// * `team_id` (required, in path) - /// # Riot Developer API Reference - /// `clash-v1.getTeamById` - /// - /// Note: this method is automatically generated. - pub fn get_team_by_id(&self, route: PlatformRoute, team_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/teams/{}", team_id)); - let future = self.base.execute_opt::("clash-v1.getTeamById", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTeamById", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "clash-v1.getTeamById", route_str); - future - } - - /// Get all active or upcoming tournaments. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `clash-v1.getTournaments` - /// - /// Note: this method is automatically generated. - pub fn get_tournaments(&self, route: PlatformRoute) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/clash/v1/tournaments"); - let future = self.base.execute_val::>("clash-v1.getTournaments", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTournaments", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "clash-v1.getTournaments", route_str); - future - } - - /// Get tournament by team ID. - /// # Parameters - /// * `route` - Route to query. - /// * `team_id` (required, in path) - /// # Riot Developer API Reference - /// `clash-v1.getTournamentByTeam` - /// - /// Note: this method is automatically generated. - pub fn get_tournament_by_team(&self, route: PlatformRoute, team_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/tournaments/by-team/{}", team_id)); - let future = self.base.execute_opt::("clash-v1.getTournamentByTeam", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTournamentByTeam", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "clash-v1.getTournamentByTeam", route_str); - future - } - - /// Get tournament by ID. - /// # Parameters - /// * `route` - Route to query. - /// * `tournament_id` (required, in path) - /// # Riot Developer API Reference - /// `clash-v1.getTournamentById` - /// - /// Note: this method is automatically generated. - pub fn get_tournament_by_id(&self, route: PlatformRoute, tournament_id: i32) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/clash/v1/tournaments/{}", tournament_id)); - let future = self.base.execute_opt::("clash-v1.getTournamentById", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("clash-v1.getTournamentById", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "clash-v1.getTournamentById", route_str); - future - } - -} - -/// LeagueExpV4 endpoints handle, accessed by calling [`league_exp_v4()`](RiotApi::league_exp_v4) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `league-exp-v4` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LeagueExpV4<'a> { - base: &'a RiotApi, -} -impl<'a> LeagueExpV4<'a> { - /// Get all the league entries. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - Note that the queue value must be a valid ranked queue. - /// * `tier` (required, in path) - /// * `division` (required, in path) - /// * `page` (optional, in query) - Defaults to 1. Starts with page 1. - /// # Riot Developer API Reference - /// `league-exp-v4.getLeagueEntries` - /// - /// Note: this method is automatically generated. - pub fn get_league_entries(&self, route: PlatformRoute, queue: crate::consts::QueueType, tier: crate::consts::Tier, division: crate::consts::Division, page: Option) - -> impl Future>>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league-exp/v4/entries/{}/{}/{}", queue, tier, division)); - let request = if let Some(page) = page { request.query(&[ ("page", page) ]) } else { request }; - let future = self.base.execute_opt::>("league-exp-v4.getLeagueEntries", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-exp-v4.getLeagueEntries", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-exp-v4.getLeagueEntries", route_str); - future - } - -} - -/// LeagueV4 endpoints handle, accessed by calling [`league_v4()`](RiotApi::league_v4) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `league-v4` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LeagueV4<'a> { - base: &'a RiotApi, -} -impl<'a> LeagueV4<'a> { - /// Get the challenger league for given queue. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - /// # Riot Developer API Reference - /// `league-v4.getChallengerLeague` - /// - /// Note: this method is automatically generated. - pub fn get_challenger_league(&self, route: PlatformRoute, queue: crate::consts::QueueType) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/challengerleagues/by-queue/{}", queue)); - let future = self.base.execute_val::("league-v4.getChallengerLeague", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getChallengerLeague", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getChallengerLeague", route_str); - future - } - - /// Get league entries in all queues for a given puuid - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - /// # Riot Developer API Reference - /// `league-v4.getLeagueEntriesByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_league_entries_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/entries/by-puuid/{}", encrypted_puuid)); - let future = self.base.execute_val::>("league-v4.getLeagueEntriesByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntriesByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getLeagueEntriesByPUUID", route_str); - future - } - - /// Get league entries in all queues for a given summoner ID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_summoner_id` (required, in path) - /// # Riot Developer API Reference - /// `league-v4.getLeagueEntriesForSummoner` - /// - /// Note: this method is automatically generated. - pub fn get_league_entries_for_summoner(&self, route: PlatformRoute, encrypted_summoner_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/entries/by-summoner/{}", encrypted_summoner_id)); - let future = self.base.execute_val::>("league-v4.getLeagueEntriesForSummoner", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntriesForSummoner", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getLeagueEntriesForSummoner", route_str); - future - } - - /// Get all the league entries. - /// # Parameters - /// * `route` - Route to query. - /// * `division` (required, in path) - /// * `tier` (required, in path) - /// * `queue` (required, in path) - Note that the queue value must be a valid ranked queue. - /// * `page` (optional, in query) - Defaults to 1. Starts with page 1. - /// # Riot Developer API Reference - /// `league-v4.getLeagueEntries` - /// - /// Note: this method is automatically generated. - pub fn get_league_entries(&self, route: PlatformRoute, queue: crate::consts::QueueType, tier: crate::consts::Tier, division: crate::consts::Division, page: Option) - -> impl Future>>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/entries/{}/{}/{}", queue, tier, division)); - let request = if let Some(page) = page { request.query(&[ ("page", page) ]) } else { request }; - let future = self.base.execute_opt::>("league-v4.getLeagueEntries", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueEntries", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getLeagueEntries", route_str); - future - } - - /// Get the grandmaster league of a specific queue. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - /// # Riot Developer API Reference - /// `league-v4.getGrandmasterLeague` - /// - /// Note: this method is automatically generated. - pub fn get_grandmaster_league(&self, route: PlatformRoute, queue: crate::consts::QueueType) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/grandmasterleagues/by-queue/{}", queue)); - let future = self.base.execute_val::("league-v4.getGrandmasterLeague", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getGrandmasterLeague", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getGrandmasterLeague", route_str); - future - } - - /// Get league with given ID, including inactive entries. - /// # Parameters - /// * `route` - Route to query. - /// * `league_id` (required, in path) - The UUID of the league. - /// # Riot Developer API Reference - /// `league-v4.getLeagueById` - /// - /// Note: this method is automatically generated. - pub fn get_league_by_id(&self, route: PlatformRoute, league_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/leagues/{}", league_id)); - let future = self.base.execute_opt::("league-v4.getLeagueById", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getLeagueById", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getLeagueById", route_str); - future - } - - /// Get the master league for given queue. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - /// # Riot Developer API Reference - /// `league-v4.getMasterLeague` - /// - /// Note: this method is automatically generated. - pub fn get_master_league(&self, route: PlatformRoute, queue: crate::consts::QueueType) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/league/v4/masterleagues/by-queue/{}", queue)); - let future = self.base.execute_val::("league-v4.getMasterLeague", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("league-v4.getMasterLeague", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "league-v4.getMasterLeague", route_str); - future - } - -} - -/// LolChallengesV1 endpoints handle, accessed by calling [`lol_challenges_v1()`](RiotApi::lol_challenges_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lol-challenges-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LolChallengesV1<'a> { - base: &'a RiotApi, -} -impl<'a> LolChallengesV1<'a> { - /// List of all basic challenge configuration information (includes all translations for names and descriptions) - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `lol-challenges-v1.getAllChallengeConfigs` - /// - /// Note: this method is automatically generated. - pub fn get_all_challenge_configs(&self, route: PlatformRoute) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/challenges/v1/challenges/config"); - let future = self.base.execute_val::>("lol-challenges-v1.getAllChallengeConfigs", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengeConfigs", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-challenges-v1.getAllChallengeConfigs", route_str); - future - } - - /// Map of level to percentile of players who have achieved it - keys: ChallengeId -> Season -> Level -> percentile of players who achieved it - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `lol-challenges-v1.getAllChallengePercentiles` - /// - /// Note: this method is automatically generated. - pub fn get_all_challenge_percentiles(&self, route: PlatformRoute) - -> impl Future>>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/challenges/v1/challenges/percentiles"); - let future = self.base.execute_val::>>("lol-challenges-v1.getAllChallengePercentiles", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getAllChallengePercentiles", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-challenges-v1.getAllChallengePercentiles", route_str); - future - } - - /// Get challenge configuration (REST) - /// # Parameters - /// * `route` - Route to query. - /// * `challenge_id` (required, in path) - /// # Riot Developer API Reference - /// `lol-challenges-v1.getChallengeConfigs` - /// - /// Note: this method is automatically generated. - pub fn get_challenge_configs(&self, route: PlatformRoute, challenge_id: i64) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/config", challenge_id)); - let future = self.base.execute_opt::("lol-challenges-v1.getChallengeConfigs", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeConfigs", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-challenges-v1.getChallengeConfigs", route_str); - future - } - - /// Return top players for each level. Level must be MASTER, GRANDMASTER or CHALLENGER. - /// # Parameters - /// * `route` - Route to query. - /// * `level` (required, in path) - /// * `challenge_id` (required, in path) - /// * `limit` (optional, in query) - /// # Riot Developer API Reference - /// `lol-challenges-v1.getChallengeLeaderboards` - /// - /// Note: this method is automatically generated. - pub fn get_challenge_leaderboards(&self, route: PlatformRoute, challenge_id: i64, level: crate::consts::Tier, limit: Option) - -> impl Future>>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/leaderboards/by-level/{}", challenge_id, level)); - let request = if let Some(limit) = limit { request.query(&[ ("limit", limit) ]) } else { request }; - let future = self.base.execute_opt::>("lol-challenges-v1.getChallengeLeaderboards", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengeLeaderboards", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-challenges-v1.getChallengeLeaderboards", route_str); - future - } - - /// Map of level to percentile of players who have achieved it - /// # Parameters - /// * `route` - Route to query. - /// * `challenge_id` (required, in path) - /// # Riot Developer API Reference - /// `lol-challenges-v1.getChallengePercentiles` - /// - /// Note: this method is automatically generated. - pub fn get_challenge_percentiles(&self, route: PlatformRoute, challenge_id: i64) - -> impl Future>>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/challenges/{}/percentiles", challenge_id)); - let future = self.base.execute_opt::>("lol-challenges-v1.getChallengePercentiles", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getChallengePercentiles", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-challenges-v1.getChallengePercentiles", route_str); - future - } - - /// Returns player information with list of all progressed challenges (REST) - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `lol-challenges-v1.getPlayerData` - /// - /// Note: this method is automatically generated. - pub fn get_player_data(&self, route: PlatformRoute, puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/challenges/v1/player-data/{}", puuid)); - let future = self.base.execute_val::("lol-challenges-v1.getPlayerData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-challenges-v1.getPlayerData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-challenges-v1.getPlayerData", route_str); - future - } - -} - -/// LolRsoMatchV1 endpoints handle, accessed by calling [`lol_rso_match_v1()`](RiotApi::lol_rso_match_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lol-rso-match-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LolRsoMatchV1<'a> { - base: &'a RiotApi, -} -impl<'a> LolRsoMatchV1<'a> { - /// Get a list of match ids by player access token - Includes custom matches - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// * `count` (optional, in query) - Defaults to 20. Valid values: 0 to 100. Number of match ids to return. - /// * `start` (optional, in query) - Defaults to 0. Start index. - /// * `type` (optional, in query) - Filter the list of match ids by the type of match. This filter is mutually inclusive of the queue filter meaning any match ids returned must match both the queue and type filters. - /// * `queue` (optional, in query) - Filter the list of match ids by a specific queue id. This filter is mutually inclusive of the type filter meaning any match ids returned must match both the queue and type filters. - /// * `end_time` (optional, in query) - Epoch timestamp in seconds. - /// * `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `lol-rso-match-v1.getMatchIds` - /// - /// Note: this method is automatically generated. - pub fn get_match_ids(&self, route: RegionalRoute, access_token: impl std::fmt::Display, count: Option, end_time: Option, queue: Option, start: Option, start_time: Option, r#type: Option<&str>) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/rso-match/v1/matches/ids"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request }; - let request = if let Some(end_time) = end_time { request.query(&[ ("endTime", end_time) ]) } else { request }; - let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; - let request = if let Some(start) = start { request.query(&[ ("start", start) ]) } else { request }; - let request = if let Some(start_time) = start_time { request.query(&[ ("startTime", start_time) ]) } else { request }; - let request = if let Some(r#type) = r#type { request.query(&[ ("type", r#type) ]) } else { request }; - let future = self.base.execute_val::>("lol-rso-match-v1.getMatchIds", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getMatchIds", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-rso-match-v1.getMatchIds", route_str); - future - } - - /// Get a match by match id - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// * `match_id` (required, in path) - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `lol-rso-match-v1.getMatch` - /// - /// Note: this method is automatically generated. - pub fn get_match(&self, route: RegionalRoute, access_token: impl std::fmt::Display, match_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/rso-match/v1/matches/{}", match_id)); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::("lol-rso-match-v1.getMatch", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getMatch", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-rso-match-v1.getMatch", route_str); - future - } - - /// Get a match timeline by match id - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// * `match_id` (required, in path) - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `lol-rso-match-v1.getTimeline` - /// - /// Note: this method is automatically generated. - pub fn get_timeline(&self, route: RegionalRoute, access_token: impl std::fmt::Display, match_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/rso-match/v1/matches/{}/timeline", match_id)); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::("lol-rso-match-v1.getTimeline", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-rso-match-v1.getTimeline", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-rso-match-v1.getTimeline", route_str); - future - } - -} - -/// LolStatusV4 endpoints handle, accessed by calling [`lol_status_v4()`](RiotApi::lol_status_v4) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lol-status-v4` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LolStatusV4<'a> { - base: &'a RiotApi, -} -impl<'a> LolStatusV4<'a> { - /// Get League of Legends status for the given platform. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `lol-status-v4.getPlatformData` - /// - /// Note: this method is automatically generated. - pub fn get_platform_data(&self, route: PlatformRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/status/v4/platform-data"); - let future = self.base.execute_val::("lol-status-v4.getPlatformData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lol-status-v4.getPlatformData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lol-status-v4.getPlatformData", route_str); - future - } - -} - -/// LorDeckV1 endpoints handle, accessed by calling [`lor_deck_v1()`](RiotApi::lor_deck_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lor-deck-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LorDeckV1<'a> { - base: &'a RiotApi, -} -impl<'a> LorDeckV1<'a> { - /// Get a list of the calling user's decks. - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `lor-deck-v1.getDecks` - /// - /// Note: this method is automatically generated. - pub fn get_decks(&self, route: RegionalRoute, access_token: impl std::fmt::Display) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lor/deck/v1/decks/me"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::>("lor-deck-v1.getDecks", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-deck-v1.getDecks", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-deck-v1.getDecks", route_str); - future - } - - /// Create a new deck for the calling user. - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `lor-deck-v1.createDeck` - /// - /// Note: this method is automatically generated. - pub fn create_deck(&self, route: RegionalRoute, access_token: impl std::fmt::Display, body: &crate::models::lor_deck_v1::NewDeck) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::POST, route_str, "/lor/deck/v1/decks/me"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let request = request - .body(serde_json::ser::to_vec(body).unwrap()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::("lor-deck-v1.createDeck", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-deck-v1.createDeck", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-deck-v1.createDeck", route_str); - future - } - -} - -/// LorInventoryV1 endpoints handle, accessed by calling [`lor_inventory_v1()`](RiotApi::lor_inventory_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lor-inventory-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LorInventoryV1<'a> { - base: &'a RiotApi, -} -impl<'a> LorInventoryV1<'a> { - /// Return a list of cards owned by the calling user. - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `lor-inventory-v1.getCards` - /// - /// Note: this method is automatically generated. - pub fn get_cards(&self, route: RegionalRoute, access_token: impl std::fmt::Display) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lor/inventory/v1/cards/me"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::>("lor-inventory-v1.getCards", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-inventory-v1.getCards", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-inventory-v1.getCards", route_str); - future - } - -} - -/// LorMatchV1 endpoints handle, accessed by calling [`lor_match_v1()`](RiotApi::lor_match_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lor-match-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LorMatchV1<'a> { - base: &'a RiotApi, -} -impl<'a> LorMatchV1<'a> { - /// Get a list of match ids by PUUID - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `lor-match-v1.getMatchIdsByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_match_ids_by_puuid(&self, route: RegionalRoute, puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lor/match/v1/matches/by-puuid/{}/ids", puuid)); - let future = self.base.execute_val::>("lor-match-v1.getMatchIdsByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-match-v1.getMatchIdsByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-match-v1.getMatchIdsByPUUID", route_str); - future - } - - /// Get match by id - /// # Parameters - /// * `route` - Route to query. - /// * `match_id` (required, in path) - /// # Riot Developer API Reference - /// `lor-match-v1.getMatch` - /// - /// Note: this method is automatically generated. - pub fn get_match(&self, route: RegionalRoute, match_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lor/match/v1/matches/{}", match_id)); - let future = self.base.execute_val::("lor-match-v1.getMatch", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-match-v1.getMatch", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-match-v1.getMatch", route_str); - future - } - -} - -/// LorRankedV1 endpoints handle, accessed by calling [`lor_ranked_v1()`](RiotApi::lor_ranked_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lor-ranked-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LorRankedV1<'a> { - base: &'a RiotApi, -} -impl<'a> LorRankedV1<'a> { - /// Get the players in Master tier. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `lor-ranked-v1.getLeaderboards` - /// - /// Note: this method is automatically generated. - pub fn get_leaderboards(&self, route: RegionalRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lor/ranked/v1/leaderboards"); - let future = self.base.execute_val::("lor-ranked-v1.getLeaderboards", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-ranked-v1.getLeaderboards", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-ranked-v1.getLeaderboards", route_str); - future - } - -} - -/// LorStatusV1 endpoints handle, accessed by calling [`lor_status_v1()`](RiotApi::lor_status_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `lor-status-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct LorStatusV1<'a> { - base: &'a RiotApi, -} -impl<'a> LorStatusV1<'a> { - /// Get Legends of Runeterra status for the given platform. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `lor-status-v1.getPlatformData` - /// - /// Note: this method is automatically generated. - pub fn get_platform_data(&self, route: RegionalRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lor/status/v1/platform-data"); - let future = self.base.execute_val::("lor-status-v1.getPlatformData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("lor-status-v1.getPlatformData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "lor-status-v1.getPlatformData", route_str); - future - } - -} - -/// MatchV5 endpoints handle, accessed by calling [`match_v5()`](RiotApi::match_v5) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `match-v5` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct MatchV5<'a> { - base: &'a RiotApi, -} -impl<'a> MatchV5<'a> { - /// Get a list of match ids by puuid - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// * `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set. - /// * `end_time` (optional, in query) - Epoch timestamp in seconds. - /// * `queue` (optional, in query) - Filter the list of match ids by a specific queue id. This filter is mutually inclusive of the type filter meaning any match ids returned must match both the queue and type filters. - /// * `type` (optional, in query) - Filter the list of match ids by the type of match. This filter is mutually inclusive of the queue filter meaning any match ids returned must match both the queue and type filters. - /// * `start` (optional, in query) - Defaults to 0. Start index. - /// * `count` (optional, in query) - Defaults to 20. Valid values: 0 to 100. Number of match ids to return. - /// # Riot Developer API Reference - /// `match-v5.getMatchIdsByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_match_ids_by_puuid(&self, route: RegionalRoute, puuid: &str, count: Option, end_time: Option, queue: Option, start_time: Option, start: Option, r#type: Option<&str>) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/match/v5/matches/by-puuid/{}/ids", puuid)); - let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request }; - let request = if let Some(end_time) = end_time { request.query(&[ ("endTime", end_time) ]) } else { request }; - let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; - let request = if let Some(start_time) = start_time { request.query(&[ ("startTime", start_time) ]) } else { request }; - let request = if let Some(start) = start { request.query(&[ ("start", start) ]) } else { request }; - let request = if let Some(r#type) = r#type { request.query(&[ ("type", r#type) ]) } else { request }; - let future = self.base.execute_val::>("match-v5.getMatchIdsByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("match-v5.getMatchIdsByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "match-v5.getMatchIdsByPUUID", route_str); - future - } - - /// Get a match by match id - /// # Parameters - /// * `route` - Route to query. - /// * `match_id` (required, in path) - /// # Riot Developer API Reference - /// `match-v5.getMatch` - /// - /// Note: this method is automatically generated. - pub fn get_match(&self, route: RegionalRoute, match_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/match/v5/matches/{}", match_id)); - let future = self.base.execute_opt::("match-v5.getMatch", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("match-v5.getMatch", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "match-v5.getMatch", route_str); - future - } - - /// Get a match timeline by match id - /// # Parameters - /// * `route` - Route to query. - /// * `match_id` (required, in path) - /// # Riot Developer API Reference - /// `match-v5.getTimeline` - /// - /// Note: this method is automatically generated. - pub fn get_timeline(&self, route: RegionalRoute, match_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/match/v5/matches/{}/timeline", match_id)); - let future = self.base.execute_opt::("match-v5.getTimeline", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("match-v5.getTimeline", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "match-v5.getTimeline", route_str); - future - } - -} - -/// SpectatorTftV5 endpoints handle, accessed by calling [`spectator_tft_v5()`](RiotApi::spectator_tft_v5) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `spectator-tft-v5` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct SpectatorTftV5<'a> { - base: &'a RiotApi, -} -impl<'a> SpectatorTftV5<'a> { - /// Get current game information for the given puuid. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - The puuid of the summoner. - /// # Riot Developer API Reference - /// `spectator-tft-v5.getCurrentGameInfoByPuuid` - /// - /// Note: this method is automatically generated. - pub fn get_current_game_info_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/spectator/tft/v5/active-games/by-puuid/{}", encrypted_puuid)); - let future = self.base.execute_opt::("spectator-tft-v5.getCurrentGameInfoByPuuid", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-tft-v5.getCurrentGameInfoByPuuid", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "spectator-tft-v5.getCurrentGameInfoByPuuid", route_str); - future - } - - /// Get list of featured games. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `spectator-tft-v5.getFeaturedGames` - /// - /// Note: this method is automatically generated. - pub fn get_featured_games(&self, route: PlatformRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/spectator/tft/v5/featured-games"); - let future = self.base.execute_val::("spectator-tft-v5.getFeaturedGames", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-tft-v5.getFeaturedGames", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "spectator-tft-v5.getFeaturedGames", route_str); - future - } - -} - -/// SpectatorV5 endpoints handle, accessed by calling [`spectator_v5()`](RiotApi::spectator_v5) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `spectator-v5` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct SpectatorV5<'a> { - base: &'a RiotApi, -} -impl<'a> SpectatorV5<'a> { - /// Get current game information for the given puuid. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - The puuid of the summoner. - /// # Riot Developer API Reference - /// `spectator-v5.getCurrentGameInfoByPuuid` - /// - /// Note: this method is automatically generated. - pub fn get_current_game_info_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/spectator/v5/active-games/by-summoner/{}", encrypted_puuid)); - let future = self.base.execute_opt::("spectator-v5.getCurrentGameInfoByPuuid", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-v5.getCurrentGameInfoByPuuid", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "spectator-v5.getCurrentGameInfoByPuuid", route_str); - future - } - - /// Get list of featured games. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `spectator-v5.getFeaturedGames` - /// - /// Note: this method is automatically generated. - pub fn get_featured_games(&self, route: PlatformRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/spectator/v5/featured-games"); - let future = self.base.execute_val::("spectator-v5.getFeaturedGames", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("spectator-v5.getFeaturedGames", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "spectator-v5.getFeaturedGames", route_str); - future - } - -} - -/// SummonerV4 endpoints handle, accessed by calling [`summoner_v4()`](RiotApi::summoner_v4) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `summoner-v4` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct SummonerV4<'a> { - base: &'a RiotApi, -} -impl<'a> SummonerV4<'a> { - /// Get a summoner by its RSO encrypted PUUID. - /// # Parameters - /// * `route` - Route to query. - /// * `rso_puuid` (required, in path) - Summoner ID - /// # Riot Developer API Reference - /// `summoner-v4.getByRSOPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_by_rsopuuid(&self, route: PlatformRoute, rso_puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/fulfillment/v1/summoners/by-puuid/{}", rso_puuid)); - let future = self.base.execute_val::("summoner-v4.getByRSOPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByRSOPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "summoner-v4.getByRSOPUUID", route_str); - future - } - - /// Get a summoner by account ID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_account_id` (required, in path) - /// # Riot Developer API Reference - /// `summoner-v4.getByAccountId` - /// - /// Note: this method is automatically generated. - pub fn get_by_account_id(&self, route: PlatformRoute, encrypted_account_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/summoner/v4/summoners/by-account/{}", encrypted_account_id)); - let future = self.base.execute_val::("summoner-v4.getByAccountId", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByAccountId", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "summoner-v4.getByAccountId", route_str); - future - } - - /// Get a summoner by PUUID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - Summoner ID - /// # Riot Developer API Reference - /// `summoner-v4.getByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/summoner/v4/summoners/by-puuid/{}", encrypted_puuid)); - let future = self.base.execute_val::("summoner-v4.getByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "summoner-v4.getByPUUID", route_str); - future - } - - /// Get a summoner by access token. - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `summoner-v4.getByAccessToken` - /// - /// Note: this method is automatically generated. - pub fn get_by_access_token(&self, route: PlatformRoute, access_token: impl std::fmt::Display) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/lol/summoner/v4/summoners/me"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::("summoner-v4.getByAccessToken", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getByAccessToken", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "summoner-v4.getByAccessToken", route_str); - future - } - - /// Get a summoner by summoner ID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_summoner_id` (required, in path) - Summoner ID - /// # Riot Developer API Reference - /// `summoner-v4.getBySummonerId` - /// - /// Note: this method is automatically generated. - pub fn get_by_summoner_id(&self, route: PlatformRoute, encrypted_summoner_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/summoner/v4/summoners/{}", encrypted_summoner_id)); - let future = self.base.execute_val::("summoner-v4.getBySummonerId", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("summoner-v4.getBySummonerId", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "summoner-v4.getBySummonerId", route_str); - future - } - -} - -/// TftLeagueV1 endpoints handle, accessed by calling [`tft_league_v1()`](RiotApi::tft_league_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `tft-league-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct TftLeagueV1<'a> { - base: &'a RiotApi, -} -impl<'a> TftLeagueV1<'a> { - /// Get the challenger league. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (optional, in query) - Defaults to RANKED_TFT. - /// # Riot Developer API Reference - /// `tft-league-v1.getChallengerLeague` - /// - /// Note: this method is automatically generated. - pub fn get_challenger_league(&self, route: PlatformRoute, queue: Option<&str>) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/tft/league/v1/challenger"); - let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; - let future = self.base.execute_val::("tft-league-v1.getChallengerLeague", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getChallengerLeague", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getChallengerLeague", route_str); - future - } - - /// Get league entries for a given summoner ID. - /// # Parameters - /// * `route` - Route to query. - /// * `summoner_id` (required, in path) - /// # Riot Developer API Reference - /// `tft-league-v1.getLeagueEntriesForSummoner` - /// - /// Note: this method is automatically generated. - pub fn get_league_entries_for_summoner(&self, route: PlatformRoute, summoner_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/entries/by-summoner/{}", summoner_id)); - let future = self.base.execute_val::>("tft-league-v1.getLeagueEntriesForSummoner", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueEntriesForSummoner", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getLeagueEntriesForSummoner", route_str); - future - } - - /// Get all the league entries. - /// # Parameters - /// * `route` - Route to query. - /// * `tier` (required, in path) - /// * `division` (required, in path) - /// * `queue` (optional, in query) - Defaults to RANKED_TFT. - /// * `page` (optional, in query) - Defaults to 1. Starts with page 1. - /// # Riot Developer API Reference - /// `tft-league-v1.getLeagueEntries` - /// - /// Note: this method is automatically generated. - pub fn get_league_entries(&self, route: PlatformRoute, tier: crate::consts::Tier, division: &str, page: Option, queue: Option<&str>) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/entries/{}/{}", tier, division)); - let request = if let Some(page) = page { request.query(&[ ("page", page) ]) } else { request }; - let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; - let future = self.base.execute_val::>("tft-league-v1.getLeagueEntries", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueEntries", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getLeagueEntries", route_str); - future - } - - /// Get the grandmaster league. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (optional, in query) - Defaults to RANKED_TFT. - /// # Riot Developer API Reference - /// `tft-league-v1.getGrandmasterLeague` - /// - /// Note: this method is automatically generated. - pub fn get_grandmaster_league(&self, route: PlatformRoute, queue: Option<&str>) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/tft/league/v1/grandmaster"); - let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; - let future = self.base.execute_val::("tft-league-v1.getGrandmasterLeague", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getGrandmasterLeague", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getGrandmasterLeague", route_str); - future - } - - /// Get league with given ID, including inactive entries. - /// # Parameters - /// * `route` - Route to query. - /// * `league_id` (required, in path) - The UUID of the league. - /// # Riot Developer API Reference - /// `tft-league-v1.getLeagueById` - /// - /// Note: this method is automatically generated. - pub fn get_league_by_id(&self, route: PlatformRoute, league_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/leagues/{}", league_id)); - let future = self.base.execute_opt::("tft-league-v1.getLeagueById", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getLeagueById", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getLeagueById", route_str); - future - } - - /// Get the master league. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (optional, in query) - Defaults to RANKED_TFT. - /// # Riot Developer API Reference - /// `tft-league-v1.getMasterLeague` - /// - /// Note: this method is automatically generated. - pub fn get_master_league(&self, route: PlatformRoute, queue: Option<&str>) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/tft/league/v1/master"); - let request = if let Some(queue) = queue { request.query(&[ ("queue", queue) ]) } else { request }; - let future = self.base.execute_val::("tft-league-v1.getMasterLeague", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getMasterLeague", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getMasterLeague", route_str); - future - } - - /// Get the top rated ladder for given queue - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - /// # Riot Developer API Reference - /// `tft-league-v1.getTopRatedLadder` - /// - /// Note: this method is automatically generated. - pub fn get_top_rated_ladder(&self, route: PlatformRoute, queue: crate::consts::QueueType) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/league/v1/rated-ladders/{}/top", queue)); - let future = self.base.execute_val::>("tft-league-v1.getTopRatedLadder", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-league-v1.getTopRatedLadder", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-league-v1.getTopRatedLadder", route_str); - future - } - -} - -/// TftMatchV1 endpoints handle, accessed by calling [`tft_match_v1()`](RiotApi::tft_match_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `tft-match-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct TftMatchV1<'a> { - base: &'a RiotApi, -} -impl<'a> TftMatchV1<'a> { - /// Get a list of match ids by PUUID - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// * `start` (optional, in query) - Defaults to 0. Start index. - /// * `end_time` (optional, in query) - Epoch timestamp in seconds. - /// * `start_time` (optional, in query) - Epoch timestamp in seconds. The matchlist started storing timestamps on June 16th, 2021. Any matches played before June 16th, 2021 won't be included in the results if the startTime filter is set. - /// * `count` (optional, in query) - Defaults to 20. Number of match ids to return. - /// # Riot Developer API Reference - /// `tft-match-v1.getMatchIdsByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_match_ids_by_puuid(&self, route: RegionalRoute, puuid: &str, count: Option, end_time: Option, start: Option, start_time: Option) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/match/v1/matches/by-puuid/{}/ids", puuid)); - let request = if let Some(count) = count { request.query(&[ ("count", count) ]) } else { request }; - let request = if let Some(end_time) = end_time { request.query(&[ ("endTime", end_time) ]) } else { request }; - let request = if let Some(start) = start { request.query(&[ ("start", start) ]) } else { request }; - let request = if let Some(start_time) = start_time { request.query(&[ ("startTime", start_time) ]) } else { request }; - let future = self.base.execute_val::>("tft-match-v1.getMatchIdsByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-match-v1.getMatchIdsByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-match-v1.getMatchIdsByPUUID", route_str); - future - } - - /// Get a match by match id - /// # Parameters - /// * `route` - Route to query. - /// * `match_id` (required, in path) - /// # Riot Developer API Reference - /// `tft-match-v1.getMatch` - /// - /// Note: this method is automatically generated. - pub fn get_match(&self, route: RegionalRoute, match_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/match/v1/matches/{}", match_id)); - let future = self.base.execute_opt::("tft-match-v1.getMatch", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-match-v1.getMatch", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-match-v1.getMatch", route_str); - future - } - -} - -/// TftStatusV1 endpoints handle, accessed by calling [`tft_status_v1()`](RiotApi::tft_status_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `tft-status-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct TftStatusV1<'a> { - base: &'a RiotApi, -} -impl<'a> TftStatusV1<'a> { - /// Get Teamfight Tactics status for the given platform. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `tft-status-v1.getPlatformData` - /// - /// Note: this method is automatically generated. - pub fn get_platform_data(&self, route: PlatformRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/tft/status/v1/platform-data"); - let future = self.base.execute_val::("tft-status-v1.getPlatformData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-status-v1.getPlatformData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-status-v1.getPlatformData", route_str); - future - } - -} - -/// TftSummonerV1 endpoints handle, accessed by calling [`tft_summoner_v1()`](RiotApi::tft_summoner_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `tft-summoner-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct TftSummonerV1<'a> { - base: &'a RiotApi, -} -impl<'a> TftSummonerV1<'a> { - /// Get a summoner by account ID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_account_id` (required, in path) - /// # Riot Developer API Reference - /// `tft-summoner-v1.getByAccountId` - /// - /// Note: this method is automatically generated. - pub fn get_by_account_id(&self, route: PlatformRoute, encrypted_account_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/summoner/v1/summoners/by-account/{}", encrypted_account_id)); - let future = self.base.execute_val::("tft-summoner-v1.getByAccountId", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByAccountId", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-summoner-v1.getByAccountId", route_str); - future - } - - /// Get a summoner by PUUID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_puuid` (required, in path) - Summoner ID - /// # Riot Developer API Reference - /// `tft-summoner-v1.getByPUUID` - /// - /// Note: this method is automatically generated. - pub fn get_by_puuid(&self, route: PlatformRoute, encrypted_puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/summoner/v1/summoners/by-puuid/{}", encrypted_puuid)); - let future = self.base.execute_val::("tft-summoner-v1.getByPUUID", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByPUUID", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-summoner-v1.getByPUUID", route_str); - future - } - - /// Get a summoner by access token. - /// # Parameters - /// * `route` - Route to query. - /// * `access_token` - RSO access token. - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. - /// # Riot Developer API Reference - /// `tft-summoner-v1.getByAccessToken` - /// - /// Note: this method is automatically generated. - pub fn get_by_access_token(&self, route: PlatformRoute, access_token: impl std::fmt::Display) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/tft/summoner/v1/summoners/me"); - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } - let future = self.base.execute_val::("tft-summoner-v1.getByAccessToken", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getByAccessToken", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-summoner-v1.getByAccessToken", route_str); - future - } - - /// Get a summoner by summoner ID. - /// # Parameters - /// * `route` - Route to query. - /// * `encrypted_summoner_id` (required, in path) - Summoner ID - /// # Riot Developer API Reference - /// `tft-summoner-v1.getBySummonerId` - /// - /// Note: this method is automatically generated. - pub fn get_by_summoner_id(&self, route: PlatformRoute, encrypted_summoner_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/tft/summoner/v1/summoners/{}", encrypted_summoner_id)); - let future = self.base.execute_val::("tft-summoner-v1.getBySummonerId", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tft-summoner-v1.getBySummonerId", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tft-summoner-v1.getBySummonerId", route_str); - future - } - -} - -/// TournamentStubV5 endpoints handle, accessed by calling [`tournament_stub_v5()`](RiotApi::tournament_stub_v5) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `tournament-stub-v5` -/// -/// 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 - /// `tournament-stub-v5.createTournamentCode` - /// - /// Note: this method is automatically generated. - pub fn create_tournament_code(&self, route: RegionalRoute, body: &crate::models::tournament_stub_v5::TournamentCodeParametersV5, tournament_id: i64, count: Option) - -> impl Future>> + '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()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::>("tournament-stub-v5.createTournamentCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.createTournamentCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-stub-v5.createTournamentCode", route_str); - 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 - /// `tournament-stub-v5.getTournamentCode` - /// - /// Note: this method is automatically generated. - pub fn get_tournament_code(&self, route: RegionalRoute, tournament_code: &str) - -> impl Future> + '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.getTournamentCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.getTournamentCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-stub-v5.getTournamentCode", route_str); - 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 - /// `tournament-stub-v5.getLobbyEventsByCode` - /// - /// Note: this method is automatically generated. - pub fn get_lobby_events_by_code(&self, route: RegionalRoute, tournament_code: &str) - -> impl Future> + '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.getLobbyEventsByCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.getLobbyEventsByCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-stub-v5.getLobbyEventsByCode", route_str); - 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 - /// `tournament-stub-v5.registerProviderData` - /// - /// Note: this method is automatically generated. - pub fn register_provider_data(&self, route: RegionalRoute, body: &crate::models::tournament_stub_v5::ProviderRegistrationParametersV5) - -> impl Future> + '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()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::("tournament-stub-v5.registerProviderData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerProviderData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-stub-v5.registerProviderData", route_str); - future - } - - /// Creates a tournament and returns its ID - Stub method - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `tournament-stub-v5.registerTournament` - /// - /// Note: this method is automatically generated. - pub fn register_tournament(&self, route: RegionalRoute, body: &crate::models::tournament_stub_v5::TournamentRegistrationParametersV5) - -> impl Future> + '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()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::("tournament-stub-v5.registerTournament", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-stub-v5.registerTournament", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-stub-v5.registerTournament", route_str); - future - } - -} - -/// TournamentV5 endpoints handle, accessed by calling [`tournament_v5()`](RiotApi::tournament_v5) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `tournament-v5` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct TournamentV5<'a> { - base: &'a RiotApi, -} -impl<'a> TournamentV5<'a> { - /// Create a tournament code for the given tournament. - /// # Parameters - /// * `route` - Route to query. - /// * `tournament_id` (required, in query) - The tournament ID - /// * `count` (optional, in query) - The number of codes to create (max 1000) - /// # Riot Developer API Reference - /// `tournament-v5.createTournamentCode` - /// - /// Note: this method is automatically generated. - pub fn create_tournament_code(&self, route: RegionalRoute, body: &crate::models::tournament_v5::TournamentCodeParametersV5, tournament_id: i64, count: Option) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::POST, route_str, "/lol/tournament/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()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::>("tournament-v5.createTournamentCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.createTournamentCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.createTournamentCode", route_str); - future - } - - /// Returns the tournament code DTO associated with a tournament code string. - /// # Parameters - /// * `route` - Route to query. - /// * `tournament_code` (required, in path) - The tournament code string. - /// # Riot Developer API Reference - /// `tournament-v5.getTournamentCode` - /// - /// Note: this method is automatically generated. - pub fn get_tournament_code(&self, route: RegionalRoute, tournament_code: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/codes/{}", tournament_code)); - let future = self.base.execute_val::("tournament-v5.getTournamentCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.getTournamentCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.getTournamentCode", route_str); - future - } - - /// Update the pick type, map, spectator type, or allowed puuids for a code. - /// # Parameters - /// * `route` - Route to query. - /// * `tournament_code` (required, in path) - The tournament code to update - /// # Riot Developer API Reference - /// `tournament-v5.updateCode` - /// - /// Note: this method is automatically generated. - pub fn update_code(&self, route: RegionalRoute, body: &crate::models::tournament_v5::TournamentCodeUpdateParametersV5, tournament_code: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::PUT, route_str, &format!("/lol/tournament/v5/codes/{}", tournament_code)); - let request = request - .body(serde_json::ser::to_vec(body).unwrap()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute("tournament-v5.updateCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.updateCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.updateCode", route_str); - future - } - - /// Get games details - /// ## Implementation Notes - /// Additional endpoint to get tournament games. From this endpoint, you are able to get participants PUUID (the callback doesn't contain this info). - /// - /// You can also use it to check if the game was recorded and validate callbacks. If the endpoint returns the game, it means a callback was attempted. - /// - /// This will only work for tournament codes created after November 10, 2023. - /// # Parameters - /// * `route` - Route to query. - /// * `tournament_code` (required, in path) - /// # Riot Developer API Reference - /// `tournament-v5.getGames` - /// - /// Note: this method is automatically generated. - pub fn get_games(&self, route: RegionalRoute, tournament_code: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/games/by-code/{}", tournament_code)); - let future = self.base.execute_val::>("tournament-v5.getGames", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.getGames", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.getGames", route_str); - future - } - - /// Gets a list of lobby events by tournament code. - /// # Parameters - /// * `route` - Route to query. - /// * `tournament_code` (required, in path) - The short code to look up lobby events for - /// # Riot Developer API Reference - /// `tournament-v5.getLobbyEventsByCode` - /// - /// Note: this method is automatically generated. - pub fn get_lobby_events_by_code(&self, route: RegionalRoute, tournament_code: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/lol/tournament/v5/lobby-events/by-code/{}", tournament_code)); - let future = self.base.execute_val::("tournament-v5.getLobbyEventsByCode", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.getLobbyEventsByCode", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.getLobbyEventsByCode", route_str); - future - } - - /// Creates a tournament provider and returns its ID. - /// ## 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 - /// `tournament-v5.registerProviderData` - /// - /// Note: this method is automatically generated. - pub fn register_provider_data(&self, route: RegionalRoute, body: &crate::models::tournament_v5::ProviderRegistrationParametersV5) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::POST, route_str, "/lol/tournament/v5/providers"); - let request = request - .body(serde_json::ser::to_vec(body).unwrap()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::("tournament-v5.registerProviderData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.registerProviderData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.registerProviderData", route_str); - future - } - - /// Creates a tournament and returns its ID. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `tournament-v5.registerTournament` - /// - /// Note: this method is automatically generated. - pub fn register_tournament(&self, route: RegionalRoute, body: &crate::models::tournament_v5::TournamentRegistrationParametersV5) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::POST, route_str, "/lol/tournament/v5/tournaments"); - let request = request - .body(serde_json::ser::to_vec(body).unwrap()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); - let future = self.base.execute_val::("tournament-v5.registerTournament", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("tournament-v5.registerTournament", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "tournament-v5.registerTournament", route_str); - future - } - -} - -/// ValConsoleMatchV1 endpoints handle, accessed by calling [`val_console_match_v1()`](RiotApi::val_console_match_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `val-console-match-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ValConsoleMatchV1<'a> { - base: &'a RiotApi, -} -impl<'a> ValConsoleMatchV1<'a> { - /// Get match by id - /// # Parameters - /// * `route` - Route to query. - /// * `match_id` (required, in path) - /// # Riot Developer API Reference - /// `val-console-match-v1.getMatch` - /// - /// Note: this method is automatically generated. - pub fn get_match(&self, route: ValPlatformRoute, match_id: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/match/console/v1/matches/{}", match_id)); - let future = self.base.execute_val::("val-console-match-v1.getMatch", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-match-v1.getMatch", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-console-match-v1.getMatch", route_str); - future - } - - /// Get matchlist for games played by puuid and platform type - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// * `platform_type` (required, in query) - /// # Riot Developer API Reference - /// `val-console-match-v1.getMatchlist` - /// - /// Note: this method is automatically generated. - pub fn get_matchlist(&self, route: ValPlatformRoute, puuid: &str, platform_type: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/match/console/v1/matchlists/by-puuid/{}", puuid)); - let request = request.query(&[ ("platformType", platform_type) ]); - let future = self.base.execute_val::("val-console-match-v1.getMatchlist", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-match-v1.getMatchlist", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-console-match-v1.getMatchlist", route_str); - future - } - - /// Get recent matches - /// ## Implementation Notes - /// Returns a list of match ids that have completed in the last 10 minutes for live regions and 12 hours for the esports routing value. NA/LATAM/BR share a match history deployment. As such, recent matches will return a combined list of matches from those three regions. Requests are load balanced so you may see some inconsistencies as matches are added/removed from the list. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - /// # Riot Developer API Reference - /// `val-console-match-v1.getRecent` - /// - /// Note: this method is automatically generated. - pub fn get_recent(&self, route: ValPlatformRoute, queue: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/match/console/v1/recent-matches/by-queue/{}", queue)); - let future = self.base.execute_val::("val-console-match-v1.getRecent", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-match-v1.getRecent", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-console-match-v1.getRecent", route_str); - future - } - -} - -/// ValConsoleRankedV1 endpoints handle, accessed by calling [`val_console_ranked_v1()`](RiotApi::val_console_ranked_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `val-console-ranked-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ValConsoleRankedV1<'a> { - base: &'a RiotApi, -} -impl<'a> ValConsoleRankedV1<'a> { - /// Get leaderboard for the competitive queue - /// # Parameters - /// * `route` - Route to query. - /// * `act_id` (required, in path) - Act ids can be found using the val-content API. - /// * `platform_type` (required, in query) - /// * `start_index` (optional, in query) - Defaults to 0. - /// * `size` (optional, in query) - Defaults to 200. Valid values: 1 to 200. - /// # Riot Developer API Reference - /// `val-console-ranked-v1.getLeaderboard` - /// - /// Note: this method is automatically generated. - pub fn get_leaderboard(&self, route: ValPlatformRoute, act_id: &str, platform_type: &str, size: Option, start_index: Option) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/console/ranked/v1/leaderboards/by-act/{}", act_id)); - let request = request.query(&[ ("platformType", platform_type) ]); - let request = if let Some(size) = size { request.query(&[ ("size", size) ]) } else { request }; - let request = if let Some(start_index) = start_index { request.query(&[ ("startIndex", start_index) ]) } else { request }; - let future = self.base.execute_val::("val-console-ranked-v1.getLeaderboard", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-console-ranked-v1.getLeaderboard", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-console-ranked-v1.getLeaderboard", route_str); - future - } - -} - -/// ValContentV1 endpoints handle, accessed by calling [`val_content_v1()`](RiotApi::val_content_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `val-content-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ValContentV1<'a> { - base: &'a RiotApi, -} -impl<'a> ValContentV1<'a> { - /// Get content optionally filtered by locale - /// # Parameters - /// * `route` - Route to query. - /// * `locale` (optional, in query) - /// # Riot Developer API Reference - /// `val-content-v1.getContent` - /// - /// Note: this method is automatically generated. - pub fn get_content(&self, route: ValPlatformRoute, locale: Option<&str>) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/val/content/v1/contents"); - let request = if let Some(locale) = locale { request.query(&[ ("locale", locale) ]) } else { request }; - let future = self.base.execute_val::("val-content-v1.getContent", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-content-v1.getContent", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-content-v1.getContent", route_str); - future - } - -} - -/// ValMatchV1 endpoints handle, accessed by calling [`val_match_v1()`](RiotApi::val_match_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `val-match-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ValMatchV1<'a> { - base: &'a RiotApi, -} -impl<'a> ValMatchV1<'a> { - /// Get match by id - /// # Parameters - /// * `route` - Route to query. - /// * `match_id` (required, in path) - /// # Riot Developer API Reference - /// `val-match-v1.getMatch` - /// - /// Note: this method is automatically generated. - pub fn get_match(&self, route: ValPlatformRoute, match_id: &str) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/match/v1/matches/{}", match_id)); - let future = self.base.execute_opt::("val-match-v1.getMatch", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-match-v1.getMatch", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-match-v1.getMatch", route_str); - future - } - - /// Get matchlist for games played by puuid - /// # Parameters - /// * `route` - Route to query. - /// * `puuid` (required, in path) - /// # Riot Developer API Reference - /// `val-match-v1.getMatchlist` - /// - /// Note: this method is automatically generated. - pub fn get_matchlist(&self, route: ValPlatformRoute, puuid: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/match/v1/matchlists/by-puuid/{}", puuid)); - let future = self.base.execute_val::("val-match-v1.getMatchlist", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-match-v1.getMatchlist", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-match-v1.getMatchlist", route_str); - future - } - - /// Get recent matches - /// ## Implementation Notes - /// Returns a list of match ids that have completed in the last 10 minutes for live regions and 12 hours for the esports routing value. NA/LATAM/BR share a match history deployment. As such, recent matches will return a combined list of matches from those three regions. Requests are load balanced so you may see some inconsistencies as matches are added/removed from the list. - /// # Parameters - /// * `route` - Route to query. - /// * `queue` (required, in path) - /// # Riot Developer API Reference - /// `val-match-v1.getRecent` - /// - /// Note: this method is automatically generated. - pub fn get_recent(&self, route: ValPlatformRoute, queue: &str) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/match/v1/recent-matches/by-queue/{}", queue)); - let future = self.base.execute_val::("val-match-v1.getRecent", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-match-v1.getRecent", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-match-v1.getRecent", route_str); - future - } - -} - -/// ValRankedV1 endpoints handle, accessed by calling [`val_ranked_v1()`](RiotApi::val_ranked_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `val-ranked-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ValRankedV1<'a> { - base: &'a RiotApi, -} -impl<'a> ValRankedV1<'a> { - /// Get leaderboard for the competitive queue - /// # Parameters - /// * `route` - Route to query. - /// * `act_id` (required, in path) - Act ids can be found using the val-content API. - /// * `size` (optional, in query) - Defaults to 200. Valid values: 1 to 200. - /// * `start_index` (optional, in query) - Defaults to 0. - /// # Riot Developer API Reference - /// `val-ranked-v1.getLeaderboard` - /// - /// Note: this method is automatically generated. - pub fn get_leaderboard(&self, route: ValPlatformRoute, act_id: &str, size: Option, start_index: Option) - -> impl Future>> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, &format!("/val/ranked/v1/leaderboards/by-act/{}", act_id)); - let request = if let Some(size) = size { request.query(&[ ("size", size) ]) } else { request }; - let request = if let Some(start_index) = start_index { request.query(&[ ("startIndex", start_index) ]) } else { request }; - let future = self.base.execute_opt::("val-ranked-v1.getLeaderboard", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-ranked-v1.getLeaderboard", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-ranked-v1.getLeaderboard", route_str); - future - } - -} - -/// ValStatusV1 endpoints handle, accessed by calling [`val_status_v1()`](RiotApi::val_status_v1) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `val-status-v1` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct ValStatusV1<'a> { - base: &'a RiotApi, -} -impl<'a> ValStatusV1<'a> { - /// Get VALORANT status for the given platform. - /// # Parameters - /// * `route` - Route to query. - /// # Riot Developer API Reference - /// `val-status-v1.getPlatformData` - /// - /// Note: this method is automatically generated. - pub fn get_platform_data(&self, route: ValPlatformRoute) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::GET, route_str, "/val/status/v1/platform-data"); - let future = self.base.execute_val::("val-status-v1.getPlatformData", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("val-status-v1.getPlatformData", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "val-status-v1.getPlatformData", route_str); - future - } - -} +include_autogen!("endpoints.gen.rs"); diff --git a/riven/src/lib.rs b/riven/src/lib.rs index 635c6ef8..f932420f 100644 --- a/riven/src/lib.rs +++ b/riven/src/lib.rs @@ -7,6 +7,9 @@ pub use eserde; pub use {reqwest, serde, serde_json}; +#[macro_use] +mod macros; + mod config; pub use config::RiotApiConfig; pub mod consts; diff --git a/riven/src/consts/macros.rs b/riven/src/macros.rs similarity index 94% rename from riven/src/consts/macros.rs rename to riven/src/macros.rs index 34de3f45..2c405f5a 100644 --- a/riven/src/consts/macros.rs +++ b/riven/src/macros.rs @@ -1,5 +1,3 @@ -#![macro_use] - /// Macro for deriving `Serialize` and `Deserialize` for string enums with an /// `UNKNOWN(String)` variant. /// @@ -88,8 +86,9 @@ macro_rules! arr { /// ``` macro_rules! newtype_enum { { + #[repr($repr:ident)] $( #[$attr:meta] )* - $v:vis newtype_enum $name:ident($repr:ty) { + $v:vis enum $name:ident { $( $( #[$var_attr:meta] )* $var_name:ident = $var_val:expr, @@ -205,3 +204,13 @@ macro_rules! impl_edeserialize { )* }; } + +/// Include the given file from `OUT_DIR` if the `riven_autogen_outdir` feature is enabled, otherwise from the current dir. +macro_rules! include_autogen { + ($file:literal) => { + #[cfg(riven_autogen_outdir)] + include!(concat!(env!("OUT_DIR"), "/", $file)); + #[cfg(not(riven_autogen_outdir))] + include!($file); + }; +} diff --git a/riven/src/meta.gen.rs b/riven/src/meta.gen.rs new file mode 100644 index 00000000..bbdc15e2 --- /dev/null +++ b/riven/src/meta.gen.rs @@ -0,0 +1,316 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +use reqwest::Method; +/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains +/// the HTTP [`Method`], `str` path, and the method's `str` ID. +pub static ALL_ENDPOINTS: [(Method, &str, &str); 87usize] = [ + (Method::GET, "/riot/account/v1/accounts/by-puuid/{puuid}", "account-v1.getByPuuid"), + ( + Method::GET, + "/riot/account/v1/accounts/by-riot-id/{gameName}/{tagLine}", + "account-v1.getByRiotId", + ), + (Method::GET, "/riot/account/v1/accounts/me", "account-v1.getByAccessToken"), + ( + Method::GET, + "/riot/account/v1/active-shards/by-game/{game}/by-puuid/{puuid}", + "account-v1.getActiveShard", + ), + ( + Method::GET, + "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}", + "champion-mastery-v4.getAllChampionMasteriesByPUUID", + ), + ( + Method::GET, + "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/by-champion/{championId}", + "champion-mastery-v4.getChampionMasteryByPUUID", + ), + ( + Method::GET, + "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/top", + "champion-mastery-v4.getTopChampionMasteriesByPUUID", + ), + ( + Method::GET, + "/lol/champion-mastery/v4/scores/by-puuid/{encryptedPUUID}", + "champion-mastery-v4.getChampionMasteryScoreByPUUID", + ), + (Method::GET, "/lol/platform/v3/champion-rotations", "champion-v3.getChampionInfo"), + ( + Method::GET, + "/lol/clash/v1/players/by-puuid/{puuid}", + "clash-v1.getPlayersByPUUID", + ), + (Method::GET, "/lol/clash/v1/teams/{teamId}", "clash-v1.getTeamById"), + (Method::GET, "/lol/clash/v1/tournaments", "clash-v1.getTournaments"), + ( + Method::GET, + "/lol/clash/v1/tournaments/by-team/{teamId}", + "clash-v1.getTournamentByTeam", + ), + ( + Method::GET, + "/lol/clash/v1/tournaments/{tournamentId}", + "clash-v1.getTournamentById", + ), + ( + Method::GET, + "/lol/league-exp/v4/entries/{queue}/{tier}/{division}", + "league-exp-v4.getLeagueEntries", + ), + ( + Method::GET, + "/lol/league/v4/challengerleagues/by-queue/{queue}", + "league-v4.getChallengerLeague", + ), + ( + Method::GET, + "/lol/league/v4/entries/by-puuid/{encryptedPUUID}", + "league-v4.getLeagueEntriesByPUUID", + ), + ( + Method::GET, + "/lol/league/v4/entries/by-summoner/{encryptedSummonerId}", + "league-v4.getLeagueEntriesForSummoner", + ), + ( + Method::GET, + "/lol/league/v4/entries/{queue}/{tier}/{division}", + "league-v4.getLeagueEntries", + ), + ( + Method::GET, + "/lol/league/v4/grandmasterleagues/by-queue/{queue}", + "league-v4.getGrandmasterLeague", + ), + (Method::GET, "/lol/league/v4/leagues/{leagueId}", "league-v4.getLeagueById"), + ( + Method::GET, + "/lol/league/v4/masterleagues/by-queue/{queue}", + "league-v4.getMasterLeague", + ), + ( + Method::GET, + "/lol/challenges/v1/challenges/config", + "lol-challenges-v1.getAllChallengeConfigs", + ), + ( + Method::GET, + "/lol/challenges/v1/challenges/percentiles", + "lol-challenges-v1.getAllChallengePercentiles", + ), + ( + Method::GET, + "/lol/challenges/v1/challenges/{challengeId}/config", + "lol-challenges-v1.getChallengeConfigs", + ), + ( + Method::GET, + "/lol/challenges/v1/challenges/{challengeId}/leaderboards/by-level/{level}", + "lol-challenges-v1.getChallengeLeaderboards", + ), + ( + Method::GET, + "/lol/challenges/v1/challenges/{challengeId}/percentiles", + "lol-challenges-v1.getChallengePercentiles", + ), + ( + Method::GET, + "/lol/challenges/v1/player-data/{puuid}", + "lol-challenges-v1.getPlayerData", + ), + (Method::GET, "/lol/rso-match/v1/matches/ids", "lol-rso-match-v1.getMatchIds"), + (Method::GET, "/lol/rso-match/v1/matches/{matchId}", "lol-rso-match-v1.getMatch"), + ( + Method::GET, + "/lol/rso-match/v1/matches/{matchId}/timeline", + "lol-rso-match-v1.getTimeline", + ), + (Method::GET, "/lol/status/v4/platform-data", "lol-status-v4.getPlatformData"), + (Method::GET, "/lor/deck/v1/decks/me", "lor-deck-v1.getDecks"), + (Method::POST, "/lor/deck/v1/decks/me", "lor-deck-v1.createDeck"), + (Method::GET, "/lor/inventory/v1/cards/me", "lor-inventory-v1.getCards"), + ( + Method::GET, + "/lor/match/v1/matches/by-puuid/{puuid}/ids", + "lor-match-v1.getMatchIdsByPUUID", + ), + (Method::GET, "/lor/match/v1/matches/{matchId}", "lor-match-v1.getMatch"), + (Method::GET, "/lor/ranked/v1/leaderboards", "lor-ranked-v1.getLeaderboards"), + (Method::GET, "/lor/status/v1/platform-data", "lor-status-v1.getPlatformData"), + ( + Method::GET, + "/lol/match/v5/matches/by-puuid/{puuid}/ids", + "match-v5.getMatchIdsByPUUID", + ), + (Method::GET, "/lol/match/v5/matches/{matchId}", "match-v5.getMatch"), + (Method::GET, "/lol/match/v5/matches/{matchId}/timeline", "match-v5.getTimeline"), + ( + Method::GET, + "/lol/spectator/tft/v5/active-games/by-puuid/{encryptedPUUID}", + "spectator-tft-v5.getCurrentGameInfoByPuuid", + ), + ( + Method::GET, + "/lol/spectator/tft/v5/featured-games", + "spectator-tft-v5.getFeaturedGames", + ), + ( + Method::GET, + "/lol/spectator/v5/active-games/by-summoner/{encryptedPUUID}", + "spectator-v5.getCurrentGameInfoByPuuid", + ), + (Method::GET, "/lol/spectator/v5/featured-games", "spectator-v5.getFeaturedGames"), + ( + Method::GET, + "/fulfillment/v1/summoners/by-puuid/{rsoPUUID}", + "summoner-v4.getByRSOPUUID", + ), + ( + Method::GET, + "/lol/summoner/v4/summoners/by-account/{encryptedAccountId}", + "summoner-v4.getByAccountId", + ), + ( + Method::GET, + "/lol/summoner/v4/summoners/by-puuid/{encryptedPUUID}", + "summoner-v4.getByPUUID", + ), + (Method::GET, "/lol/summoner/v4/summoners/me", "summoner-v4.getByAccessToken"), + ( + Method::GET, + "/lol/summoner/v4/summoners/{encryptedSummonerId}", + "summoner-v4.getBySummonerId", + ), + (Method::GET, "/tft/league/v1/challenger", "tft-league-v1.getChallengerLeague"), + ( + Method::GET, + "/tft/league/v1/entries/by-summoner/{summonerId}", + "tft-league-v1.getLeagueEntriesForSummoner", + ), + ( + Method::GET, + "/tft/league/v1/entries/{tier}/{division}", + "tft-league-v1.getLeagueEntries", + ), + (Method::GET, "/tft/league/v1/grandmaster", "tft-league-v1.getGrandmasterLeague"), + (Method::GET, "/tft/league/v1/leagues/{leagueId}", "tft-league-v1.getLeagueById"), + (Method::GET, "/tft/league/v1/master", "tft-league-v1.getMasterLeague"), + ( + Method::GET, + "/tft/league/v1/rated-ladders/{queue}/top", + "tft-league-v1.getTopRatedLadder", + ), + ( + Method::GET, + "/tft/match/v1/matches/by-puuid/{puuid}/ids", + "tft-match-v1.getMatchIdsByPUUID", + ), + (Method::GET, "/tft/match/v1/matches/{matchId}", "tft-match-v1.getMatch"), + (Method::GET, "/tft/status/v1/platform-data", "tft-status-v1.getPlatformData"), + ( + Method::GET, + "/tft/summoner/v1/summoners/by-account/{encryptedAccountId}", + "tft-summoner-v1.getByAccountId", + ), + ( + Method::GET, + "/tft/summoner/v1/summoners/by-puuid/{encryptedPUUID}", + "tft-summoner-v1.getByPUUID", + ), + (Method::GET, "/tft/summoner/v1/summoners/me", "tft-summoner-v1.getByAccessToken"), + ( + Method::GET, + "/tft/summoner/v1/summoners/{encryptedSummonerId}", + "tft-summoner-v1.getBySummonerId", + ), + ( + Method::POST, + "/lol/tournament-stub/v5/codes", + "tournament-stub-v5.createTournamentCode", + ), + ( + Method::GET, + "/lol/tournament-stub/v5/codes/{tournamentCode}", + "tournament-stub-v5.getTournamentCode", + ), + ( + Method::GET, + "/lol/tournament-stub/v5/lobby-events/by-code/{tournamentCode}", + "tournament-stub-v5.getLobbyEventsByCode", + ), + ( + Method::POST, + "/lol/tournament-stub/v5/providers", + "tournament-stub-v5.registerProviderData", + ), + ( + Method::POST, + "/lol/tournament-stub/v5/tournaments", + "tournament-stub-v5.registerTournament", + ), + (Method::POST, "/lol/tournament/v5/codes", "tournament-v5.createTournamentCode"), + ( + Method::GET, + "/lol/tournament/v5/codes/{tournamentCode}", + "tournament-v5.getTournamentCode", + ), + ( + Method::PUT, + "/lol/tournament/v5/codes/{tournamentCode}", + "tournament-v5.updateCode", + ), + ( + Method::GET, + "/lol/tournament/v5/games/by-code/{tournamentCode}", + "tournament-v5.getGames", + ), + ( + Method::GET, + "/lol/tournament/v5/lobby-events/by-code/{tournamentCode}", + "tournament-v5.getLobbyEventsByCode", + ), + (Method::POST, "/lol/tournament/v5/providers", "tournament-v5.registerProviderData"), + (Method::POST, "/lol/tournament/v5/tournaments", "tournament-v5.registerTournament"), + ( + Method::GET, + "/val/match/console/v1/matches/{matchId}", + "val-console-match-v1.getMatch", + ), + ( + Method::GET, + "/val/match/console/v1/matchlists/by-puuid/{puuid}", + "val-console-match-v1.getMatchlist", + ), + ( + Method::GET, + "/val/match/console/v1/recent-matches/by-queue/{queue}", + "val-console-match-v1.getRecent", + ), + ( + Method::GET, + "/val/console/ranked/v1/leaderboards/by-act/{actId}", + "val-console-ranked-v1.getLeaderboard", + ), + (Method::GET, "/val/content/v1/contents", "val-content-v1.getContent"), + (Method::GET, "/val/match/v1/matches/{matchId}", "val-match-v1.getMatch"), + ( + Method::GET, + "/val/match/v1/matchlists/by-puuid/{puuid}", + "val-match-v1.getMatchlist", + ), + ( + Method::GET, + "/val/match/v1/recent-matches/by-queue/{queue}", + "val-match-v1.getRecent", + ), + ( + Method::GET, + "/val/ranked/v1/leaderboards/by-act/{actId}", + "val-ranked-v1.getLeaderboard", + ), + (Method::GET, "/val/status/v1/platform-data", "val-status-v1.getPlatformData"), +]; + diff --git a/riven/src/meta.rs b/riven/src/meta.rs index 8f76815a..3b611393 100644 --- a/riven/src/meta.rs +++ b/riven/src/meta.rs @@ -1,107 +1,3 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -// http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 996d171a2b79e9bb85c549f47b07c6ef2721fc8a - //! Metadata about the Riot API and Riven. -//! -//! Note: this modules is automatically generated. -/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains -/// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID. -pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); 87] = [ - (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/me", "account-v1.getByAccessToken"), - (reqwest::Method::GET, "/riot/account/v1/active-shards/by-game/{game}/by-puuid/{puuid}", "account-v1.getActiveShard"), - (reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}", "champion-mastery-v4.getAllChampionMasteriesByPUUID"), - (reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/by-champion/{championId}", "champion-mastery-v4.getChampionMasteryByPUUID"), - (reqwest::Method::GET, "/lol/champion-mastery/v4/champion-masteries/by-puuid/{encryptedPUUID}/top", "champion-mastery-v4.getTopChampionMasteriesByPUUID"), - (reqwest::Method::GET, "/lol/champion-mastery/v4/scores/by-puuid/{encryptedPUUID}", "champion-mastery-v4.getChampionMasteryScoreByPUUID"), - (reqwest::Method::GET, "/lol/platform/v3/champion-rotations", "champion-v3.getChampionInfo"), - (reqwest::Method::GET, "/lol/clash/v1/players/by-puuid/{puuid}", "clash-v1.getPlayersByPUUID"), - (reqwest::Method::GET, "/lol/clash/v1/teams/{teamId}", "clash-v1.getTeamById"), - (reqwest::Method::GET, "/lol/clash/v1/tournaments", "clash-v1.getTournaments"), - (reqwest::Method::GET, "/lol/clash/v1/tournaments/by-team/{teamId}", "clash-v1.getTournamentByTeam"), - (reqwest::Method::GET, "/lol/clash/v1/tournaments/{tournamentId}", "clash-v1.getTournamentById"), - (reqwest::Method::GET, "/lol/league-exp/v4/entries/{queue}/{tier}/{division}", "league-exp-v4.getLeagueEntries"), - (reqwest::Method::GET, "/lol/league/v4/challengerleagues/by-queue/{queue}", "league-v4.getChallengerLeague"), - (reqwest::Method::GET, "/lol/league/v4/entries/by-puuid/{encryptedPUUID}", "league-v4.getLeagueEntriesByPUUID"), - (reqwest::Method::GET, "/lol/league/v4/entries/by-summoner/{encryptedSummonerId}", "league-v4.getLeagueEntriesForSummoner"), - (reqwest::Method::GET, "/lol/league/v4/entries/{queue}/{tier}/{division}", "league-v4.getLeagueEntries"), - (reqwest::Method::GET, "/lol/league/v4/grandmasterleagues/by-queue/{queue}", "league-v4.getGrandmasterLeague"), - (reqwest::Method::GET, "/lol/league/v4/leagues/{leagueId}", "league-v4.getLeagueById"), - (reqwest::Method::GET, "/lol/league/v4/masterleagues/by-queue/{queue}", "league-v4.getMasterLeague"), - (reqwest::Method::GET, "/lol/challenges/v1/challenges/config", "lol-challenges-v1.getAllChallengeConfigs"), - (reqwest::Method::GET, "/lol/challenges/v1/challenges/percentiles", "lol-challenges-v1.getAllChallengePercentiles"), - (reqwest::Method::GET, "/lol/challenges/v1/challenges/{challengeId}/config", "lol-challenges-v1.getChallengeConfigs"), - (reqwest::Method::GET, "/lol/challenges/v1/challenges/{challengeId}/leaderboards/by-level/{level}", "lol-challenges-v1.getChallengeLeaderboards"), - (reqwest::Method::GET, "/lol/challenges/v1/challenges/{challengeId}/percentiles", "lol-challenges-v1.getChallengePercentiles"), - (reqwest::Method::GET, "/lol/challenges/v1/player-data/{puuid}", "lol-challenges-v1.getPlayerData"), - (reqwest::Method::GET, "/lol/rso-match/v1/matches/ids", "lol-rso-match-v1.getMatchIds"), - (reqwest::Method::GET, "/lol/rso-match/v1/matches/{matchId}", "lol-rso-match-v1.getMatch"), - (reqwest::Method::GET, "/lol/rso-match/v1/matches/{matchId}/timeline", "lol-rso-match-v1.getTimeline"), - (reqwest::Method::GET, "/lol/status/v4/platform-data", "lol-status-v4.getPlatformData"), - (reqwest::Method::GET, "/lor/deck/v1/decks/me", "lor-deck-v1.getDecks"), - (reqwest::Method::POST, "/lor/deck/v1/decks/me", "lor-deck-v1.createDeck"), - (reqwest::Method::GET, "/lor/inventory/v1/cards/me", "lor-inventory-v1.getCards"), - (reqwest::Method::GET, "/lor/match/v1/matches/by-puuid/{puuid}/ids", "lor-match-v1.getMatchIdsByPUUID"), - (reqwest::Method::GET, "/lor/match/v1/matches/{matchId}", "lor-match-v1.getMatch"), - (reqwest::Method::GET, "/lor/ranked/v1/leaderboards", "lor-ranked-v1.getLeaderboards"), - (reqwest::Method::GET, "/lor/status/v1/platform-data", "lor-status-v1.getPlatformData"), - (reqwest::Method::GET, "/lol/match/v5/matches/by-puuid/{puuid}/ids", "match-v5.getMatchIdsByPUUID"), - (reqwest::Method::GET, "/lol/match/v5/matches/{matchId}", "match-v5.getMatch"), - (reqwest::Method::GET, "/lol/match/v5/matches/{matchId}/timeline", "match-v5.getTimeline"), - (reqwest::Method::GET, "/lol/spectator/tft/v5/active-games/by-puuid/{encryptedPUUID}", "spectator-tft-v5.getCurrentGameInfoByPuuid"), - (reqwest::Method::GET, "/lol/spectator/tft/v5/featured-games", "spectator-tft-v5.getFeaturedGames"), - (reqwest::Method::GET, "/lol/spectator/v5/active-games/by-summoner/{encryptedPUUID}", "spectator-v5.getCurrentGameInfoByPuuid"), - (reqwest::Method::GET, "/lol/spectator/v5/featured-games", "spectator-v5.getFeaturedGames"), - (reqwest::Method::GET, "/fulfillment/v1/summoners/by-puuid/{rsoPUUID}", "summoner-v4.getByRSOPUUID"), - (reqwest::Method::GET, "/lol/summoner/v4/summoners/by-account/{encryptedAccountId}", "summoner-v4.getByAccountId"), - (reqwest::Method::GET, "/lol/summoner/v4/summoners/by-puuid/{encryptedPUUID}", "summoner-v4.getByPUUID"), - (reqwest::Method::GET, "/lol/summoner/v4/summoners/me", "summoner-v4.getByAccessToken"), - (reqwest::Method::GET, "/lol/summoner/v4/summoners/{encryptedSummonerId}", "summoner-v4.getBySummonerId"), - (reqwest::Method::GET, "/tft/league/v1/challenger", "tft-league-v1.getChallengerLeague"), - (reqwest::Method::GET, "/tft/league/v1/entries/by-summoner/{summonerId}", "tft-league-v1.getLeagueEntriesForSummoner"), - (reqwest::Method::GET, "/tft/league/v1/entries/{tier}/{division}", "tft-league-v1.getLeagueEntries"), - (reqwest::Method::GET, "/tft/league/v1/grandmaster", "tft-league-v1.getGrandmasterLeague"), - (reqwest::Method::GET, "/tft/league/v1/leagues/{leagueId}", "tft-league-v1.getLeagueById"), - (reqwest::Method::GET, "/tft/league/v1/master", "tft-league-v1.getMasterLeague"), - (reqwest::Method::GET, "/tft/league/v1/rated-ladders/{queue}/top", "tft-league-v1.getTopRatedLadder"), - (reqwest::Method::GET, "/tft/match/v1/matches/by-puuid/{puuid}/ids", "tft-match-v1.getMatchIdsByPUUID"), - (reqwest::Method::GET, "/tft/match/v1/matches/{matchId}", "tft-match-v1.getMatch"), - (reqwest::Method::GET, "/tft/status/v1/platform-data", "tft-status-v1.getPlatformData"), - (reqwest::Method::GET, "/tft/summoner/v1/summoners/by-account/{encryptedAccountId}", "tft-summoner-v1.getByAccountId"), - (reqwest::Method::GET, "/tft/summoner/v1/summoners/by-puuid/{encryptedPUUID}", "tft-summoner-v1.getByPUUID"), - (reqwest::Method::GET, "/tft/summoner/v1/summoners/me", "tft-summoner-v1.getByAccessToken"), - (reqwest::Method::GET, "/tft/summoner/v1/summoners/{encryptedSummonerId}", "tft-summoner-v1.getBySummonerId"), - (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/v5/codes", "tournament-v5.createTournamentCode"), - (reqwest::Method::GET, "/lol/tournament/v5/codes/{tournamentCode}", "tournament-v5.getTournamentCode"), - (reqwest::Method::PUT, "/lol/tournament/v5/codes/{tournamentCode}", "tournament-v5.updateCode"), - (reqwest::Method::GET, "/lol/tournament/v5/games/by-code/{tournamentCode}", "tournament-v5.getGames"), - (reqwest::Method::GET, "/lol/tournament/v5/lobby-events/by-code/{tournamentCode}", "tournament-v5.getLobbyEventsByCode"), - (reqwest::Method::POST, "/lol/tournament/v5/providers", "tournament-v5.registerProviderData"), - (reqwest::Method::POST, "/lol/tournament/v5/tournaments", "tournament-v5.registerTournament"), - (reqwest::Method::GET, "/val/match/console/v1/matches/{matchId}", "val-console-match-v1.getMatch"), - (reqwest::Method::GET, "/val/match/console/v1/matchlists/by-puuid/{puuid}", "val-console-match-v1.getMatchlist"), - (reqwest::Method::GET, "/val/match/console/v1/recent-matches/by-queue/{queue}", "val-console-match-v1.getRecent"), - (reqwest::Method::GET, "/val/console/ranked/v1/leaderboards/by-act/{actId}", "val-console-ranked-v1.getLeaderboard"), - (reqwest::Method::GET, "/val/content/v1/contents", "val-content-v1.getContent"), - (reqwest::Method::GET, "/val/match/v1/matches/{matchId}", "val-match-v1.getMatch"), - (reqwest::Method::GET, "/val/match/v1/matchlists/by-puuid/{puuid}", "val-match-v1.getMatchlist"), - (reqwest::Method::GET, "/val/match/v1/recent-matches/by-queue/{queue}", "val-match-v1.getRecent"), - (reqwest::Method::GET, "/val/ranked/v1/leaderboards/by-act/{actId}", "val-ranked-v1.getLeaderboard"), - (reqwest::Method::GET, "/val/status/v1/platform-data", "val-status-v1.getPlatformData"), -]; +include_autogen!("meta.gen.rs"); diff --git a/riven/src/models.gen.rs b/riven/src/models.gen.rs new file mode 100644 index 00000000..2d3031eb --- /dev/null +++ b/riven/src/models.gen.rs @@ -0,0 +1,5995 @@ +// http://www.mingweisamuel.com/riotapi-schema/tool/ +// Version: 996d171a2b79e9bb85c549f47b07c6ef2721fc8a + +///Data structs used by [`AccountV1`](crate::endpoints::AccountV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod account_v1 { + ///`account-v1.AccountDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Account { + #[serde(rename = "puuid")] + pub puuid: String, + ///This field may be excluded from the response if the account doesn't have a gameName. + #[serde(rename = "gameName", default, skip_serializing_if = "Option::is_none")] + pub game_name: Option, + ///This field may be excluded from the response if the account doesn't have a tagLine. + #[serde(rename = "tagLine", default, skip_serializing_if = "Option::is_none")] + pub tag_line: Option, + } + ///`account-v1.ActiveShardDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ActiveShard { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "game")] + pub game: String, + #[serde(rename = "activeShard")] + pub active_shard: String, + } +} +///Data structs used by [`ChampionMasteryV4`](crate::endpoints::ChampionMasteryV4) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod champion_mastery_v4 { + ///`champion-mastery-v4.ChampionMasteryDto` data object. + /// + ///# Description + ///This object contains single Champion Mastery information for player and champion combination. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ChampionMastery { + ///Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) + #[serde(rename = "puuid")] + pub puuid: String, + ///Number of points needed to achieve next level. Zero if player reached maximum champion level for this champion. + #[serde(rename = "championPointsUntilNextLevel")] + pub champion_points_until_next_level: i64, + ///Is chest granted for this champion or not in current season. + #[serde( + rename = "chestGranted", + default, + skip_serializing_if = "Option::is_none" + )] + pub chest_granted: Option, + ///Champion ID for this entry. + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + ///Last time this champion was played by this player - in Unix milliseconds time format. + #[serde(rename = "lastPlayTime")] + pub last_play_time: i64, + ///Champion level for specified player and champion combination. + #[serde(rename = "championLevel")] + pub champion_level: i32, + ///Total number of champion points for this player and champion combination - they are used to determine championLevel. + #[serde(rename = "championPoints")] + pub champion_points: i32, + ///Number of points earned since current level has been achieved. + #[serde(rename = "championPointsSinceLastLevel")] + pub champion_points_since_last_level: i64, + #[serde(rename = "markRequiredForNextLevel")] + pub mark_required_for_next_level: i32, + #[serde(rename = "championSeasonMilestone")] + pub champion_season_milestone: i32, + #[serde(rename = "nextSeasonMilestone")] + pub next_season_milestone: crate::models::champion_mastery_v4::NextSeasonMilestones, + ///The token earned for this champion at the current championLevel. When the championLevel is advanced the tokensEarned resets to 0. + #[serde(rename = "tokensEarned")] + pub tokens_earned: i32, + #[serde( + rename = "milestoneGrades", + default, + skip_serializing_if = "Option::is_none" + )] + pub milestone_grades: Option>, + } + ///`champion-mastery-v4.NextSeasonMilestonesDto` data object. + /// + ///# Description + ///This object contains required next season milestone information. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct NextSeasonMilestones { + #[serde(rename = "requireGradeCounts")] + pub require_grade_counts: ::std::collections::HashMap, + ///Reward marks. + #[serde(rename = "rewardMarks")] + pub reward_marks: i32, + ///Bonus. + #[serde(rename = "bonus")] + pub bonus: bool, + #[serde( + rename = "rewardConfig", + default, + skip_serializing_if = "Option::is_none" + )] + pub reward_config: Option, + #[serde(rename = "totalGamesRequires")] + pub total_games_requires: i32, + } + ///`champion-mastery-v4.RewardConfigDto` data object. + /// + ///# Description + ///This object contains required reward config information. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct RewardConfig { + ///Reward value + #[serde(rename = "rewardValue")] + pub reward_value: String, + ///Reward type + #[serde(rename = "rewardType")] + pub reward_type: String, + ///Maximun reward + #[serde(rename = "maximumReward")] + pub maximum_reward: i32, + } +} +///Data structs used by [`ChampionV3`](crate::endpoints::ChampionV3) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod champion_v3 { + ///`champion-v3.ChampionInfo` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ChampionInfo { + #[serde(rename = "maxNewPlayerLevel")] + pub max_new_player_level: i32, + #[serde(rename = "freeChampionIdsForNewPlayers")] + pub free_champion_ids_for_new_players: Vec, + #[serde(rename = "freeChampionIds")] + pub free_champion_ids: Vec, + } +} +///Data structs used by [`ClashV1`](crate::endpoints::ClashV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod clash_v1 { + ///`clash-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Player { + #[serde(rename = "summonerId")] + pub summoner_id: String, + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option, + ///(Legal values: UNSELECTED, FILL, TOP, JUNGLE, MIDDLE, BOTTOM, UTILITY) + #[serde(rename = "position")] + pub position: String, + ///(Legal values: CAPTAIN, MEMBER) + #[serde(rename = "role")] + pub role: String, + } + ///`clash-v1.TeamDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Team { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "tournamentId")] + pub tournament_id: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "iconId")] + pub icon_id: i32, + #[serde(rename = "tier")] + pub tier: i32, + ///Summoner ID of the team captain. + #[serde(rename = "captain")] + pub captain: String, + #[serde(rename = "abbreviation")] + pub abbreviation: String, + ///Team members. + #[serde(rename = "players")] + pub players: Vec, + } + ///`clash-v1.TournamentDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Tournament { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "themeId")] + pub theme_id: i32, + #[serde(rename = "nameKey")] + pub name_key: String, + #[serde(rename = "nameKeySecondary")] + pub name_key_secondary: String, + ///Tournament phase. + #[serde(rename = "schedule")] + pub schedule: Vec, + } + ///`clash-v1.TournamentPhaseDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TournamentPhase { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "registrationTime")] + pub registration_time: i64, + #[serde(rename = "startTime")] + pub start_time: i64, + #[serde(rename = "cancelled")] + pub cancelled: bool, + } +} +///Data structs used by [`LeagueExpV4`](crate::endpoints::LeagueExpV4) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod league_exp_v4 { + ///`league-exp-v4.LeagueEntryDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueEntry { + #[serde(rename = "leagueId")] + pub league_id: String, + ///Player's summonerId (Encrypted) + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///Player's encrypted puuid. + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "queueType")] + pub queue_type: crate::consts::QueueType, + #[serde(rename = "tier")] + pub tier: crate::consts::Tier, + ///The player's division within a tier. + #[serde(rename = "rank")] + pub rank: crate::consts::Division, + #[serde(rename = "leaguePoints")] + pub league_points: i32, + ///Winning team on Summoners Rift. First placement in Teamfight Tactics. + #[serde(rename = "wins")] + pub wins: i32, + ///Losing team on Summoners Rift. Second through eighth placement in Teamfight Tactics. + #[serde(rename = "losses")] + pub losses: i32, + #[serde(rename = "hotStreak")] + pub hot_streak: bool, + #[serde(rename = "veteran")] + pub veteran: bool, + #[serde(rename = "freshBlood")] + pub fresh_blood: bool, + #[serde(rename = "inactive")] + pub inactive: bool, + #[serde(rename = "miniSeries", default, skip_serializing_if = "Option::is_none")] + pub mini_series: Option, + } + ///`league-exp-v4.MiniSeriesDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MiniSeries { + #[serde(rename = "losses")] + pub losses: i32, + #[serde(rename = "progress")] + pub progress: String, + #[serde(rename = "target")] + pub target: i32, + #[serde(rename = "wins")] + pub wins: i32, + } +} +///Data structs used by [`LeagueV4`](crate::endpoints::LeagueV4) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod league_v4 { + ///`league-v4.LeagueListDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueList { + #[serde(rename = "leagueId", default, skip_serializing_if = "Option::is_none")] + pub league_id: Option, + #[serde(rename = "entries")] + pub entries: Vec, + #[serde(rename = "tier")] + pub tier: crate::consts::Tier, + #[serde(rename = "name", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "queue", default, skip_serializing_if = "Option::is_none")] + pub queue: Option, + } + ///`league-v4.LeagueItemDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueItem { + #[serde(rename = "freshBlood")] + pub fresh_blood: bool, + ///Winning team on Summoners Rift. + #[serde(rename = "wins")] + pub wins: i32, + #[serde(rename = "miniSeries", default, skip_serializing_if = "Option::is_none")] + pub mini_series: Option, + #[serde(rename = "inactive")] + pub inactive: bool, + #[serde(rename = "veteran")] + pub veteran: bool, + #[serde(rename = "hotStreak")] + pub hot_streak: bool, + #[serde(rename = "rank")] + pub rank: crate::consts::Division, + #[serde(rename = "leaguePoints")] + pub league_points: i32, + ///Losing team on Summoners Rift. + #[serde(rename = "losses")] + pub losses: i32, + ///Player's encrypted summonerId. + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///Player's encrypted puuid. + #[serde(rename = "puuid")] + pub puuid: String, + } + ///`league-v4.MiniSeriesDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MiniSeries { + #[serde(rename = "losses")] + pub losses: i32, + #[serde(rename = "progress")] + pub progress: String, + #[serde(rename = "target")] + pub target: i32, + #[serde(rename = "wins")] + pub wins: i32, + } + ///`league-v4.LeagueEntryDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueEntry { + #[serde(rename = "leagueId", default, skip_serializing_if = "Option::is_none")] + pub league_id: Option, + ///Player's encrypted summonerId. + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///Player's encrypted puuid. + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "queueType")] + pub queue_type: crate::consts::QueueType, + #[serde(rename = "tier", default, skip_serializing_if = "Option::is_none")] + pub tier: Option, + ///The player's division within a tier. + #[serde(rename = "rank", default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + #[serde(rename = "leaguePoints")] + pub league_points: i32, + ///Winning team on Summoners Rift. + #[serde(rename = "wins")] + pub wins: i32, + ///Losing team on Summoners Rift. + #[serde(rename = "losses")] + pub losses: i32, + #[serde(rename = "hotStreak")] + pub hot_streak: bool, + #[serde(rename = "veteran")] + pub veteran: bool, + #[serde(rename = "freshBlood")] + pub fresh_blood: bool, + #[serde(rename = "inactive")] + pub inactive: bool, + #[serde(rename = "miniSeries", default, skip_serializing_if = "Option::is_none")] + pub mini_series: Option, + } +} +///Data structs used by [`LolChallengesV1`](crate::endpoints::LolChallengesV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lol_challenges_v1 { + ///`lol-challenges-v1.ChallengeConfigInfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ChallengeConfigInfo { + #[serde(rename = "id")] + pub id: i64, + #[serde(rename = "localizedNames")] + pub localized_names: ::std::collections::HashMap< + String, + ::std::collections::HashMap, + >, + ///DISABLED - not visible and not calculated, HIDDEN - not visible, but calculated, ENABLED - visible and calculated, ARCHIVED - visible, but not calculated + #[serde(rename = "state")] + pub state: String, + ///LIFETIME - stats are incremented without reset, SEASON - stats are accumulated by season and reset at the beginning of new season + #[serde(rename = "tracking", default, skip_serializing_if = "Option::is_none")] + pub tracking: Option, + #[serde( + rename = "startTimestamp", + default, + skip_serializing_if = "Option::is_none" + )] + pub start_timestamp: Option, + #[serde( + rename = "endTimestamp", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_timestamp: Option, + #[serde(rename = "leaderboard")] + pub leaderboard: bool, + #[serde(rename = "thresholds")] + pub thresholds: ::std::collections::HashMap, + } + ///`lol-challenges-v1.State` data object. + /// + ///# Description + ///DISABLED - not visible and not calculated, + ///HIDDEN - not visible, but calculated, + ///ENABLED - visible and calculated, + ///ARCHIVED - visible, but not calculated + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct State {} + ///`lol-challenges-v1.Tracking` data object. + /// + ///# Description + ///LIFETIME - stats are incremented without reset, + ///SEASON - stats are accumulated by season and reset at the beginning of new season + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Tracking {} + ///`lol-challenges-v1.ApexPlayerInfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ApexPlayerInfo { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "value")] + pub value: f64, + #[serde(rename = "position")] + pub position: i32, + } + ///`lol-challenges-v1.Level` data object. + /// + ///# Description + ///0 NONE, + ///1 IRON, + ///2 BRONZE, + ///3 SILVER, + ///4 GOLD, + ///5 PLATINUM, + ///6 DIAMOND, + ///7 MASTER, + ///8 GRANDMASTER, + ///9 CHALLENGER + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Level {} + ///`lol-challenges-v1.PlayerInfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerInfo { + #[serde(rename = "challenges")] + pub challenges: Vec, + #[serde(rename = "preferences")] + pub preferences: crate::models::lol_challenges_v1::PlayerClientPreferences, + #[serde(rename = "totalPoints")] + pub total_points: crate::models::lol_challenges_v1::ChallengePoints, + #[serde(rename = "categoryPoints")] + pub category_points: ::std::collections::HashMap< + String, + crate::models::lol_challenges_v1::ChallengePoints, + >, + } + ///`lol-challenges-v1.ChallengeInfo` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ChallengeInfo { + #[serde(rename = "challengeId")] + pub challenge_id: i64, + #[serde(rename = "percentile")] + pub percentile: f64, + #[serde(rename = "level")] + pub level: crate::consts::Tier, + #[serde(rename = "value")] + pub value: f64, + #[serde( + rename = "achievedTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub achieved_time: Option, + #[serde(rename = "position", default, skip_serializing_if = "Option::is_none")] + pub position: Option, + #[serde( + rename = "playersInLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub players_in_level: Option, + } + ///`lol-challenges-v1.PlayerClientPreferences` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerClientPreferences { + #[serde( + rename = "bannerAccent", + default, + skip_serializing_if = "Option::is_none" + )] + pub banner_accent: Option, + #[serde(rename = "title", default, skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde( + rename = "challengeIds", + default, + skip_serializing_if = "Option::is_none" + )] + pub challenge_ids: Option>, + #[serde( + rename = "crestBorder", + default, + skip_serializing_if = "Option::is_none" + )] + pub crest_border: Option, + #[serde( + rename = "prestigeCrestBorderLevel", + default, + skip_serializing_if = "Option::is_none" + )] + pub prestige_crest_border_level: Option, + } + ///`lol-challenges-v1.ChallengePoints` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ChallengePoints { + #[serde(rename = "level")] + pub level: crate::consts::Tier, + #[serde(rename = "current")] + pub current: i64, + #[serde(rename = "max")] + pub max: i64, + #[serde(rename = "percentile", default, skip_serializing_if = "Option::is_none")] + pub percentile: Option, + } +} +///Data structs used by [`LolRsoMatchV1`](crate::endpoints::LolRsoMatchV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lol_rso_match_v1 { + ///`lol-rso-match-v1.MatchDto` data object. + /// + ///# Description + ///UNKNOWN TYPE. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Match {} + ///`lol-rso-match-v1.TimelineDto` data object. + /// + ///# Description + ///UNKNOWN TYPE. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Timeline {} +} +///Data structs used by [`LolStatusV4`](crate::endpoints::LolStatusV4) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lol_status_v4 { + ///`lol-status-v4.PlatformDataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlatformData { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "locales")] + pub locales: Vec, + #[serde(rename = "maintenances")] + pub maintenances: Vec, + #[serde(rename = "incidents")] + pub incidents: Vec, + } + ///`lol-status-v4.StatusDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Status { + #[serde(rename = "id")] + pub id: i32, + ///(Legal values: scheduled, in_progress, complete) + #[serde( + rename = "maintenance_status", + default, + skip_serializing_if = "Option::is_none" + )] + pub maintenance_status: Option, + ///(Legal values: info, warning, critical) + #[serde( + rename = "incident_severity", + default, + skip_serializing_if = "Option::is_none" + )] + pub incident_severity: Option, + #[serde(rename = "titles")] + pub titles: Vec, + #[serde(rename = "updates")] + pub updates: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "archive_at", default, skip_serializing_if = "Option::is_none")] + pub archive_at: Option, + #[serde(rename = "updated_at", default, skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + ///(Legal values: windows, macos, android, ios, ps4, xbone, switch) + #[serde(rename = "platforms")] + pub platforms: Vec, + } + ///`lol-status-v4.ContentDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Content { + #[serde(rename = "locale")] + pub locale: String, + #[serde(rename = "content")] + pub content: String, + } + ///`lol-status-v4.UpdateDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Update { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "author")] + pub author: String, + #[serde(rename = "publish")] + pub publish: bool, + ///(Legal values: riotclient, riotstatus, game) + #[serde(rename = "publish_locations")] + pub publish_locations: Vec, + #[serde(rename = "translations")] + pub translations: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + } +} +///Data structs used by [`LorDeckV1`](crate::endpoints::LorDeckV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lor_deck_v1 { + ///`lor-deck-v1.DeckDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Deck { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "code")] + pub code: String, + } + ///`lor-deck-v1.NewDeckDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct NewDeck { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "code")] + pub code: String, + } +} +///Data structs used by [`LorInventoryV1`](crate::endpoints::LorInventoryV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lor_inventory_v1 { + ///`lor-inventory-v1.CardDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Card { + #[serde(rename = "code")] + pub code: String, + #[serde(rename = "count")] + pub count: String, + } +} +///Data structs used by [`LorMatchV1`](crate::endpoints::LorMatchV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lor_match_v1 { + ///`lor-match-v1.MatchDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Match { + #[serde(rename = "metadata")] + pub metadata: crate::models::lor_match_v1::Metadata, + #[serde(rename = "info")] + pub info: crate::models::lor_match_v1::Info, + } + ///`lor-match-v1.MetadataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + 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 participant PUUIDs. + #[serde(rename = "participants")] + pub participants: Vec, + } + ///`lor-match-v1.InfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + 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, + ///(Legal values: standard, eternal) + #[serde(rename = "game_format")] + pub game_format: String, + #[serde(rename = "players")] + pub players: Vec, + ///Total turns taken by both players. + #[serde(rename = "total_turn_count")] + pub total_turn_count: i32, + } + ///`lor-match-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + 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: 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 item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lor_ranked_v1 { + ///`lor-ranked-v1.LeaderboardDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Leaderboard { + ///A list of players in Master tier. + #[serde(rename = "players")] + pub players: Vec, + } + ///`lor-ranked-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Player { + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "rank")] + pub rank: i32, + ///League points. + #[serde(rename = "lp")] + pub lp: i32, + } +} +///Data structs used by [`LorStatusV1`](crate::endpoints::LorStatusV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod lor_status_v1 { + ///`lor-status-v1.PlatformDataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlatformData { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "locales")] + pub locales: Vec, + #[serde(rename = "maintenances")] + pub maintenances: Vec, + #[serde(rename = "incidents")] + pub incidents: Vec, + } + ///`lor-status-v1.StatusDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Status { + #[serde(rename = "id")] + pub id: i32, + ///(Legal values: scheduled, in_progress, complete) + #[serde(rename = "maintenance_status")] + pub maintenance_status: String, + ///(Legal values: info, warning, critical) + #[serde(rename = "incident_severity")] + pub incident_severity: String, + #[serde(rename = "titles")] + pub titles: Vec, + #[serde(rename = "updates")] + pub updates: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "archive_at")] + pub archive_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + ///(Legal values: windows, macos, android, ios, ps4, xbone, switch) + #[serde(rename = "platforms")] + pub platforms: Vec, + } + ///`lor-status-v1.ContentDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Content { + #[serde(rename = "locale")] + pub locale: String, + #[serde(rename = "content")] + pub content: String, + } + ///`lor-status-v1.UpdateDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Update { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "author")] + pub author: String, + #[serde(rename = "publish")] + pub publish: bool, + ///(Legal values: riotclient, riotstatus, game) + #[serde(rename = "publish_locations")] + pub publish_locations: Vec, + #[serde(rename = "translations")] + pub translations: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + } +} +///Data structs used by [`MatchV5`](crate::endpoints::MatchV5) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod match_v5 { + ///`match-v5.MatchDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Match { + #[serde(rename = "metadata")] + pub metadata: crate::models::match_v5::Metadata, + #[serde(rename = "info")] + pub info: crate::models::match_v5::Info, + } + ///`match-v5.MetadataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Metadata { + ///Match data version. + #[serde(rename = "dataVersion")] + pub data_version: String, + ///Match id. + #[serde(rename = "matchId")] + pub match_id: String, + ///A list of participant PUUIDs. + #[serde(rename = "participants")] + pub participants: Vec, + } + ///`match-v5.InfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Info { + ///Refer to indicate if the game ended in termination. + #[serde( + rename = "endOfGameResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_of_game_result: Option, + ///Unix timestamp for when the game is created on the game server (i.e., the loading screen). + #[serde(rename = "gameCreation")] + pub game_creation: i64, + ///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", + default, + skip_serializing_if = "Option::is_none" + )] + pub game_end_timestamp: Option, + #[serde(rename = "gameId")] + pub game_id: i64, + ///Refer to the Game Constants documentation. + #[serde(rename = "gameMode")] + pub game_mode: crate::consts::GameMode, + #[serde(rename = "gameName")] + pub game_name: String, + ///Unix timestamp for when match starts on the game server. + #[serde(rename = "gameStartTimestamp")] + pub game_start_timestamp: i64, + /// + ///Will be `None` if empty string is returned: + #[serde( + rename = "gameType", + serialize_with = "crate::consts::serialize_empty_string_none", + deserialize_with = "crate::consts::deserialize_empty_string_none" + )] + pub game_type: Option, + ///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: crate::consts::Map, + #[serde(rename = "participants")] + pub participants: Vec, + ///Platform where the match was played. + #[serde(rename = "platformId")] + pub platform_id: String, + ///Refer to the Game Constants documentation. + #[serde(rename = "queueId")] + pub queue_id: crate::consts::Queue, + #[serde(rename = "teams")] + pub teams: Vec, + ///Tournament code used to generate the match. This field was added to match-v5 in patch 11.13 on June 23rd, 2021. + #[serde( + rename = "tournamentCode", + default, + skip_serializing_if = "Option::is_none" + )] + pub tournament_code: Option, + } + ///`match-v5.ParticipantDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Participant { + ///Yellow crossed swords + #[serde(rename = "allInPings", default, skip_serializing_if = "Option::is_none")] + pub all_in_pings: Option, + ///Green flag + #[serde( + rename = "assistMePings", + default, + skip_serializing_if = "Option::is_none" + )] + pub assist_me_pings: Option, + #[serde(rename = "assists")] + pub assists: i32, + #[serde(rename = "baronKills")] + pub baron_kills: i32, + #[serde(rename = "bountyLevel")] + pub bounty_level: i32, + #[serde(rename = "champExperience")] + pub champ_experience: i32, + #[serde(rename = "champLevel")] + pub champ_level: i32, + ///Prior to patch 11.4, on Feb 18th, 2021, this field returned invalid championIds. We recommend determining the champion based on the championName field for matches played prior to patch 11.4. + /// + ///Instead use [`Self::champion()`] which checks this field then parses [`Self::champion_name`]. + /// + #[deprecated( + since = "2.5.0", + note = "Use `Participant.champion()` instead. Riot sometimes returns corrupted data for this field: https://github.com/RiotGames/developer-relations/issues/553" + )] + #[serde( + rename = "championId", + serialize_with = "crate::consts::Champion::serialize_result", + deserialize_with = "crate::consts::Champion::deserialize_result" + )] + pub champion_id: Result, + #[serde(rename = "championName")] + pub champion_name: String, + ///Blue generic ping (ALT+click) + #[serde( + rename = "commandPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub command_pings: Option, + ///This field is currently only utilized for Kayn's transformations. (Legal values: 0 - None, 1 - Slayer, 2 - Assassin) + #[serde(rename = "championTransform")] + pub champion_transform: i32, + #[serde(rename = "consumablesPurchased")] + pub consumables_purchased: i32, + #[serde(rename = "challenges", default, skip_serializing_if = "Option::is_none")] + pub challenges: Option, + #[serde( + rename = "damageDealtToBuildings", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_dealt_to_buildings: Option, + #[serde(rename = "damageDealtToObjectives")] + pub damage_dealt_to_objectives: i32, + #[serde(rename = "damageDealtToTurrets")] + pub damage_dealt_to_turrets: i32, + #[serde(rename = "damageSelfMitigated")] + pub damage_self_mitigated: i32, + #[serde(rename = "deaths")] + pub deaths: i32, + #[serde(rename = "detectorWardsPlaced")] + pub detector_wards_placed: i32, + #[serde(rename = "doubleKills")] + pub double_kills: i32, + #[serde(rename = "dragonKills")] + pub dragon_kills: i32, + #[serde( + rename = "eligibleForProgression", + default, + skip_serializing_if = "Option::is_none" + )] + pub eligible_for_progression: Option, + ///Yellow questionmark + #[serde( + rename = "enemyMissingPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub enemy_missing_pings: Option, + ///Red eyeball + #[serde( + rename = "enemyVisionPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub enemy_vision_pings: Option, + #[serde(rename = "firstBloodAssist")] + pub first_blood_assist: bool, + #[serde(rename = "firstBloodKill")] + pub first_blood_kill: bool, + #[serde(rename = "firstTowerAssist")] + pub first_tower_assist: bool, + #[serde(rename = "firstTowerKill")] + pub first_tower_kill: bool, + ///This is an offshoot of the OneStone challenge. The code checks if a spell with the same instance ID does the final point of damage to at least 2 Champions. It doesn't matter if they're enemies, but you cannot hurt your friends. + #[serde(rename = "gameEndedInEarlySurrender")] + pub game_ended_in_early_surrender: bool, + #[serde(rename = "gameEndedInSurrender")] + pub game_ended_in_surrender: bool, + #[serde(rename = "holdPings", default, skip_serializing_if = "Option::is_none")] + pub hold_pings: Option, + ///Yellow circle with horizontal line + #[serde( + rename = "getBackPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub get_back_pings: Option, + #[serde(rename = "goldEarned")] + pub gold_earned: i32, + #[serde(rename = "goldSpent")] + pub gold_spent: i32, + ///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 = "individualPosition")] + pub individual_position: String, + #[serde(rename = "inhibitorKills")] + pub inhibitor_kills: i32, + #[serde( + rename = "inhibitorTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub inhibitor_takedowns: Option, + #[serde( + rename = "inhibitorsLost", + default, + skip_serializing_if = "Option::is_none" + )] + pub inhibitors_lost: Option, + #[serde(rename = "item0")] + pub item0: i32, + #[serde(rename = "item1")] + pub item1: i32, + #[serde(rename = "item2")] + pub item2: i32, + #[serde(rename = "item3")] + pub item3: i32, + #[serde(rename = "item4")] + pub item4: i32, + #[serde(rename = "item5")] + pub item5: i32, + #[serde(rename = "item6")] + pub item6: i32, + #[serde(rename = "itemsPurchased")] + pub items_purchased: i32, + #[serde(rename = "killingSprees")] + pub killing_sprees: i32, + #[serde(rename = "kills")] + pub kills: i32, + #[serde(rename = "lane")] + pub lane: String, + #[serde(rename = "largestCriticalStrike")] + pub largest_critical_strike: i32, + #[serde(rename = "largestKillingSpree")] + pub largest_killing_spree: i32, + #[serde(rename = "largestMultiKill")] + pub largest_multi_kill: i32, + #[serde(rename = "longestTimeSpentLiving")] + pub longest_time_spent_living: i32, + #[serde(rename = "magicDamageDealt")] + pub magic_damage_dealt: i32, + #[serde(rename = "magicDamageDealtToChampions")] + pub magic_damage_dealt_to_champions: i32, + #[serde(rename = "magicDamageTaken")] + pub magic_damage_taken: i32, + #[serde(rename = "missions", default, skip_serializing_if = "Option::is_none")] + pub missions: Option, + ///neutralMinionsKilled = mNeutralMinionsKilled, which is incremented on kills of kPet and kJungleMonster + #[serde(rename = "neutralMinionsKilled")] + pub neutral_minions_killed: i32, + ///Green ward + #[serde( + rename = "needVisionPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub need_vision_pings: Option, + #[serde(rename = "nexusKills")] + pub nexus_kills: i32, + #[serde( + rename = "nexusTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub nexus_takedowns: Option, + #[serde(rename = "nexusLost", default, skip_serializing_if = "Option::is_none")] + pub nexus_lost: Option, + #[serde(rename = "objectivesStolen")] + pub objectives_stolen: i32, + #[serde(rename = "objectivesStolenAssists")] + pub objectives_stolen_assists: i32, + ///Blue arrow pointing at ground + #[serde( + rename = "onMyWayPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub on_my_way_pings: Option, + #[serde(rename = "participantId")] + pub participant_id: i32, + #[serde( + rename = "playerScore0", + alias = "PlayerScore0", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score0: Option, + #[serde( + rename = "playerScore1", + alias = "PlayerScore1", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score1: Option, + #[serde( + rename = "playerScore2", + alias = "PlayerScore2", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score2: Option, + #[serde( + rename = "playerScore3", + alias = "PlayerScore3", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score3: Option, + #[serde( + rename = "playerScore4", + alias = "PlayerScore4", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score4: Option, + #[serde( + rename = "playerScore5", + alias = "PlayerScore5", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score5: Option, + #[serde( + rename = "playerScore6", + alias = "PlayerScore6", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score6: Option, + #[serde( + rename = "playerScore7", + alias = "PlayerScore7", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score7: Option, + #[serde( + rename = "playerScore8", + alias = "PlayerScore8", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score8: Option, + #[serde( + rename = "playerScore9", + alias = "PlayerScore9", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score9: Option, + #[serde( + rename = "playerScore10", + alias = "PlayerScore10", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score10: Option, + #[serde( + rename = "playerScore11", + alias = "PlayerScore11", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score11: Option, + #[serde(rename = "pentaKills")] + pub penta_kills: i32, + #[serde(rename = "perks")] + pub perks: crate::models::match_v5::Perks, + #[serde(rename = "physicalDamageDealt")] + pub physical_damage_dealt: i32, + #[serde(rename = "physicalDamageDealtToChampions")] + pub physical_damage_dealt_to_champions: i32, + #[serde(rename = "physicalDamageTaken")] + pub physical_damage_taken: i32, + #[serde(rename = "placement", default, skip_serializing_if = "Option::is_none")] + pub placement: Option, + #[serde( + rename = "playerAugment1", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_augment1: Option, + #[serde( + rename = "playerAugment2", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_augment2: Option, + #[serde( + rename = "playerAugment3", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_augment3: Option, + #[serde( + rename = "playerAugment4", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_augment4: Option, + #[serde( + rename = "playerSubteamId", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_subteam_id: Option, + ///Green minion + #[serde(rename = "pushPings", default, skip_serializing_if = "Option::is_none")] + pub push_pings: Option, + #[serde(rename = "profileIcon")] + pub profile_icon: i32, + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "quadraKills")] + pub quadra_kills: i32, + #[serde( + rename = "riotIdGameName", + default, + skip_serializing_if = "Option::is_none" + )] + pub riot_id_game_name: Option, + #[serde( + rename = "riotIdTagline", + default, + skip_serializing_if = "Option::is_none" + )] + pub riot_id_tagline: Option, + #[serde(rename = "role")] + pub role: String, + #[serde(rename = "sightWardsBoughtInGame")] + pub sight_wards_bought_in_game: i32, + #[serde(rename = "spell1Casts")] + pub spell1_casts: i32, + #[serde(rename = "spell2Casts")] + pub spell2_casts: i32, + #[serde(rename = "spell3Casts")] + pub spell3_casts: i32, + #[serde(rename = "spell4Casts")] + pub spell4_casts: i32, + #[serde( + rename = "subteamPlacement", + default, + skip_serializing_if = "Option::is_none" + )] + pub subteam_placement: Option, + #[serde(rename = "summoner1Casts")] + pub summoner1_casts: i32, + #[serde(rename = "summoner1Id")] + pub summoner1_id: i32, + #[serde(rename = "summoner2Casts")] + pub summoner2_casts: i32, + #[serde(rename = "summoner2Id")] + pub summoner2_id: i32, + #[serde(rename = "summonerId")] + pub summoner_id: String, + #[serde(rename = "summonerLevel")] + pub summoner_level: i32, + #[serde(rename = "summonerName")] + pub summoner_name: String, + #[serde(rename = "teamEarlySurrendered")] + pub team_early_surrendered: bool, + #[serde(rename = "teamId")] + 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, + #[serde(rename = "timeCCingOthers")] + pub time_c_cing_others: i32, + #[serde(rename = "timePlayed")] + pub time_played: i32, + #[serde( + rename = "totalAllyJungleMinionsKilled", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_ally_jungle_minions_killed: Option, + #[serde(rename = "totalDamageDealt")] + pub total_damage_dealt: i32, + #[serde(rename = "totalDamageDealtToChampions")] + pub total_damage_dealt_to_champions: i32, + #[serde(rename = "totalDamageShieldedOnTeammates")] + pub total_damage_shielded_on_teammates: i32, + #[serde(rename = "totalDamageTaken")] + pub total_damage_taken: i32, + #[serde( + rename = "totalEnemyJungleMinionsKilled", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_enemy_jungle_minions_killed: Option, + ///Whenever positive health is applied (which translates to all heals in the game but not things like regeneration), totalHeal is incremented by the amount of health received. This includes healing enemies, jungle monsters, yourself, etc + #[serde(rename = "totalHeal")] + pub total_heal: i32, + ///Whenever positive health is applied (which translates to all heals in the game but not things like regeneration), totalHealsOnTeammates is incremented by the amount of health received. This is post modified, so if you heal someone missing 5 health for 100 you will get +5 totalHealsOnTeammates + #[serde(rename = "totalHealsOnTeammates")] + pub total_heals_on_teammates: i32, + ///totalMillionsKilled = mMinionsKilled, which is only incremented on kills of kTeamMinion, kMeleeLaneMinion, kSuperLaneMinion, kRangedLaneMinion and kSiegeLaneMinion + #[serde(rename = "totalMinionsKilled")] + pub total_minions_killed: i32, + #[serde(rename = "totalTimeCCDealt")] + pub total_time_cc_dealt: i32, + #[serde(rename = "totalTimeSpentDead")] + pub total_time_spent_dead: i32, + #[serde(rename = "totalUnitsHealed")] + pub total_units_healed: i32, + #[serde(rename = "tripleKills")] + pub triple_kills: i32, + #[serde(rename = "trueDamageDealt")] + pub true_damage_dealt: i32, + #[serde(rename = "trueDamageDealtToChampions")] + pub true_damage_dealt_to_champions: i32, + #[serde(rename = "trueDamageTaken")] + pub true_damage_taken: i32, + #[serde(rename = "turretKills")] + pub turret_kills: i32, + #[serde( + rename = "turretTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub turret_takedowns: Option, + #[serde( + rename = "turretsLost", + default, + skip_serializing_if = "Option::is_none" + )] + pub turrets_lost: Option, + #[serde(rename = "unrealKills")] + pub unreal_kills: i32, + #[serde(rename = "visionScore")] + pub vision_score: i32, + #[serde( + rename = "visionClearedPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub vision_cleared_pings: Option, + #[serde(rename = "visionWardsBoughtInGame")] + pub vision_wards_bought_in_game: i32, + #[serde(rename = "wardsKilled")] + pub wards_killed: i32, + #[serde(rename = "wardsPlaced")] + pub wards_placed: i32, + #[serde(rename = "win")] + pub win: bool, + #[serde(rename = "baitPings", default, skip_serializing_if = "Option::is_none")] + pub bait_pings: Option, + /// + #[serde( + rename = "dangerPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub danger_pings: Option, + /// + #[serde(rename = "basicPings", default, skip_serializing_if = "Option::is_none")] + pub basic_pings: Option, + #[serde( + rename = "playerAugment5", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_augment5: Option, + #[serde( + rename = "playerAugment6", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_augment6: Option, + ///Deprecated, use `riotIdGameName`. This field name was briefly used instead of `riotIdGameName`, prior to patch 14.5. + #[serde(rename = "riotIdName", default, skip_serializing_if = "Option::is_none")] + pub riot_id_name: Option, + /// + #[serde( + rename = "retreatPings", + default, + skip_serializing_if = "Option::is_none" + )] + pub retreat_pings: Option, + } + ///`match-v5.ChallengesDto` data object. + /// + ///# Description + ///Challenges DTO + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Challenges { + #[serde( + rename = "12AssistStreakCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub x12assist_streak_count: Option, + #[serde( + rename = "baronBuffGoldAdvantageOverThreshold", + default, + skip_serializing_if = "Option::is_none" + )] + pub baron_buff_gold_advantage_over_threshold: Option, + #[serde( + rename = "controlWardTimeCoverageInRiverOrEnemyHalf", + default, + skip_serializing_if = "Option::is_none" + )] + pub control_ward_time_coverage_in_river_or_enemy_half: Option, + #[serde( + rename = "earliestBaron", + default, + skip_serializing_if = "Option::is_none" + )] + pub earliest_baron: Option, + #[serde( + rename = "earliestDragonTakedown", + default, + skip_serializing_if = "Option::is_none" + )] + pub earliest_dragon_takedown: Option, + #[serde( + rename = "earliestElderDragon", + default, + skip_serializing_if = "Option::is_none" + )] + pub earliest_elder_dragon: Option, + #[serde( + rename = "earlyLaningPhaseGoldExpAdvantage", + default, + skip_serializing_if = "Option::is_none" + )] + pub early_laning_phase_gold_exp_advantage: Option, + #[serde( + rename = "fasterSupportQuestCompletion", + default, + skip_serializing_if = "Option::is_none" + )] + pub faster_support_quest_completion: Option, + #[serde( + rename = "fastestLegendary", + default, + skip_serializing_if = "Option::is_none" + )] + pub fastest_legendary: Option, + #[serde( + rename = "hadAfkTeammate", + default, + skip_serializing_if = "Option::is_none" + )] + pub had_afk_teammate: Option, + #[serde( + rename = "highestChampionDamage", + default, + skip_serializing_if = "Option::is_none" + )] + pub highest_champion_damage: Option, + #[serde( + rename = "highestCrowdControlScore", + default, + skip_serializing_if = "Option::is_none" + )] + pub highest_crowd_control_score: Option, + #[serde( + rename = "highestWardKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub highest_ward_kills: Option, + #[serde( + rename = "junglerKillsEarlyJungle", + default, + skip_serializing_if = "Option::is_none" + )] + pub jungler_kills_early_jungle: Option, + #[serde( + rename = "killsOnLanersEarlyJungleAsJungler", + default, + skip_serializing_if = "Option::is_none" + )] + pub kills_on_laners_early_jungle_as_jungler: Option, + #[serde( + rename = "laningPhaseGoldExpAdvantage", + default, + skip_serializing_if = "Option::is_none" + )] + pub laning_phase_gold_exp_advantage: Option, + #[serde( + rename = "legendaryCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub legendary_count: Option, + #[serde( + rename = "maxCsAdvantageOnLaneOpponent", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_cs_advantage_on_lane_opponent: Option, + #[serde( + rename = "maxLevelLeadLaneOpponent", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_level_lead_lane_opponent: Option, + #[serde( + rename = "mostWardsDestroyedOneSweeper", + default, + skip_serializing_if = "Option::is_none" + )] + pub most_wards_destroyed_one_sweeper: Option, + #[serde( + rename = "mythicItemUsed", + default, + skip_serializing_if = "Option::is_none" + )] + pub mythic_item_used: Option, + #[serde( + rename = "playedChampSelectPosition", + default, + skip_serializing_if = "Option::is_none" + )] + pub played_champ_select_position: Option, + #[serde( + rename = "soloTurretsLategame", + default, + skip_serializing_if = "Option::is_none" + )] + pub solo_turrets_lategame: Option, + #[serde( + rename = "takedownsFirst25Minutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedowns_first25_minutes: Option, + #[serde( + rename = "teleportTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub teleport_takedowns: Option, + #[serde( + rename = "thirdInhibitorDestroyedTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub third_inhibitor_destroyed_time: Option, + #[serde( + rename = "threeWardsOneSweeperCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub three_wards_one_sweeper_count: Option, + #[serde( + rename = "visionScoreAdvantageLaneOpponent", + default, + skip_serializing_if = "Option::is_none" + )] + pub vision_score_advantage_lane_opponent: Option, + #[serde( + rename = "InfernalScalePickup", + default, + skip_serializing_if = "Option::is_none" + )] + pub infernal_scale_pickup: Option, + #[serde( + rename = "fistBumpParticipation", + default, + skip_serializing_if = "Option::is_none" + )] + pub fist_bump_participation: Option, + #[serde( + rename = "voidMonsterKill", + default, + skip_serializing_if = "Option::is_none" + )] + pub void_monster_kill: Option, + #[serde( + rename = "abilityUses", + default, + skip_serializing_if = "Option::is_none" + )] + pub ability_uses: Option, + #[serde( + rename = "acesBefore15Minutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub aces_before15_minutes: Option, + #[serde( + rename = "alliedJungleMonsterKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub allied_jungle_monster_kills: Option, + #[serde( + rename = "baronTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub baron_takedowns: Option, + #[serde( + rename = "blastConeOppositeOpponentCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub blast_cone_opposite_opponent_count: Option, + #[serde(rename = "bountyGold", default, skip_serializing_if = "Option::is_none")] + pub bounty_gold: Option, + #[serde( + rename = "buffsStolen", + default, + skip_serializing_if = "Option::is_none" + )] + pub buffs_stolen: Option, + #[serde( + rename = "completeSupportQuestInTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub complete_support_quest_in_time: Option, + #[serde( + rename = "controlWardsPlaced", + default, + skip_serializing_if = "Option::is_none" + )] + pub control_wards_placed: Option, + #[serde( + rename = "damagePerMinute", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_per_minute: Option, + #[serde( + rename = "damageTakenOnTeamPercentage", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_taken_on_team_percentage: Option, + #[serde( + rename = "dancedWithRiftHerald", + default, + skip_serializing_if = "Option::is_none" + )] + pub danced_with_rift_herald: Option, + #[serde( + rename = "deathsByEnemyChamps", + default, + skip_serializing_if = "Option::is_none" + )] + pub deaths_by_enemy_champs: Option, + #[serde( + rename = "dodgeSkillShotsSmallWindow", + default, + skip_serializing_if = "Option::is_none" + )] + pub dodge_skill_shots_small_window: Option, + #[serde(rename = "doubleAces", default, skip_serializing_if = "Option::is_none")] + pub double_aces: Option, + #[serde( + rename = "dragonTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub dragon_takedowns: Option, + #[serde( + rename = "legendaryItemUsed", + default, + skip_serializing_if = "Option::is_none" + )] + pub legendary_item_used: Option>, + #[serde( + rename = "effectiveHealAndShielding", + default, + skip_serializing_if = "Option::is_none" + )] + pub effective_heal_and_shielding: Option, + #[serde( + rename = "elderDragonKillsWithOpposingSoul", + default, + skip_serializing_if = "Option::is_none" + )] + pub elder_dragon_kills_with_opposing_soul: Option, + #[serde( + rename = "elderDragonMultikills", + default, + skip_serializing_if = "Option::is_none" + )] + pub elder_dragon_multikills: Option, + #[serde( + rename = "enemyChampionImmobilizations", + default, + skip_serializing_if = "Option::is_none" + )] + pub enemy_champion_immobilizations: Option, + #[serde( + rename = "enemyJungleMonsterKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub enemy_jungle_monster_kills: Option, + #[serde( + rename = "epicMonsterKillsNearEnemyJungler", + default, + skip_serializing_if = "Option::is_none" + )] + pub epic_monster_kills_near_enemy_jungler: Option, + #[serde( + rename = "epicMonsterKillsWithin30SecondsOfSpawn", + default, + skip_serializing_if = "Option::is_none" + )] + pub epic_monster_kills_within30_seconds_of_spawn: Option, + #[serde( + rename = "epicMonsterSteals", + default, + skip_serializing_if = "Option::is_none" + )] + pub epic_monster_steals: Option, + #[serde( + rename = "epicMonsterStolenWithoutSmite", + default, + skip_serializing_if = "Option::is_none" + )] + pub epic_monster_stolen_without_smite: Option, + #[serde( + rename = "firstTurretKilled", + default, + skip_serializing_if = "Option::is_none" + )] + pub first_turret_killed: Option, + #[serde( + rename = "firstTurretKilledTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub first_turret_killed_time: Option, + #[serde( + rename = "flawlessAces", + default, + skip_serializing_if = "Option::is_none" + )] + pub flawless_aces: Option, + #[serde( + rename = "fullTeamTakedown", + default, + skip_serializing_if = "Option::is_none" + )] + pub full_team_takedown: Option, + #[serde(rename = "gameLength", default, skip_serializing_if = "Option::is_none")] + pub game_length: Option, + #[serde( + rename = "getTakedownsInAllLanesEarlyJungleAsLaner", + default, + skip_serializing_if = "Option::is_none" + )] + pub get_takedowns_in_all_lanes_early_jungle_as_laner: Option, + #[serde( + rename = "goldPerMinute", + default, + skip_serializing_if = "Option::is_none" + )] + pub gold_per_minute: Option, + #[serde( + rename = "hadOpenNexus", + default, + skip_serializing_if = "Option::is_none" + )] + pub had_open_nexus: Option, + #[serde( + rename = "immobilizeAndKillWithAlly", + default, + skip_serializing_if = "Option::is_none" + )] + pub immobilize_and_kill_with_ally: Option, + #[serde( + rename = "initialBuffCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_buff_count: Option, + #[serde( + rename = "initialCrabCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub initial_crab_count: Option, + #[serde( + rename = "jungleCsBefore10Minutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub jungle_cs_before10_minutes: Option, + #[serde( + rename = "junglerTakedownsNearDamagedEpicMonster", + default, + skip_serializing_if = "Option::is_none" + )] + pub jungler_takedowns_near_damaged_epic_monster: Option, + #[serde(rename = "kda", default, skip_serializing_if = "Option::is_none")] + pub kda: Option, + #[serde( + rename = "killAfterHiddenWithAlly", + default, + skip_serializing_if = "Option::is_none" + )] + pub kill_after_hidden_with_ally: Option, + #[serde( + rename = "killedChampTookFullTeamDamageSurvived", + default, + skip_serializing_if = "Option::is_none" + )] + pub killed_champ_took_full_team_damage_survived: Option, + #[serde( + rename = "killingSprees", + default, + skip_serializing_if = "Option::is_none" + )] + pub killing_sprees: Option, + #[serde( + rename = "killParticipation", + default, + skip_serializing_if = "Option::is_none" + )] + pub kill_participation: Option, + #[serde( + rename = "killsNearEnemyTurret", + default, + skip_serializing_if = "Option::is_none" + )] + pub kills_near_enemy_turret: Option, + #[serde( + rename = "killsOnOtherLanesEarlyJungleAsLaner", + default, + skip_serializing_if = "Option::is_none" + )] + pub kills_on_other_lanes_early_jungle_as_laner: Option, + #[serde( + rename = "killsOnRecentlyHealedByAramPack", + default, + skip_serializing_if = "Option::is_none" + )] + pub kills_on_recently_healed_by_aram_pack: Option, + #[serde( + rename = "killsUnderOwnTurret", + default, + skip_serializing_if = "Option::is_none" + )] + pub kills_under_own_turret: Option, + #[serde( + rename = "killsWithHelpFromEpicMonster", + default, + skip_serializing_if = "Option::is_none" + )] + pub kills_with_help_from_epic_monster: Option, + #[serde( + rename = "knockEnemyIntoTeamAndKill", + default, + skip_serializing_if = "Option::is_none" + )] + pub knock_enemy_into_team_and_kill: Option, + #[serde( + rename = "kTurretsDestroyedBeforePlatesFall", + default, + skip_serializing_if = "Option::is_none" + )] + pub k_turrets_destroyed_before_plates_fall: Option, + #[serde( + rename = "landSkillShotsEarlyGame", + default, + skip_serializing_if = "Option::is_none" + )] + pub land_skill_shots_early_game: Option, + #[serde( + rename = "laneMinionsFirst10Minutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub lane_minions_first10_minutes: Option, + #[serde( + rename = "lostAnInhibitor", + default, + skip_serializing_if = "Option::is_none" + )] + pub lost_an_inhibitor: Option, + #[serde( + rename = "maxKillDeficit", + default, + skip_serializing_if = "Option::is_none" + )] + pub max_kill_deficit: Option, + #[serde( + rename = "mejaisFullStackInTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub mejais_full_stack_in_time: Option, + #[serde( + rename = "moreEnemyJungleThanOpponent", + default, + skip_serializing_if = "Option::is_none" + )] + pub more_enemy_jungle_than_opponent: Option, + ///This is an offshoot of the OneStone challenge. The code checks if a spell with the same instance ID does the final point of damage to at least 2 Champions. It doesn't matter if they're enemies, but you cannot hurt your friends. + #[serde( + rename = "multiKillOneSpell", + default, + skip_serializing_if = "Option::is_none" + )] + pub multi_kill_one_spell: Option, + #[serde(rename = "multikills", default, skip_serializing_if = "Option::is_none")] + pub multikills: Option, + #[serde( + rename = "multikillsAfterAggressiveFlash", + default, + skip_serializing_if = "Option::is_none" + )] + pub multikills_after_aggressive_flash: Option, + #[serde( + rename = "multiTurretRiftHeraldCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub multi_turret_rift_herald_count: Option, + #[serde( + rename = "outerTurretExecutesBefore10Minutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub outer_turret_executes_before10_minutes: Option, + #[serde( + rename = "outnumberedKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub outnumbered_kills: Option, + #[serde( + rename = "outnumberedNexusKill", + default, + skip_serializing_if = "Option::is_none" + )] + pub outnumbered_nexus_kill: Option, + #[serde( + rename = "perfectDragonSoulsTaken", + default, + skip_serializing_if = "Option::is_none" + )] + pub perfect_dragon_souls_taken: Option, + #[serde( + rename = "perfectGame", + default, + skip_serializing_if = "Option::is_none" + )] + pub perfect_game: Option, + #[serde( + rename = "pickKillWithAlly", + default, + skip_serializing_if = "Option::is_none" + )] + pub pick_kill_with_ally: Option, + #[serde( + rename = "poroExplosions", + default, + skip_serializing_if = "Option::is_none" + )] + pub poro_explosions: Option, + #[serde( + rename = "quickCleanse", + default, + skip_serializing_if = "Option::is_none" + )] + pub quick_cleanse: Option, + #[serde( + rename = "quickFirstTurret", + default, + skip_serializing_if = "Option::is_none" + )] + pub quick_first_turret: Option, + #[serde( + rename = "quickSoloKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub quick_solo_kills: Option, + #[serde( + rename = "riftHeraldTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub rift_herald_takedowns: Option, + #[serde( + rename = "saveAllyFromDeath", + default, + skip_serializing_if = "Option::is_none" + )] + pub save_ally_from_death: Option, + #[serde( + rename = "scuttleCrabKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub scuttle_crab_kills: Option, + #[serde( + rename = "shortestTimeToAceFromFirstTakedown", + default, + skip_serializing_if = "Option::is_none" + )] + pub shortest_time_to_ace_from_first_takedown: Option, + #[serde( + rename = "skillshotsDodged", + default, + skip_serializing_if = "Option::is_none" + )] + pub skillshots_dodged: Option, + #[serde( + rename = "skillshotsHit", + default, + skip_serializing_if = "Option::is_none" + )] + pub skillshots_hit: Option, + #[serde( + rename = "snowballsHit", + default, + skip_serializing_if = "Option::is_none" + )] + pub snowballs_hit: Option, + #[serde( + rename = "soloBaronKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub solo_baron_kills: Option, + #[serde( + rename = "SWARM_DefeatAatrox", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_defeat_aatrox: Option, + #[serde( + rename = "SWARM_DefeatBriar", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_defeat_briar: Option, + #[serde( + rename = "SWARM_DefeatMiniBosses", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_defeat_mini_bosses: Option, + #[serde( + rename = "SWARM_EvolveWeapon", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_evolve_weapon: Option, + #[serde( + rename = "SWARM_Have3Passives", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_have3_passives: Option, + #[serde( + rename = "SWARM_KillEnemy", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_kill_enemy: Option, + #[serde( + rename = "SWARM_PickupGold", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_pickup_gold: Option, + #[serde( + rename = "SWARM_ReachLevel50", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_reach_level50: Option, + #[serde( + rename = "SWARM_Survive15Min", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_survive15_min: Option, + #[serde( + rename = "SWARM_WinWith5EvolvedWeapons", + default, + skip_serializing_if = "Option::is_none" + )] + pub swarm_win_with5_evolved_weapons: Option, + #[serde(rename = "soloKills", default, skip_serializing_if = "Option::is_none")] + pub solo_kills: Option, + #[serde( + rename = "stealthWardsPlaced", + default, + skip_serializing_if = "Option::is_none" + )] + pub stealth_wards_placed: Option, + #[serde( + rename = "survivedSingleDigitHpCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub survived_single_digit_hp_count: Option, + #[serde( + rename = "survivedThreeImmobilizesInFight", + default, + skip_serializing_if = "Option::is_none" + )] + pub survived_three_immobilizes_in_fight: Option, + #[serde( + rename = "takedownOnFirstTurret", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedown_on_first_turret: Option, + #[serde(rename = "takedowns", default, skip_serializing_if = "Option::is_none")] + pub takedowns: Option, + #[serde( + rename = "takedownsAfterGainingLevelAdvantage", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedowns_after_gaining_level_advantage: Option, + #[serde( + rename = "takedownsBeforeJungleMinionSpawn", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedowns_before_jungle_minion_spawn: Option, + #[serde( + rename = "takedownsFirstXMinutes", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedowns_first_x_minutes: Option, + #[serde( + rename = "takedownsInAlcove", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedowns_in_alcove: Option, + #[serde( + rename = "takedownsInEnemyFountain", + default, + skip_serializing_if = "Option::is_none" + )] + pub takedowns_in_enemy_fountain: Option, + #[serde( + rename = "teamBaronKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_baron_kills: Option, + #[serde( + rename = "teamDamagePercentage", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_damage_percentage: Option, + #[serde( + rename = "teamElderDragonKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_elder_dragon_kills: Option, + #[serde( + rename = "teamRiftHeraldKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub team_rift_herald_kills: Option, + #[serde( + rename = "tookLargeDamageSurvived", + default, + skip_serializing_if = "Option::is_none" + )] + pub took_large_damage_survived: Option, + #[serde( + rename = "turretPlatesTaken", + default, + skip_serializing_if = "Option::is_none" + )] + pub turret_plates_taken: Option, + ///Any player who damages a tower that is destroyed within 30 seconds of a Rift Herald charge will receive credit. A player who does not damage the tower will not receive credit. + #[serde( + rename = "turretsTakenWithRiftHerald", + default, + skip_serializing_if = "Option::is_none" + )] + pub turrets_taken_with_rift_herald: Option, + #[serde( + rename = "turretTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub turret_takedowns: Option, + #[serde( + rename = "twentyMinionsIn3SecondsCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub twenty_minions_in3_seconds_count: Option, + #[serde( + rename = "twoWardsOneSweeperCount", + default, + skip_serializing_if = "Option::is_none" + )] + pub two_wards_one_sweeper_count: Option, + #[serde( + rename = "unseenRecalls", + default, + skip_serializing_if = "Option::is_none" + )] + pub unseen_recalls: Option, + #[serde( + rename = "visionScorePerMinute", + default, + skip_serializing_if = "Option::is_none" + )] + pub vision_score_per_minute: Option, + #[serde( + rename = "wardsGuarded", + default, + skip_serializing_if = "Option::is_none" + )] + pub wards_guarded: Option, + #[serde( + rename = "wardTakedowns", + default, + skip_serializing_if = "Option::is_none" + )] + pub ward_takedowns: Option, + #[serde( + rename = "wardTakedownsBefore20M", + default, + skip_serializing_if = "Option::is_none" + )] + pub ward_takedowns_before20_m: Option, + #[serde( + rename = "HealFromMapSources", + default, + skip_serializing_if = "Option::is_none" + )] + pub heal_from_map_sources: Option, + } + ///`match-v5.MissionsDto` data object. + /// + ///# Description + ///Missions DTO + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Missions { + #[serde( + rename = "playerScore0", + alias = "PlayerScore0", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score0: Option, + #[serde( + rename = "playerScore1", + alias = "PlayerScore1", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score1: Option, + #[serde( + rename = "playerScore2", + alias = "PlayerScore2", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score2: Option, + #[serde( + rename = "playerScore3", + alias = "PlayerScore3", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score3: Option, + #[serde( + rename = "playerScore4", + alias = "PlayerScore4", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score4: Option, + #[serde( + rename = "playerScore5", + alias = "PlayerScore5", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score5: Option, + #[serde( + rename = "playerScore6", + alias = "PlayerScore6", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score6: Option, + #[serde( + rename = "playerScore7", + alias = "PlayerScore7", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score7: Option, + #[serde( + rename = "playerScore8", + alias = "PlayerScore8", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score8: Option, + #[serde( + rename = "playerScore9", + alias = "PlayerScore9", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score9: Option, + #[serde( + rename = "playerScore10", + alias = "PlayerScore10", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score10: Option, + #[serde( + rename = "playerScore11", + alias = "PlayerScore11", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score11: Option, + } + ///`match-v5.PerksDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Perks { + #[serde(rename = "statPerks")] + pub stat_perks: crate::models::match_v5::PerkStats, + #[serde(rename = "styles")] + pub styles: Vec, + } + ///`match-v5.PerkStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PerkStats { + #[serde(rename = "defense")] + pub defense: i32, + #[serde(rename = "flex")] + pub flex: i32, + #[serde(rename = "offense")] + pub offense: i32, + } + ///`match-v5.PerkStyleDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PerkStyle { + #[serde(rename = "description")] + pub description: String, + #[serde(rename = "selections")] + pub selections: Vec, + #[serde(rename = "style")] + pub style: i32, + } + ///`match-v5.PerkStyleSelectionDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PerkStyleSelection { + #[serde(rename = "perk")] + pub perk: i32, + #[serde(rename = "var1")] + pub var1: i32, + #[serde(rename = "var2")] + pub var2: i32, + #[serde(rename = "var3")] + pub var3: i32, + } + ///`match-v5.TeamDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Team { + #[serde(rename = "bans")] + pub bans: Vec, + #[serde(rename = "objectives")] + pub objectives: crate::models::match_v5::Objectives, + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + #[serde(rename = "win")] + pub win: bool, + #[serde(rename = "feats", default, skip_serializing_if = "Option::is_none")] + pub feats: Option, + } + ///`match-v5.BanDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Ban { + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + #[serde(rename = "pickTurn")] + pub pick_turn: i32, + } + ///`match-v5.ObjectivesDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Objectives { + #[serde(rename = "baron")] + pub baron: crate::models::match_v5::Objective, + #[serde(rename = "champion")] + pub champion: crate::models::match_v5::Objective, + #[serde(rename = "dragon")] + pub dragon: crate::models::match_v5::Objective, + #[serde(rename = "horde", default, skip_serializing_if = "Option::is_none")] + pub horde: Option, + #[serde(rename = "inhibitor")] + pub inhibitor: crate::models::match_v5::Objective, + #[serde(rename = "riftHerald")] + pub rift_herald: crate::models::match_v5::Objective, + #[serde(rename = "tower")] + pub tower: crate::models::match_v5::Objective, + #[serde(rename = "atakhan", default, skip_serializing_if = "Option::is_none")] + pub atakhan: Option, + } + ///`match-v5.ObjectiveDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Objective { + #[serde(rename = "first")] + pub first: bool, + #[serde(rename = "kills")] + pub kills: i32, + } + ///`match-v5.TimelineDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Timeline { + #[serde(rename = "metadata")] + pub metadata: crate::models::match_v5::MetadataTimeLine, + #[serde(rename = "info")] + pub info: crate::models::match_v5::InfoTimeLine, + } + ///`match-v5.MetadataTimeLineDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MetadataTimeLine { + ///Match data version. + #[serde(rename = "dataVersion")] + pub data_version: String, + ///Match id. + #[serde(rename = "matchId")] + pub match_id: String, + ///A list of participant PUUIDs. + #[serde(rename = "participants")] + pub participants: Vec, + } + ///`match-v5.InfoTimeLineDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct InfoTimeLine { + ///Refer to indicate if the game ended in termination. + #[serde( + rename = "endOfGameResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_of_game_result: Option, + #[serde(rename = "frameInterval")] + pub frame_interval: i64, + #[serde(rename = "gameId", default, skip_serializing_if = "Option::is_none")] + pub game_id: Option, + #[serde( + rename = "participants", + default, + skip_serializing_if = "Option::is_none" + )] + pub participants: Option>, + #[serde(rename = "frames")] + pub frames: Vec, + } + ///`match-v5.ParticipantTimeLineDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ParticipantTimeLine { + #[serde(rename = "participantId")] + pub participant_id: i32, + #[serde(rename = "puuid")] + pub puuid: String, + } + ///`match-v5.FramesTimeLineDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FramesTimeLine { + #[serde(rename = "events")] + pub events: Vec, + #[serde( + rename = "participantFrames", + default, + skip_serializing_if = "Option::is_none" + )] + pub participant_frames: Option< + ::std::collections::HashMap, + >, + #[serde(rename = "timestamp")] + pub timestamp: i32, + } + ///`match-v5.EventsTimeLineDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct EventsTimeLine { + #[serde(rename = "timestamp")] + pub timestamp: i64, + #[serde( + rename = "realTimestamp", + default, + skip_serializing_if = "Option::is_none" + )] + pub real_timestamp: Option, + #[serde(rename = "type")] + pub r#type: String, + #[serde(rename = "itemId", default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, + #[serde( + rename = "participantId", + default, + skip_serializing_if = "Option::is_none" + )] + pub participant_id: Option, + #[serde( + rename = "levelUpType", + default, + skip_serializing_if = "Option::is_none" + )] + pub level_up_type: Option, + #[serde(rename = "skillSlot", default, skip_serializing_if = "Option::is_none")] + pub skill_slot: Option, + #[serde(rename = "creatorId", default, skip_serializing_if = "Option::is_none")] + pub creator_id: Option, + #[serde(rename = "wardType", default, skip_serializing_if = "Option::is_none")] + pub ward_type: Option, + #[serde(rename = "level", default, skip_serializing_if = "Option::is_none")] + pub level: Option, + #[serde( + rename = "assistingParticipantIds", + default, + skip_serializing_if = "Option::is_none" + )] + pub assisting_participant_ids: Option>, + #[serde(rename = "bounty", default, skip_serializing_if = "Option::is_none")] + pub bounty: Option, + #[serde( + rename = "killStreakLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub kill_streak_length: Option, + #[serde(rename = "killerId", default, skip_serializing_if = "Option::is_none")] + pub killer_id: Option, + #[serde(rename = "position", default, skip_serializing_if = "Option::is_none")] + pub position: Option, + #[serde( + rename = "victimDamageDealt", + default, + skip_serializing_if = "Option::is_none" + )] + pub victim_damage_dealt: Option< + Vec, + >, + #[serde( + rename = "victimDamageReceived", + default, + skip_serializing_if = "Option::is_none" + )] + pub victim_damage_received: Option< + Vec, + >, + #[serde(rename = "victimId", default, skip_serializing_if = "Option::is_none")] + pub victim_id: Option, + #[serde(rename = "killType", default, skip_serializing_if = "Option::is_none")] + pub kill_type: Option, + #[serde(rename = "laneType", default, skip_serializing_if = "Option::is_none")] + pub lane_type: Option, + #[serde(rename = "teamId", default, skip_serializing_if = "Option::is_none")] + pub team_id: Option, + #[serde( + rename = "multiKillLength", + default, + skip_serializing_if = "Option::is_none" + )] + pub multi_kill_length: Option, + #[serde( + rename = "killerTeamId", + default, + skip_serializing_if = "Option::is_none" + )] + pub killer_team_id: Option, + #[serde( + rename = "monsterType", + default, + skip_serializing_if = "Option::is_none" + )] + pub monster_type: Option, + #[serde( + rename = "monsterSubType", + default, + skip_serializing_if = "Option::is_none" + )] + pub monster_sub_type: Option, + #[serde( + rename = "buildingType", + default, + skip_serializing_if = "Option::is_none" + )] + pub building_type: Option, + #[serde(rename = "towerType", default, skip_serializing_if = "Option::is_none")] + pub tower_type: Option, + #[serde(rename = "afterId", default, skip_serializing_if = "Option::is_none")] + pub after_id: Option, + #[serde(rename = "beforeId", default, skip_serializing_if = "Option::is_none")] + pub before_id: Option, + #[serde(rename = "goldGain", default, skip_serializing_if = "Option::is_none")] + pub gold_gain: Option, + #[serde(rename = "gameId", default, skip_serializing_if = "Option::is_none")] + pub game_id: Option, + #[serde( + rename = "winningTeam", + default, + skip_serializing_if = "Option::is_none" + )] + pub winning_team: Option, + #[serde( + rename = "transformType", + default, + skip_serializing_if = "Option::is_none" + )] + pub transform_type: Option, + #[serde(rename = "name", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde( + rename = "shutdownBounty", + default, + skip_serializing_if = "Option::is_none" + )] + pub shutdown_bounty: Option, + #[serde( + rename = "actualStartTime", + default, + skip_serializing_if = "Option::is_none" + )] + pub actual_start_time: Option, + #[serde(rename = "featType", default, skip_serializing_if = "Option::is_none")] + pub feat_type: Option, + #[serde(rename = "featValue", default, skip_serializing_if = "Option::is_none")] + pub feat_value: Option, + } + ///`match-v5.ParticipantFramesDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ParticipantFrames { + #[serde(rename = "1-9")] + pub x1_9: crate::models::match_v5::ParticipantFrame, + } + ///`match-v5.ParticipantFrameDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ParticipantFrame { + #[serde(rename = "championStats")] + pub champion_stats: crate::models::match_v5::ChampionStats, + #[serde(rename = "currentGold")] + pub current_gold: i32, + #[serde(rename = "damageStats")] + pub damage_stats: crate::models::match_v5::DamageStats, + #[serde(rename = "goldPerSecond")] + pub gold_per_second: i32, + #[serde(rename = "jungleMinionsKilled")] + pub jungle_minions_killed: i32, + #[serde(rename = "level")] + pub level: i32, + #[serde(rename = "minionsKilled")] + pub minions_killed: i32, + #[serde(rename = "participantId")] + pub participant_id: i32, + #[serde(rename = "position")] + pub position: crate::models::match_v5::Position, + #[serde(rename = "timeEnemySpentControlled")] + pub time_enemy_spent_controlled: i32, + #[serde(rename = "totalGold")] + pub total_gold: i32, + #[serde(rename = "xp")] + pub xp: i32, + } + ///`match-v5.ChampionStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ChampionStats { + #[serde( + rename = "abilityHaste", + default, + skip_serializing_if = "Option::is_none" + )] + pub ability_haste: Option, + #[serde(rename = "abilityPower")] + pub ability_power: i32, + #[serde(rename = "armor")] + pub armor: i32, + #[serde(rename = "armorPen")] + pub armor_pen: i32, + #[serde(rename = "armorPenPercent")] + pub armor_pen_percent: i32, + #[serde(rename = "attackDamage")] + pub attack_damage: i32, + #[serde(rename = "attackSpeed")] + pub attack_speed: i32, + #[serde(rename = "bonusArmorPenPercent")] + pub bonus_armor_pen_percent: i32, + #[serde(rename = "bonusMagicPenPercent")] + pub bonus_magic_pen_percent: i32, + #[serde(rename = "ccReduction")] + pub cc_reduction: i32, + #[serde(rename = "cooldownReduction")] + pub cooldown_reduction: i32, + #[serde(rename = "health")] + pub health: i32, + #[serde(rename = "healthMax")] + pub health_max: i32, + #[serde(rename = "healthRegen")] + pub health_regen: i32, + #[serde(rename = "lifesteal")] + pub lifesteal: i32, + #[serde(rename = "magicPen")] + pub magic_pen: i32, + #[serde(rename = "magicPenPercent")] + pub magic_pen_percent: i32, + #[serde(rename = "magicResist")] + pub magic_resist: i32, + #[serde(rename = "movementSpeed")] + pub movement_speed: i32, + #[serde(rename = "omnivamp", default, skip_serializing_if = "Option::is_none")] + pub omnivamp: Option, + #[serde( + rename = "physicalVamp", + default, + skip_serializing_if = "Option::is_none" + )] + pub physical_vamp: Option, + #[serde(rename = "power")] + pub power: i32, + #[serde(rename = "powerMax")] + pub power_max: i32, + #[serde(rename = "powerRegen")] + pub power_regen: i32, + #[serde(rename = "spellVamp")] + pub spell_vamp: i32, + } + ///`match-v5.DamageStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct DamageStats { + #[serde(rename = "magicDamageDone")] + pub magic_damage_done: i32, + #[serde(rename = "magicDamageDoneToChampions")] + pub magic_damage_done_to_champions: i32, + #[serde(rename = "magicDamageTaken")] + pub magic_damage_taken: i32, + #[serde(rename = "physicalDamageDone")] + pub physical_damage_done: i32, + #[serde(rename = "physicalDamageDoneToChampions")] + pub physical_damage_done_to_champions: i32, + #[serde(rename = "physicalDamageTaken")] + pub physical_damage_taken: i32, + #[serde(rename = "totalDamageDone")] + pub total_damage_done: i32, + #[serde(rename = "totalDamageDoneToChampions")] + pub total_damage_done_to_champions: i32, + #[serde(rename = "totalDamageTaken")] + pub total_damage_taken: i32, + #[serde(rename = "trueDamageDone")] + pub true_damage_done: i32, + #[serde(rename = "trueDamageDoneToChampions")] + pub true_damage_done_to_champions: i32, + #[serde(rename = "trueDamageTaken")] + pub true_damage_taken: i32, + } + ///`match-v5.PositionDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Position { + #[serde(rename = "x")] + pub x: i32, + #[serde(rename = "y")] + pub y: i32, + } + ///`match-v5.FeatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Feats { + #[serde( + rename = "EPIC_MONSTER_KILL", + default, + skip_serializing_if = "Option::is_none" + )] + pub epic_monster_kill: Option, + #[serde( + rename = "FIRST_BLOOD", + default, + skip_serializing_if = "Option::is_none" + )] + pub first_blood: Option, + #[serde( + rename = "FIRST_TURRET", + default, + skip_serializing_if = "Option::is_none" + )] + pub first_turret: Option, + } + ///`match-v5.MatchTimelineVictimDamage` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MatchTimelineVictimDamage { + #[serde(rename = "basic")] + pub basic: bool, + #[serde(rename = "magicDamage")] + pub magic_damage: i32, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "participantId")] + pub participant_id: i32, + #[serde(rename = "physicalDamage")] + pub physical_damage: i32, + #[serde(rename = "spellName")] + pub spell_name: String, + #[serde(rename = "spellSlot")] + pub spell_slot: i32, + #[serde(rename = "trueDamage")] + pub true_damage: i32, + #[serde(rename = "type")] + pub r#type: String, + } + ///`match-v5.FeatDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Feat { + #[serde(rename = "featState", default, skip_serializing_if = "Option::is_none")] + pub feat_state: Option, + } +} +///Data structs used by [`SpectatorTftV5`](crate::endpoints::SpectatorTftV5) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod spectator_tft_v5 { + ///`spectator-tft-v5.CurrentGameInfo` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct CurrentGameInfo { + ///The ID of the game + #[serde(rename = "gameId")] + pub game_id: i64, + ///The game type + #[serde(rename = "gameType")] + pub game_type: crate::consts::GameType, + ///The game start time represented in epoch milliseconds + #[serde(rename = "gameStartTime")] + pub game_start_time: i64, + ///The ID of the map + #[serde(rename = "mapId")] + pub map_id: crate::consts::Map, + ///The amount of time in seconds that has passed since the game started + #[serde(rename = "gameLength")] + pub game_length: i64, + ///The ID of the platform on which the game is being played + #[serde(rename = "platformId")] + pub platform_id: String, + ///The game mode + #[serde(rename = "gameMode")] + pub game_mode: crate::consts::GameMode, + ///Banned champion information + #[serde(rename = "bannedChampions")] + pub banned_champions: Vec, + ///The queue type (queue types are documented on the Game Constants page) + #[serde( + rename = "gameQueueConfigId", + default, + skip_serializing_if = "Option::is_none" + )] + pub game_queue_config_id: Option, + #[serde(rename = "observers")] + pub observers: crate::models::spectator_tft_v5::Observer, + ///The participant information + #[serde(rename = "participants")] + pub participants: Vec, + } + ///`spectator-tft-v5.BannedChampion` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct BannedChampion { + ///The turn during which the champion was banned + #[serde(rename = "pickTurn")] + pub pick_turn: i32, + ///The ID of the banned champion + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + ///The ID of the team that banned the champion + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + } + ///`spectator-tft-v5.Observer` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Observer { + ///Key used to decrypt the spectator grid game data for playback + #[serde(rename = "encryptionKey")] + pub encryption_key: String, + } + ///`spectator-tft-v5.CurrentGameParticipant` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct CurrentGameParticipant { + ///The ID of the champion played by this participant + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + #[serde(rename = "perks", default, skip_serializing_if = "Option::is_none")] + pub perks: Option, + ///The ID of the profile icon used by this participant + #[serde(rename = "profileIconId")] + pub profile_icon_id: i64, + ///The team ID of this participant, indicating the participant's team + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + ///The encrypted summoner ID of this participant + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///The encrypted puuid of this participant + #[serde(rename = "puuid", default, skip_serializing_if = "Option::is_none")] + pub puuid: Option, + ///The ID of the first summoner spell used by this participant + #[serde(rename = "spell1Id")] + pub spell1_id: i64, + ///The ID of the second summoner spell used by this participant + #[serde(rename = "spell2Id")] + pub spell2_id: i64, + ///List of Game Customizations + #[serde(rename = "gameCustomizationObjects")] + pub game_customization_objects: Vec< + crate::models::spectator_tft_v5::GameCustomizationObject, + >, + #[serde(rename = "riotId", default, skip_serializing_if = "Option::is_none")] + pub riot_id: Option, + } + ///`spectator-tft-v5.Perks` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Perks { + ///IDs of the perks/runes assigned. + #[serde(rename = "perkIds")] + pub perk_ids: Vec, + ///Primary runes path + #[serde(rename = "perkStyle")] + pub perk_style: i64, + ///Secondary runes path + #[serde(rename = "perkSubStyle")] + pub perk_sub_style: i64, + } + ///`spectator-tft-v5.GameCustomizationObject` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct GameCustomizationObject { + ///Category identifier for Game Customization + #[serde(rename = "category")] + pub category: String, + ///Game Customization content + #[serde(rename = "content")] + pub content: String, + } + ///`spectator-tft-v5.FeaturedGames` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FeaturedGames { + ///The list of featured games + #[serde(rename = "gameList")] + pub game_list: Vec, + ///The suggested interval to wait before requesting FeaturedGames again + #[serde( + rename = "clientRefreshInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub client_refresh_interval: Option, + } + ///`spectator-tft-v5.FeaturedGameInfo` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FeaturedGameInfo { + ///The game mode + ///(Legal values: TFT) + #[serde(rename = "gameMode")] + pub game_mode: crate::consts::GameMode, + ///The amount of time in seconds that has passed since the game started + #[serde(rename = "gameLength")] + pub game_length: i64, + ///The ID of the map + #[serde(rename = "mapId")] + pub map_id: crate::consts::Map, + ///The game type + ///(Legal values: MATCHED) + #[serde(rename = "gameType")] + pub game_type: crate::consts::GameType, + ///Banned champion information + #[serde(rename = "bannedChampions")] + pub banned_champions: Vec, + ///The ID of the game + #[serde(rename = "gameId")] + pub game_id: i64, + #[serde(rename = "observers")] + pub observers: crate::models::spectator_tft_v5::Observer, + ///The queue type (queue types are documented on the Game Constants page) + #[serde(rename = "gameQueueConfigId")] + pub game_queue_config_id: crate::consts::Queue, + ///The participant information + #[serde(rename = "participants")] + pub participants: Vec, + ///The ID of the platform on which the game is being played + #[serde(rename = "platformId")] + pub platform_id: String, + } + ///`spectator-tft-v5.Participant` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Participant { + ///The ID of the second summoner spell used by this participant + #[serde(rename = "spell2Id")] + pub spell2_id: i64, + ///The ID of the profile icon used by this participant + #[serde(rename = "profileIconId")] + pub profile_icon_id: i64, + ///Encrypted summoner ID of this participant + #[serde(rename = "summonerId", default, skip_serializing_if = "Option::is_none")] + pub summoner_id: Option, + ///Encrypted puuid of this participant + #[serde(rename = "puuid", default, skip_serializing_if = "Option::is_none")] + pub puuid: Option, + ///The ID of the champion played by this participant + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + ///The team ID of this participant, indicating the participant's team + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + ///The ID of the first summoner spell used by this participant + #[serde(rename = "spell1Id")] + pub spell1_id: i64, + #[serde(rename = "riotId", default, skip_serializing_if = "Option::is_none")] + pub riot_id: Option, + } +} +///Data structs used by [`SpectatorV5`](crate::endpoints::SpectatorV5) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod spectator_v5 { + ///`spectator-v5.CurrentGameInfo` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct CurrentGameInfo { + ///The ID of the game + #[serde(rename = "gameId")] + pub game_id: i64, + ///The game type + #[serde(rename = "gameType")] + pub game_type: crate::consts::GameType, + ///The game start time represented in epoch milliseconds + #[serde(rename = "gameStartTime")] + pub game_start_time: i64, + ///The ID of the map + #[serde(rename = "mapId")] + pub map_id: crate::consts::Map, + ///The amount of time in seconds that has passed since the game started + #[serde(rename = "gameLength")] + pub game_length: i64, + ///The ID of the platform on which the game is being played + #[serde(rename = "platformId")] + pub platform_id: String, + ///The game mode + #[serde(rename = "gameMode")] + pub game_mode: crate::consts::GameMode, + ///Banned champion information + #[serde(rename = "bannedChampions")] + pub banned_champions: Vec, + ///The queue type (queue types are documented on the Game Constants page) + #[serde( + rename = "gameQueueConfigId", + default, + skip_serializing_if = "Option::is_none" + )] + pub game_queue_config_id: Option, + #[serde(rename = "observers")] + pub observers: crate::models::spectator_v5::Observer, + ///The participant information + #[serde(rename = "participants")] + pub participants: Vec, + } + ///`spectator-v5.BannedChampion` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct BannedChampion { + ///The turn during which the champion was banned + #[serde(rename = "pickTurn")] + pub pick_turn: i32, + ///The ID of the banned champion + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + ///The ID of the team that banned the champion + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + } + ///`spectator-v5.Observer` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Observer { + ///Key used to decrypt the spectator grid game data for playback + #[serde(rename = "encryptionKey")] + pub encryption_key: String, + } + ///`spectator-v5.CurrentGameParticipant` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct CurrentGameParticipant { + ///The ID of the champion played by this participant + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + #[serde(rename = "perks", default, skip_serializing_if = "Option::is_none")] + pub perks: Option, + ///The ID of the profile icon used by this participant + #[serde(rename = "profileIconId")] + pub profile_icon_id: i64, + ///Flag indicating whether or not this participant is a bot + #[serde(rename = "bot")] + pub bot: bool, + ///The team ID of this participant, indicating the participant's team + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + ///The encrypted summoner ID of this participant + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///The encrypted puuid of this participant + #[serde(rename = "puuid", default, skip_serializing_if = "Option::is_none")] + pub puuid: Option, + ///The ID of the first summoner spell used by this participant + #[serde(rename = "spell1Id")] + pub spell1_id: i64, + ///The ID of the second summoner spell used by this participant + #[serde(rename = "spell2Id")] + pub spell2_id: i64, + ///List of Game Customizations + #[serde(rename = "gameCustomizationObjects")] + pub game_customization_objects: Vec< + crate::models::spectator_v5::GameCustomizationObject, + >, + #[serde(rename = "riotId", default, skip_serializing_if = "Option::is_none")] + pub riot_id: Option, + } + ///`spectator-v5.Perks` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Perks { + ///IDs of the perks/runes assigned. + #[serde(rename = "perkIds")] + pub perk_ids: Vec, + ///Primary runes path + #[serde(rename = "perkStyle")] + pub perk_style: i64, + ///Secondary runes path + #[serde(rename = "perkSubStyle")] + pub perk_sub_style: i64, + } + ///`spectator-v5.GameCustomizationObject` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct GameCustomizationObject { + ///Category identifier for Game Customization + #[serde(rename = "category")] + pub category: String, + ///Game Customization content + #[serde(rename = "content")] + pub content: String, + } + ///`spectator-v5.FeaturedGames` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FeaturedGames { + ///The list of featured games + #[serde(rename = "gameList")] + pub game_list: Vec, + ///The suggested interval to wait before requesting FeaturedGames again + #[serde( + rename = "clientRefreshInterval", + default, + skip_serializing_if = "Option::is_none" + )] + pub client_refresh_interval: Option, + } + ///`spectator-v5.FeaturedGameInfo` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FeaturedGameInfo { + ///The game mode + ///(Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO) + #[serde(rename = "gameMode")] + pub game_mode: crate::consts::GameMode, + ///The amount of time in seconds that has passed since the game started + #[serde(rename = "gameLength")] + pub game_length: i64, + ///The ID of the map + #[serde(rename = "mapId")] + pub map_id: crate::consts::Map, + ///The game type + ///(Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME) + #[serde(rename = "gameType")] + pub game_type: crate::consts::GameType, + ///Banned champion information + #[serde(rename = "bannedChampions")] + pub banned_champions: Vec, + ///The ID of the game + #[serde(rename = "gameId")] + pub game_id: i64, + #[serde(rename = "observers")] + pub observers: crate::models::spectator_v5::Observer, + ///The queue type (queue types are documented on the Game Constants page) + #[serde(rename = "gameQueueConfigId")] + pub game_queue_config_id: crate::consts::Queue, + ///The participant information + #[serde(rename = "participants")] + pub participants: Vec, + ///The ID of the platform on which the game is being played + #[serde(rename = "platformId")] + pub platform_id: String, + } + ///`spectator-v5.Participant` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Participant { + ///Flag indicating whether or not this participant is a bot + #[serde(rename = "bot")] + pub bot: bool, + ///The ID of the second summoner spell used by this participant + #[serde(rename = "spell2Id")] + pub spell2_id: i64, + ///The ID of the profile icon used by this participant + #[serde(rename = "profileIconId")] + pub profile_icon_id: i64, + ///Encrypted summoner ID of this participant + #[serde(rename = "summonerId", default, skip_serializing_if = "Option::is_none")] + pub summoner_id: Option, + ///Encrypted puuid of this participant + #[serde(rename = "puuid", default, skip_serializing_if = "Option::is_none")] + pub puuid: Option, + ///The ID of the champion played by this participant + #[serde(rename = "championId")] + pub champion_id: crate::consts::Champion, + ///The team ID of this participant, indicating the participant's team + #[serde(rename = "teamId")] + pub team_id: crate::consts::Team, + ///The ID of the first summoner spell used by this participant + #[serde(rename = "spell1Id")] + pub spell1_id: i64, + #[serde(rename = "riotId", default, skip_serializing_if = "Option::is_none")] + pub riot_id: Option, + } +} +///Data structs used by [`SummonerV4`](crate::endpoints::SummonerV4) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod summoner_v4 { + ///`summoner-v4.SummonerDTO` data object. + /// + ///# Description + ///represents a summoner + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Summoner { + ///Encrypted account ID. Max length 56 characters. + #[serde(rename = "accountId")] + pub account_id: String, + ///ID of the summoner icon associated with the summoner. + #[serde(rename = "profileIconId")] + pub profile_icon_id: i32, + ///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")] + pub revision_date: i64, + ///Encrypted summoner ID. Max length 63 characters. + #[serde(rename = "id")] + pub id: String, + ///Encrypted PUUID. Exact length of 78 characters. + #[serde(rename = "puuid")] + pub puuid: String, + ///Summoner level associated with the summoner. + #[serde(rename = "summonerLevel")] + pub summoner_level: i64, + } +} +///Data structs used by [`TftLeagueV1`](crate::endpoints::TftLeagueV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod tft_league_v1 { + ///`tft-league-v1.LeagueListDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueList { + #[serde(rename = "leagueId", default, skip_serializing_if = "Option::is_none")] + pub league_id: Option, + #[serde(rename = "entries")] + pub entries: Vec, + #[serde(rename = "tier")] + pub tier: crate::consts::Tier, + #[serde(rename = "name", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(rename = "queue", default, skip_serializing_if = "Option::is_none")] + pub queue: Option, + } + ///`tft-league-v1.LeagueItemDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueItem { + #[serde(rename = "freshBlood")] + pub fresh_blood: bool, + ///First placement. + #[serde(rename = "wins")] + pub wins: i32, + #[serde(rename = "miniSeries", default, skip_serializing_if = "Option::is_none")] + pub mini_series: Option, + #[serde(rename = "inactive")] + pub inactive: bool, + #[serde(rename = "veteran")] + pub veteran: bool, + #[serde(rename = "hotStreak")] + pub hot_streak: bool, + #[serde(rename = "rank")] + pub rank: crate::consts::Division, + #[serde(rename = "leaguePoints")] + pub league_points: i32, + ///Second through eighth placement. + #[serde(rename = "losses")] + pub losses: i32, + ///Player's encrypted summonerId. + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///Player's encrypted puuid. + #[serde(rename = "puuid")] + pub puuid: String, + } + ///`tft-league-v1.MiniSeriesDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MiniSeries { + #[serde(rename = "losses")] + pub losses: i32, + #[serde(rename = "progress")] + pub progress: String, + #[serde(rename = "target")] + pub target: i32, + #[serde(rename = "wins")] + pub wins: i32, + } + ///`tft-league-v1.LeagueEntryDTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LeagueEntry { + ///Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) + #[serde(rename = "puuid", default, skip_serializing_if = "Option::is_none")] + pub puuid: Option, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "leagueId", default, skip_serializing_if = "Option::is_none")] + pub league_id: Option, + ///Player's encrypted summonerId. + #[serde(rename = "summonerId")] + pub summoner_id: String, + #[serde(rename = "queueType")] + pub queue_type: crate::consts::QueueType, + ///Only included for the RANKED_TFT_TURBO queueType. + ///(Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY) + #[serde(rename = "ratedTier", default, skip_serializing_if = "Option::is_none")] + pub rated_tier: Option, + ///Only included for the RANKED_TFT_TURBO queueType. + #[serde( + rename = "ratedRating", + default, + skip_serializing_if = "Option::is_none" + )] + pub rated_rating: Option, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "tier", default, skip_serializing_if = "Option::is_none")] + pub tier: Option, + ///The player's division within a tier. Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "rank", default, skip_serializing_if = "Option::is_none")] + pub rank: Option, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde( + rename = "leaguePoints", + default, + skip_serializing_if = "Option::is_none" + )] + pub league_points: Option, + ///First placement. + #[serde(rename = "wins")] + pub wins: i32, + ///Second through eighth placement. + #[serde(rename = "losses")] + pub losses: i32, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "hotStreak", default, skip_serializing_if = "Option::is_none")] + pub hot_streak: Option, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "veteran", default, skip_serializing_if = "Option::is_none")] + pub veteran: Option, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "freshBlood", default, skip_serializing_if = "Option::is_none")] + pub fresh_blood: Option, + ///Not included for the RANKED_TFT_TURBO queueType. + #[serde(rename = "inactive", default, skip_serializing_if = "Option::is_none")] + pub inactive: Option, + #[serde(rename = "miniSeries", default, skip_serializing_if = "Option::is_none")] + pub mini_series: Option, + } + ///`tft-league-v1.TopRatedLadderEntryDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TopRatedLadderEntry { + #[serde(rename = "summonerId")] + pub summoner_id: String, + ///(Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY) + #[serde(rename = "ratedTier")] + pub rated_tier: String, + #[serde(rename = "ratedRating")] + pub rated_rating: i32, + ///First placement. + #[serde(rename = "wins")] + pub wins: i32, + #[serde(rename = "previousUpdateLadderPosition")] + pub previous_update_ladder_position: i32, + } +} +///Data structs used by [`TftMatchV1`](crate::endpoints::TftMatchV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod tft_match_v1 { + ///`tft-match-v1.MatchDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Match { + #[serde(rename = "metadata")] + pub metadata: crate::models::tft_match_v1::Metadata, + #[serde(rename = "info")] + pub info: crate::models::tft_match_v1::Info, + } + ///`tft-match-v1.MetadataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + 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 participant PUUIDs. + #[serde(rename = "participants")] + pub participants: Vec, + } + ///`tft-match-v1.InfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Info { + ///Unix timestamp. + #[serde(rename = "game_datetime")] + pub game_datetime: i64, + ///Game length in seconds. + #[serde(rename = "game_length")] + pub game_length: f32, + ///Game variation key. Game variations documented in TFT static data. + #[serde( + rename = "game_variation", + default, + skip_serializing_if = "Option::is_none" + )] + pub game_variation: Option, + ///Game client version. + #[serde(rename = "game_version")] + pub game_version: String, + #[serde(rename = "participants")] + pub participants: Vec, + ///Please refer to the League of Legends documentation. + #[serde(rename = "queue_id")] + pub queue_id: crate::consts::Queue, + ///Teamfight Tactics set number. + #[serde(rename = "tft_set_number")] + pub tft_set_number: i32, + #[serde( + rename = "tft_game_type", + default, + skip_serializing_if = "Option::is_none" + )] + pub tft_game_type: Option, + #[serde( + rename = "tft_set_core_name", + default, + skip_serializing_if = "Option::is_none" + )] + pub tft_set_core_name: Option, + #[serde( + rename = "endOfGameResult", + default, + skip_serializing_if = "Option::is_none" + )] + pub end_of_game_result: Option, + #[serde( + rename = "gameCreation", + default, + skip_serializing_if = "Option::is_none" + )] + pub game_creation: Option, + #[serde(rename = "gameId", default, skip_serializing_if = "Option::is_none")] + pub game_id: Option, + #[serde(rename = "mapId", default, skip_serializing_if = "Option::is_none")] + pub map_id: Option, + ///Please refer to the League of Legends documentation. + #[serde(rename = "queueId", default, skip_serializing_if = "Option::is_none")] + pub queue_id_: Option, + } + ///`tft-match-v1.ParticipantDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Participant { + #[serde(rename = "companion")] + pub companion: crate::models::tft_match_v1::Companion, + ///Gold left after participant was eliminated. + #[serde(rename = "gold_left")] + pub gold_left: i32, + ///The round the participant was eliminated in. Note: If the player was eliminated in stage 2-1 their last_round would be 5. + #[serde(rename = "last_round")] + pub last_round: i32, + ///Participant Little Legend level. Note: This is not the number of active units. + #[serde(rename = "level")] + pub level: i32, + ///Participant placement upon elimination. + #[serde(rename = "placement")] + pub placement: i32, + ///Number of players the participant eliminated. + #[serde(rename = "players_eliminated")] + pub players_eliminated: i32, + #[serde(rename = "puuid")] + pub puuid: String, + #[serde( + rename = "riotIdGameName", + default, + skip_serializing_if = "Option::is_none" + )] + pub riot_id_game_name: Option, + #[serde( + rename = "riotIdTagline", + default, + skip_serializing_if = "Option::is_none" + )] + pub riot_id_tagline: Option, + ///The number of seconds before the participant was eliminated. + #[serde(rename = "time_eliminated")] + pub time_eliminated: f32, + ///Damage the participant dealt to other players. + #[serde(rename = "total_damage_to_players")] + pub total_damage_to_players: i32, + ///A complete list of traits for the participant's active units. + #[serde(rename = "traits")] + pub traits: Vec, + ///A list of active units for the participant. + #[serde(rename = "units")] + pub units: Vec, + #[serde(rename = "augments", default, skip_serializing_if = "Option::is_none")] + pub augments: Option>, + #[serde( + rename = "partner_group_id", + default, + skip_serializing_if = "Option::is_none" + )] + pub partner_group_id: Option, + #[serde(rename = "missions", default, skip_serializing_if = "Option::is_none")] + pub missions: Option, + #[serde(rename = "win", default, skip_serializing_if = "Option::is_none")] + pub win: Option, + #[serde(rename = "skill_tree", default, skip_serializing_if = "Option::is_none")] + pub skill_tree: Option<::std::collections::HashMap>, + } + ///`tft-match-v1.TraitDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Trait { + ///Trait name. + #[serde(rename = "name")] + pub name: String, + ///Number of units with this trait. + #[serde(rename = "num_units")] + pub num_units: i32, + ///Current style for this trait. (0 = No style, 1 = Bronze, 2 = Silver, 3 = Gold, 4 = Chromatic) + #[serde(rename = "style", default, skip_serializing_if = "Option::is_none")] + pub style: Option, + ///Current active tier for the trait. + #[serde(rename = "tier_current")] + pub tier_current: i32, + ///Total tiers for the trait. + #[serde(rename = "tier_total", default, skip_serializing_if = "Option::is_none")] + pub tier_total: Option, + } + ///`tft-match-v1.UnitDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Unit { + ///A list of the unit's items. Please refer to the Teamfight Tactics documentation for item ids. + #[serde(rename = "items", default, skip_serializing_if = "Option::is_none")] + pub items: Option>, + ///This field was introduced in patch 9.22 with data_version 2. + #[serde(rename = "character_id")] + pub character_id: String, + ///If a unit is chosen as part of the Fates set mechanic, the chosen trait will be indicated by this field. Otherwise this field is excluded from the response. + #[serde(rename = "chosen", default, skip_serializing_if = "Option::is_none")] + pub chosen: Option, + ///Unit name. This field is often left blank. + #[serde(rename = "name")] + pub name: String, + ///Unit rarity. This doesn't equate to the unit cost. + #[serde(rename = "rarity")] + pub rarity: i32, + ///Unit tier. + #[serde(rename = "tier")] + pub tier: i32, + #[serde(rename = "itemNames", default, skip_serializing_if = "Option::is_none")] + pub item_names: Option>, + } + ///`tft-match-v1.CompanionDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Companion { + #[serde(rename = "item_ID", default, skip_serializing_if = "Option::is_none")] + pub item_id: Option, + #[serde(rename = "skin_ID")] + pub skin_id: i32, + #[serde(rename = "content_ID")] + pub content_id: String, + #[serde(rename = "species")] + pub species: String, + } + ///`tft-match-v1.ParticipantMissionsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ParticipantMissions { + #[serde(rename = "Assists", default, skip_serializing_if = "Option::is_none")] + pub assists: Option, + #[serde( + rename = "DamageDealt", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_dealt: Option, + #[serde( + rename = "DamageDealtToObjectives", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_dealt_to_objectives: Option, + #[serde( + rename = "DamageDealtToTurrets", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_dealt_to_turrets: Option, + #[serde( + rename = "DamageTaken", + default, + skip_serializing_if = "Option::is_none" + )] + pub damage_taken: Option, + #[serde( + rename = "DoubleKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub double_kills: Option, + #[serde(rename = "GoldEarned", default, skip_serializing_if = "Option::is_none")] + pub gold_earned: Option, + #[serde(rename = "GoldSpent", default, skip_serializing_if = "Option::is_none")] + pub gold_spent: Option, + #[serde( + rename = "InhibitorsDestroyed", + default, + skip_serializing_if = "Option::is_none" + )] + pub inhibitors_destroyed: Option, + #[serde(rename = "Kills", default, skip_serializing_if = "Option::is_none")] + pub kills: Option, + #[serde( + rename = "LargestKillingSpree", + default, + skip_serializing_if = "Option::is_none" + )] + pub largest_killing_spree: Option, + #[serde( + rename = "LargestMultiKill", + default, + skip_serializing_if = "Option::is_none" + )] + pub largest_multi_kill: Option, + #[serde( + rename = "MagicDamageDealt", + default, + skip_serializing_if = "Option::is_none" + )] + pub magic_damage_dealt: Option, + #[serde( + rename = "MagicDamageDealtToChampions", + default, + skip_serializing_if = "Option::is_none" + )] + pub magic_damage_dealt_to_champions: Option, + #[serde( + rename = "NeutralMinionsKilledTeamJungle", + default, + skip_serializing_if = "Option::is_none" + )] + pub neutral_minions_killed_team_jungle: Option, + #[serde( + rename = "PhysicalDamageDealt", + default, + skip_serializing_if = "Option::is_none" + )] + pub physical_damage_dealt: Option, + #[serde( + rename = "PhysicalDamageTaken", + default, + skip_serializing_if = "Option::is_none" + )] + pub physical_damage_taken: Option, + #[serde( + rename = "PlayerScore0", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score0: Option, + #[serde( + rename = "PlayerScore1", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score1: Option, + #[serde( + rename = "PlayerScore2", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score2: Option, + #[serde( + rename = "PlayerScore3", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score3: Option, + #[serde( + rename = "PlayerScore4", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score4: Option, + #[serde( + rename = "PlayerScore5", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score5: Option, + #[serde( + rename = "PlayerScore6", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score6: Option, + #[serde( + rename = "PlayerScore9", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score9: Option, + #[serde( + rename = "PlayerScore10", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score10: Option, + #[serde( + rename = "PlayerScore11", + default, + skip_serializing_if = "Option::is_none" + )] + pub player_score11: Option, + #[serde( + rename = "QuadraKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub quadra_kills: Option, + #[serde( + rename = "Spell1Casts", + default, + skip_serializing_if = "Option::is_none" + )] + pub spell1_casts: Option, + #[serde( + rename = "Spell2Casts", + default, + skip_serializing_if = "Option::is_none" + )] + pub spell2_casts: Option, + #[serde( + rename = "Spell3Casts", + default, + skip_serializing_if = "Option::is_none" + )] + pub spell3_casts: Option, + #[serde( + rename = "Spell4Casts", + default, + skip_serializing_if = "Option::is_none" + )] + pub spell4_casts: Option, + #[serde( + rename = "SummonerSpell1Casts", + default, + skip_serializing_if = "Option::is_none" + )] + pub summoner_spell1_casts: Option, + #[serde( + rename = "TimeCCOthers", + default, + skip_serializing_if = "Option::is_none" + )] + pub time_cc_others: Option, + #[serde( + rename = "TotalMinionsKilled", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_minions_killed: Option, + #[serde( + rename = "TrueDamageDealtToChampions", + default, + skip_serializing_if = "Option::is_none" + )] + pub true_damage_dealt_to_champions: Option, + #[serde( + rename = "UnrealKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub unreal_kills: Option, + #[serde( + rename = "VisionScore", + default, + skip_serializing_if = "Option::is_none" + )] + pub vision_score: Option, + #[serde( + rename = "WardsKilled", + default, + skip_serializing_if = "Option::is_none" + )] + pub wards_killed: Option, + #[serde(rename = "Deaths", default, skip_serializing_if = "Option::is_none")] + pub deaths: Option, + #[serde( + rename = "KillingSprees", + default, + skip_serializing_if = "Option::is_none" + )] + pub killing_sprees: Option, + #[serde( + rename = "MagicDamageTaken", + default, + skip_serializing_if = "Option::is_none" + )] + pub magic_damage_taken: Option, + #[serde(rename = "PentaKills", default, skip_serializing_if = "Option::is_none")] + pub penta_kills: Option, + #[serde( + rename = "PhysicalDamageDealtToChampions", + default, + skip_serializing_if = "Option::is_none" + )] + pub physical_damage_dealt_to_champions: Option, + #[serde( + rename = "TotalDamageDealtToChampions", + default, + skip_serializing_if = "Option::is_none" + )] + pub total_damage_dealt_to_champions: Option, + #[serde( + rename = "TripleKills", + default, + skip_serializing_if = "Option::is_none" + )] + pub triple_kills: Option, + #[serde( + rename = "TrueDamageDealt", + default, + skip_serializing_if = "Option::is_none" + )] + pub true_damage_dealt: Option, + #[serde( + rename = "TrueDamageTaken", + default, + skip_serializing_if = "Option::is_none" + )] + pub true_damage_taken: Option, + } +} +///Data structs used by [`TftStatusV1`](crate::endpoints::TftStatusV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod tft_status_v1 { + ///`tft-status-v1.PlatformDataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlatformData { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "locales")] + pub locales: Vec, + #[serde(rename = "maintenances")] + pub maintenances: Vec, + #[serde(rename = "incidents")] + pub incidents: Vec, + } + ///`tft-status-v1.StatusDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Status { + #[serde(rename = "id")] + pub id: i32, + ///(Legal values: scheduled, in_progress, complete) + #[serde(rename = "maintenance_status")] + pub maintenance_status: String, + ///(Legal values: info, warning, critical) + #[serde(rename = "incident_severity")] + pub incident_severity: String, + #[serde(rename = "titles")] + pub titles: Vec, + #[serde(rename = "updates")] + pub updates: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "archive_at")] + pub archive_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + ///(Legal values: windows, macos, android, ios, ps4, xbone, switch) + #[serde(rename = "platforms")] + pub platforms: Vec, + } + ///`tft-status-v1.ContentDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Content { + #[serde(rename = "locale")] + pub locale: String, + #[serde(rename = "content")] + pub content: String, + } + ///`tft-status-v1.UpdateDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Update { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "author")] + pub author: String, + #[serde(rename = "publish")] + pub publish: bool, + ///(Legal values: riotclient, riotstatus, game) + #[serde(rename = "publish_locations")] + pub publish_locations: Vec, + #[serde(rename = "translations")] + pub translations: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + } +} +///Data structs used by [`TftSummonerV1`](crate::endpoints::TftSummonerV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod tft_summoner_v1 { + ///`tft-summoner-v1.SummonerDTO` data object. + /// + ///# Description + ///represents a summoner + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Summoner { + ///Encrypted account ID. Max length 56 characters. + #[serde(rename = "accountId")] + pub account_id: String, + ///ID of the summoner icon associated with the summoner. + #[serde(rename = "profileIconId")] + pub profile_icon_id: i32, + ///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")] + pub revision_date: i64, + ///Encrypted summoner ID. Max length 63 characters. + #[serde(rename = "id")] + pub id: String, + ///Encrypted PUUID. Exact length of 78 characters. + #[serde(rename = "puuid")] + pub puuid: String, + ///Summoner level associated with the summoner. + #[serde(rename = "summonerLevel")] + pub summoner_level: i64, + } +} +///Data structs used by [`TournamentStubV5`](crate::endpoints::TournamentStubV5) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod tournament_stub_v5 { + ///`tournament-stub-v5.TournamentCodeParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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", + default, + skip_serializing_if = "Option::is_none" + )] + pub allowed_participants: Option>, + ///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", default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + ///The team size of the game. Valid values are 1-5. + #[serde(rename = "teamSize")] + pub team_size: i32, + ///The pick type of the game. + ///(Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT) + #[serde(rename = "pickType")] + pub pick_type: String, + ///The map type of the game. + ///(Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) + #[serde(rename = "mapType")] + pub map_type: String, + ///The spectator type of the game. + ///(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, + } + ///`tournament-stub-v5.TournamentCodeV5DTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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. + ///(Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR) + #[serde(rename = "region")] + pub region: crate::consts::TournamentRegion, + ///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: Vec, + } + ///`tournament-stub-v5.LobbyEventV5DTOWrapper` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LobbyEventV5Wrapper { + #[serde(rename = "eventList")] + pub event_list: Vec, + } + ///`tournament-stub-v5.LobbyEventV5DTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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, + } + ///`tournament-stub-v5.ProviderRegistrationParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ProviderRegistrationParametersV5 { + ///The region in which the provider will be running tournaments. + ///(Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR) + #[serde(rename = "region")] + pub region: crate::consts::TournamentRegion, + ///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, + } + ///`tournament-stub-v5.TournamentRegistrationParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + } +} +///Data structs used by [`TournamentV5`](crate::endpoints::TournamentV5) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod tournament_v5 { + ///`tournament-v5.TournamentCodeParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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", + default, + skip_serializing_if = "Option::is_none" + )] + pub allowed_participants: Option>, + ///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", default, skip_serializing_if = "Option::is_none")] + pub metadata: Option, + ///The team size of the game. Valid values are 1-5. + #[serde(rename = "teamSize")] + pub team_size: i32, + ///The pick type of the game. + ///(Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT) + #[serde(rename = "pickType")] + pub pick_type: String, + ///The map type of the game. + ///(Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) + #[serde(rename = "mapType")] + pub map_type: String, + ///The spectator type of the game. + ///(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, + } + ///`tournament-v5.TournamentCodeV5DTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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. + ///(Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR, PH, SG, TH, TW, VN) + #[serde(rename = "region")] + pub region: crate::consts::TournamentRegion, + ///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: Vec, + } + ///`tournament-v5.TournamentCodeUpdateParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TournamentCodeUpdateParametersV5 { + ///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", + default, + skip_serializing_if = "Option::is_none" + )] + pub allowed_participants: Option>, + ///The pick type + ///(Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT) + #[serde(rename = "pickType")] + pub pick_type: String, + ///The map type + ///(Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) + #[serde(rename = "mapType")] + pub map_type: String, + ///The spectator type + ///(Legal values: NONE, LOBBYONLY, ALL) + #[serde(rename = "spectatorType")] + pub spectator_type: String, + } + ///`tournament-v5.TournamentGamesV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TournamentGamesV5 { + #[serde(rename = "winningTeam")] + pub winning_team: Vec, + #[serde(rename = "losingTeam")] + pub losing_team: Vec, + ///Tournament Code + #[serde(rename = "shortCode")] + pub short_code: String, + ///Metadata for the TournamentCode + #[serde(rename = "metaData", default, skip_serializing_if = "Option::is_none")] + pub meta_data: Option, + #[serde(rename = "gameId")] + pub game_id: i64, + #[serde(rename = "gameName")] + pub game_name: String, + #[serde(rename = "gameType")] + pub game_type: String, + ///Game Map ID + #[serde(rename = "gameMap")] + pub game_map: i32, + #[serde(rename = "gameMode")] + pub game_mode: String, + ///Region of the game + #[serde(rename = "region")] + pub region: crate::consts::TournamentRegion, + } + ///`tournament-v5.TournamentTeamV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TournamentTeamV5 { + ///Player Unique UUID (Encrypted) + #[serde(rename = "puuid")] + pub puuid: String, + } + ///`tournament-v5.LobbyEventV5DTOWrapper` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LobbyEventV5Wrapper { + #[serde(rename = "eventList")] + pub event_list: Vec, + } + ///`tournament-v5.LobbyEventV5DTO` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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, + } + ///`tournament-v5.ProviderRegistrationParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ProviderRegistrationParametersV5 { + ///The region in which the provider will be running tournaments. + ///(Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR, PH, SG, TH, TW, VN) + #[serde(rename = "region")] + pub region: crate::consts::TournamentRegion, + ///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, + } + ///`tournament-v5.TournamentRegistrationParametersV5` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::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", default, skip_serializing_if = "Option::is_none")] + pub name: Option, + } +} +///Data structs used by [`ValConsoleMatchV1`](crate::endpoints::ValConsoleMatchV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod val_console_match_v1 { + ///`val-console-match-v1.MatchDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Match { + #[serde(rename = "matchInfo")] + pub match_info: crate::models::val_console_match_v1::MatchInfo, + #[serde(rename = "players")] + pub players: Vec, + #[serde(rename = "coaches")] + pub coaches: Vec, + #[serde(rename = "teams")] + pub teams: Vec, + #[serde(rename = "roundResults")] + pub round_results: Vec, + } + ///`val-console-match-v1.MatchInfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MatchInfo { + #[serde(rename = "matchId")] + pub match_id: String, + #[serde(rename = "mapId")] + pub map_id: String, + #[serde(rename = "gameLengthMillis")] + pub game_length_millis: i32, + #[serde(rename = "gameStartMillis")] + pub game_start_millis: i64, + #[serde(rename = "provisioningFlowId")] + pub provisioning_flow_id: String, + #[serde(rename = "isCompleted")] + pub is_completed: bool, + #[serde(rename = "customGameName")] + pub custom_game_name: String, + #[serde(rename = "queueId")] + pub queue_id: String, + #[serde(rename = "gameMode")] + pub game_mode: String, + #[serde(rename = "isRanked")] + pub is_ranked: bool, + #[serde(rename = "seasonId")] + pub season_id: String, + } + ///`val-console-match-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Player { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "gameName")] + pub game_name: String, + #[serde(rename = "tagLine")] + pub tag_line: String, + #[serde(rename = "teamId")] + pub team_id: String, + #[serde(rename = "partyId")] + pub party_id: String, + #[serde(rename = "characterId")] + pub character_id: String, + #[serde(rename = "stats")] + pub stats: crate::models::val_console_match_v1::PlayerStats, + #[serde(rename = "competitiveTier")] + pub competitive_tier: i32, + #[serde(rename = "playerCard")] + pub player_card: String, + #[serde(rename = "playerTitle")] + pub player_title: String, + } + ///`val-console-match-v1.PlayerStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerStats { + #[serde(rename = "score")] + pub score: i32, + #[serde(rename = "roundsPlayed")] + pub rounds_played: i32, + #[serde(rename = "kills")] + pub kills: i32, + #[serde(rename = "deaths")] + pub deaths: i32, + #[serde(rename = "assists")] + pub assists: i32, + #[serde(rename = "playtimeMillis")] + pub playtime_millis: i32, + #[serde(rename = "abilityCasts")] + pub ability_casts: crate::models::val_console_match_v1::AbilityCasts, + } + ///`val-console-match-v1.AbilityCastsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct AbilityCasts { + #[serde(rename = "grenadeCasts")] + pub grenade_casts: i32, + #[serde(rename = "ability1Casts")] + pub ability1_casts: i32, + #[serde(rename = "ability2Casts")] + pub ability2_casts: i32, + #[serde(rename = "ultimateCasts")] + pub ultimate_casts: i32, + } + ///`val-console-match-v1.CoachDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Coach { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "teamId")] + pub team_id: String, + } + ///`val-console-match-v1.TeamDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Team { + ///This is an arbitrary string. Red and Blue in bomb modes. The puuid of the player in deathmatch. + #[serde(rename = "teamId")] + pub team_id: String, + #[serde(rename = "won")] + pub won: bool, + #[serde(rename = "roundsPlayed")] + pub rounds_played: i32, + #[serde(rename = "roundsWon")] + pub rounds_won: i32, + ///Team points scored. Number of kills in deathmatch. + #[serde(rename = "numPoints")] + pub num_points: i32, + } + ///`val-console-match-v1.RoundResultDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct RoundResult { + #[serde(rename = "roundNum")] + pub round_num: i32, + #[serde(rename = "roundResult")] + pub round_result: String, + #[serde(rename = "roundCeremony")] + pub round_ceremony: String, + #[serde(rename = "winningTeam")] + pub winning_team: String, + ///PUUID of player + #[serde(rename = "bombPlanter")] + pub bomb_planter: String, + ///PUUID of player + #[serde(rename = "bombDefuser")] + pub bomb_defuser: String, + #[serde(rename = "plantRoundTime")] + pub plant_round_time: i32, + #[serde(rename = "plantPlayerLocations")] + pub plant_player_locations: Vec< + crate::models::val_console_match_v1::PlayerLocations, + >, + #[serde(rename = "plantLocation")] + pub plant_location: crate::models::val_console_match_v1::Location, + #[serde(rename = "plantSite")] + pub plant_site: String, + #[serde(rename = "defuseRoundTime")] + pub defuse_round_time: i32, + #[serde(rename = "defusePlayerLocations")] + pub defuse_player_locations: Vec< + crate::models::val_console_match_v1::PlayerLocations, + >, + #[serde(rename = "defuseLocation")] + pub defuse_location: crate::models::val_console_match_v1::Location, + #[serde(rename = "playerStats")] + pub player_stats: Vec, + #[serde(rename = "roundResultCode")] + pub round_result_code: String, + } + ///`val-console-match-v1.PlayerLocationsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerLocations { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "viewRadians")] + pub view_radians: f32, + #[serde(rename = "location")] + pub location: crate::models::val_console_match_v1::Location, + } + ///`val-console-match-v1.LocationDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Location { + #[serde(rename = "x")] + pub x: i32, + #[serde(rename = "y")] + pub y: i32, + } + ///`val-console-match-v1.PlayerRoundStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerRoundStats { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "kills")] + pub kills: Vec, + #[serde(rename = "damage")] + pub damage: Vec, + #[serde(rename = "score")] + pub score: i32, + #[serde(rename = "economy")] + pub economy: crate::models::val_console_match_v1::Economy, + #[serde(rename = "ability")] + pub ability: crate::models::val_console_match_v1::Ability, + } + ///`val-console-match-v1.KillDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Kill { + #[serde(rename = "timeSinceGameStartMillis")] + pub time_since_game_start_millis: i32, + #[serde(rename = "timeSinceRoundStartMillis")] + pub time_since_round_start_millis: i32, + ///PUUID + #[serde(rename = "killer")] + pub killer: String, + ///PUUID + #[serde(rename = "victim")] + pub victim: String, + #[serde(rename = "victimLocation")] + pub victim_location: crate::models::val_console_match_v1::Location, + ///List of PUUIDs + #[serde(rename = "assistants")] + pub assistants: Vec, + #[serde(rename = "playerLocations")] + pub player_locations: Vec, + #[serde(rename = "finishingDamage")] + pub finishing_damage: crate::models::val_console_match_v1::FinishingDamage, + } + ///`val-console-match-v1.FinishingDamageDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FinishingDamage { + #[serde(rename = "damageType")] + pub damage_type: String, + #[serde(rename = "damageItem")] + pub damage_item: String, + #[serde(rename = "isSecondaryFireMode")] + pub is_secondary_fire_mode: bool, + } + ///`val-console-match-v1.DamageDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Damage { + ///PUUID + #[serde(rename = "receiver")] + pub receiver: String, + #[serde(rename = "damage")] + pub damage: i32, + #[serde(rename = "legshots")] + pub legshots: i32, + #[serde(rename = "bodyshots")] + pub bodyshots: i32, + #[serde(rename = "headshots")] + pub headshots: i32, + } + ///`val-console-match-v1.EconomyDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Economy { + #[serde(rename = "loadoutValue")] + pub loadout_value: i32, + #[serde(rename = "weapon")] + pub weapon: String, + #[serde(rename = "armor")] + pub armor: String, + #[serde(rename = "remaining")] + pub remaining: i32, + #[serde(rename = "spent")] + pub spent: i32, + } + ///`val-console-match-v1.AbilityDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Ability { + #[serde(rename = "grenadeEffects")] + pub grenade_effects: String, + #[serde(rename = "ability1Effects")] + pub ability1_effects: String, + #[serde(rename = "ability2Effects")] + pub ability2_effects: String, + #[serde(rename = "ultimateEffects")] + pub ultimate_effects: String, + } + ///`val-console-match-v1.MatchlistDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Matchlist { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "history")] + pub history: Vec, + } + ///`val-console-match-v1.MatchlistEntryDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MatchlistEntry { + #[serde(rename = "matchId")] + pub match_id: String, + #[serde(rename = "gameStartTimeMillis")] + pub game_start_time_millis: i64, + #[serde(rename = "queueId")] + pub queue_id: String, + } + ///`val-console-match-v1.RecentMatchesDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct RecentMatches { + #[serde(rename = "currentTime")] + pub current_time: i64, + ///A list of recent match ids. + #[serde(rename = "matchIds")] + pub match_ids: Vec, + } +} +///Data structs used by [`ValConsoleRankedV1`](crate::endpoints::ValConsoleRankedV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod val_console_ranked_v1 { + ///`val-console-ranked-v1.LeaderboardDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Leaderboard { + ///The shard for the given leaderboard. + #[serde(rename = "shard")] + pub shard: String, + ///The act id for the given leaderboard. Act ids can be found using the val-content API. + #[serde(rename = "actId")] + pub act_id: String, + ///The total number of players in the leaderboard. + #[serde(rename = "totalPlayers")] + pub total_players: i64, + #[serde(rename = "players")] + pub players: Vec, + } + ///`val-console-ranked-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Player { + ///This field may be omitted if the player has been anonymized. + #[serde(rename = "puuid")] + pub puuid: String, + ///This field may be omitted if the player has been anonymized. + #[serde(rename = "gameName")] + pub game_name: String, + ///This field may be omitted if the player has been anonymized. + #[serde(rename = "tagLine")] + pub tag_line: String, + #[serde(rename = "leaderboardRank")] + pub leaderboard_rank: i64, + #[serde(rename = "rankedRating")] + pub ranked_rating: i64, + #[serde(rename = "numberOfWins")] + pub number_of_wins: i64, + } +} +///Data structs used by [`ValContentV1`](crate::endpoints::ValContentV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod val_content_v1 { + ///`val-content-v1.ContentDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Content { + #[serde(rename = "version")] + pub version: String, + #[serde(rename = "characters")] + pub characters: Vec, + #[serde(rename = "maps")] + pub maps: Vec, + #[serde(rename = "chromas")] + pub chromas: Vec, + #[serde(rename = "skins")] + pub skins: Vec, + #[serde(rename = "skinLevels")] + pub skin_levels: Vec, + #[serde(rename = "equips")] + pub equips: Vec, + #[serde(rename = "gameModes")] + pub game_modes: Vec, + #[serde(rename = "sprays")] + pub sprays: Vec, + #[serde(rename = "sprayLevels")] + pub spray_levels: Vec, + #[serde(rename = "charms")] + pub charms: Vec, + #[serde(rename = "charmLevels")] + pub charm_levels: Vec, + #[serde(rename = "playerCards")] + pub player_cards: Vec, + #[serde(rename = "playerTitles")] + pub player_titles: Vec, + #[serde(rename = "acts")] + pub acts: Vec, + #[serde(rename = "ceremonies", default, skip_serializing_if = "Option::is_none")] + pub ceremonies: Option>, + #[serde(rename = "totems", default, skip_serializing_if = "Option::is_none")] + pub totems: Option>, + } + ///`val-content-v1.ContentItemDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct ContentItem { + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "localizedNames", + default, + skip_serializing_if = "Option::is_none" + )] + pub localized_names: Option, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "assetName")] + pub asset_name: String, + ///This field is only included for maps and game modes. These values are used in the match response. + #[serde(rename = "assetPath", default, skip_serializing_if = "Option::is_none")] + pub asset_path: Option, + } + ///`val-content-v1.LocalizedNamesDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct LocalizedNames { + #[serde(rename = "ar-AE")] + pub ar_ae: String, + #[serde(rename = "de-DE")] + pub de_de: String, + #[serde(rename = "en-GB", default, skip_serializing_if = "Option::is_none")] + pub en_gb: Option, + #[serde(rename = "en-US")] + pub en_us: String, + #[serde(rename = "es-ES")] + pub es_es: String, + #[serde(rename = "es-MX")] + pub es_mx: String, + #[serde(rename = "fr-FR")] + pub fr_fr: String, + #[serde(rename = "id-ID")] + pub id_id: String, + #[serde(rename = "it-IT")] + pub it_it: String, + #[serde(rename = "ja-JP")] + pub ja_jp: String, + #[serde(rename = "ko-KR")] + pub ko_kr: String, + #[serde(rename = "pl-PL")] + pub pl_pl: String, + #[serde(rename = "pt-BR")] + pub pt_br: String, + #[serde(rename = "ru-RU")] + pub ru_ru: String, + #[serde(rename = "th-TH")] + pub th_th: String, + #[serde(rename = "tr-TR")] + pub tr_tr: String, + #[serde(rename = "vi-VN")] + pub vi_vn: String, + #[serde(rename = "zh-CN")] + pub zh_cn: String, + #[serde(rename = "zh-TW")] + pub zh_tw: String, + } + ///`val-content-v1.ActDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Act { + #[serde(rename = "name")] + pub name: String, + #[serde( + rename = "localizedNames", + default, + skip_serializing_if = "Option::is_none" + )] + pub localized_names: Option, + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "isActive")] + pub is_active: bool, + #[serde(rename = "parentId", default, skip_serializing_if = "Option::is_none")] + pub parent_id: Option, + #[serde(rename = "type", default, skip_serializing_if = "Option::is_none")] + pub r#type: Option, + } +} +///Data structs used by [`ValMatchV1`](crate::endpoints::ValMatchV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod val_match_v1 { + ///`val-match-v1.MatchDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Match { + #[serde(rename = "matchInfo")] + pub match_info: crate::models::val_match_v1::MatchInfo, + #[serde(rename = "players")] + pub players: Vec, + #[serde(rename = "coaches")] + pub coaches: Vec, + #[serde(rename = "teams", default, skip_serializing_if = "Option::is_none")] + pub teams: Option>, + #[serde( + rename = "roundResults", + default, + skip_serializing_if = "Option::is_none" + )] + pub round_results: Option>, + } + ///`val-match-v1.MatchInfoDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MatchInfo { + #[serde(rename = "matchId")] + pub match_id: String, + #[serde(rename = "mapId")] + pub map_id: String, + #[serde( + rename = "gameLengthMillis", + default, + skip_serializing_if = "Option::is_none" + )] + pub game_length_millis: Option, + #[serde(rename = "gameStartMillis")] + pub game_start_millis: i64, + #[serde(rename = "provisioningFlowId")] + pub provisioning_flow_id: String, + #[serde(rename = "isCompleted")] + pub is_completed: bool, + #[serde(rename = "customGameName")] + pub custom_game_name: String, + #[serde(rename = "queueId")] + pub queue_id: String, + #[serde(rename = "gameMode")] + pub game_mode: String, + #[serde(rename = "isRanked")] + pub is_ranked: bool, + #[serde(rename = "seasonId")] + pub season_id: String, + #[serde(rename = "gameVersion")] + pub game_version: String, + #[serde(rename = "region")] + pub region: String, + #[serde(rename = "premierMatchInfo")] + pub premier_match_info: crate::serde_json::Map, + } + ///`val-match-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Player { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "gameName")] + pub game_name: String, + #[serde(rename = "tagLine")] + pub tag_line: String, + #[serde(rename = "teamId")] + pub team_id: String, + #[serde(rename = "partyId")] + pub party_id: String, + #[serde(rename = "characterId")] + pub character_id: String, + #[serde(rename = "stats", default, skip_serializing_if = "Option::is_none")] + pub stats: Option, + #[serde(rename = "competitiveTier")] + pub competitive_tier: i32, + #[serde(rename = "playerCard")] + pub player_card: String, + #[serde(rename = "playerTitle")] + pub player_title: String, + #[serde(rename = "isObserver")] + pub is_observer: bool, + #[serde(rename = "accountLevel")] + pub account_level: i32, + } + ///`val-match-v1.PlayerStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerStats { + #[serde(rename = "score")] + pub score: i32, + #[serde(rename = "roundsPlayed")] + pub rounds_played: i32, + #[serde(rename = "kills")] + pub kills: i32, + #[serde(rename = "deaths")] + pub deaths: i32, + #[serde(rename = "assists")] + pub assists: i32, + #[serde(rename = "playtimeMillis")] + pub playtime_millis: i32, + #[serde( + rename = "abilityCasts", + default, + skip_serializing_if = "Option::is_none" + )] + pub ability_casts: Option, + } + ///`val-match-v1.AbilityCastsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct AbilityCasts { + #[serde(rename = "grenadeCasts")] + pub grenade_casts: i32, + #[serde(rename = "ability1Casts")] + pub ability1_casts: i32, + #[serde(rename = "ability2Casts")] + pub ability2_casts: i32, + #[serde(rename = "ultimateCasts")] + pub ultimate_casts: i32, + } + ///`val-match-v1.CoachDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Coach { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "teamId")] + pub team_id: String, + } + ///`val-match-v1.TeamDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Team { + ///This is an arbitrary string. Red and Blue in bomb modes. The puuid of the player in deathmatch. + #[serde(rename = "teamId")] + pub team_id: String, + #[serde(rename = "won")] + pub won: bool, + #[serde(rename = "roundsPlayed")] + pub rounds_played: i32, + #[serde(rename = "roundsWon")] + pub rounds_won: i32, + ///Team points scored. Number of kills in deathmatch. + #[serde(rename = "numPoints")] + pub num_points: i32, + } + ///`val-match-v1.RoundResultDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct RoundResult { + #[serde(rename = "roundNum")] + pub round_num: i32, + #[serde(rename = "roundResult")] + pub round_result: String, + #[serde(rename = "roundCeremony")] + pub round_ceremony: String, + #[serde(rename = "winningTeam")] + pub winning_team: String, + ///PUUID of player + #[serde( + rename = "bombPlanter", + default, + skip_serializing_if = "Option::is_none" + )] + pub bomb_planter: Option, + ///PUUID of player + #[serde( + rename = "bombDefuser", + default, + skip_serializing_if = "Option::is_none" + )] + pub bomb_defuser: Option, + #[serde(rename = "plantRoundTime")] + pub plant_round_time: i32, + #[serde( + rename = "plantPlayerLocations", + default, + skip_serializing_if = "Option::is_none" + )] + pub plant_player_locations: Option< + Vec, + >, + #[serde(rename = "plantLocation")] + pub plant_location: crate::models::val_match_v1::Location, + #[serde(rename = "plantSite")] + pub plant_site: String, + #[serde(rename = "defuseRoundTime")] + pub defuse_round_time: i32, + #[serde( + rename = "defusePlayerLocations", + default, + skip_serializing_if = "Option::is_none" + )] + pub defuse_player_locations: Option< + Vec, + >, + #[serde(rename = "defuseLocation")] + pub defuse_location: crate::models::val_match_v1::Location, + #[serde(rename = "playerStats")] + pub player_stats: Vec, + #[serde(rename = "roundResultCode")] + pub round_result_code: String, + #[serde(rename = "winningTeamRole")] + pub winning_team_role: String, + } + ///`val-match-v1.PlayerLocationsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerLocations { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "viewRadians")] + pub view_radians: f32, + #[serde(rename = "location")] + pub location: crate::models::val_match_v1::Location, + } + ///`val-match-v1.LocationDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Location { + #[serde(rename = "x")] + pub x: i32, + #[serde(rename = "y")] + pub y: i32, + } + ///`val-match-v1.PlayerRoundStatsDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlayerRoundStats { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "kills")] + pub kills: Vec, + #[serde(rename = "damage")] + pub damage: Vec, + #[serde(rename = "score")] + pub score: i32, + #[serde(rename = "economy")] + pub economy: crate::models::val_match_v1::Economy, + #[serde(rename = "ability")] + pub ability: crate::models::val_match_v1::Ability, + } + ///`val-match-v1.KillDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Kill { + #[serde(rename = "timeSinceGameStartMillis")] + pub time_since_game_start_millis: i32, + #[serde(rename = "timeSinceRoundStartMillis")] + pub time_since_round_start_millis: i32, + ///PUUID + #[serde(rename = "killer")] + pub killer: String, + ///PUUID + #[serde(rename = "victim")] + pub victim: String, + #[serde(rename = "victimLocation")] + pub victim_location: crate::models::val_match_v1::Location, + ///List of PUUIDs + #[serde(rename = "assistants")] + pub assistants: Vec, + #[serde(rename = "playerLocations")] + pub player_locations: Vec, + #[serde(rename = "finishingDamage")] + pub finishing_damage: crate::models::val_match_v1::FinishingDamage, + } + ///`val-match-v1.FinishingDamageDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct FinishingDamage { + #[serde(rename = "damageType")] + pub damage_type: String, + #[serde(rename = "damageItem")] + pub damage_item: String, + #[serde(rename = "isSecondaryFireMode")] + pub is_secondary_fire_mode: bool, + } + ///`val-match-v1.DamageDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Damage { + ///PUUID + #[serde(rename = "receiver")] + pub receiver: String, + #[serde(rename = "damage")] + pub damage: i32, + #[serde(rename = "legshots")] + pub legshots: i32, + #[serde(rename = "bodyshots")] + pub bodyshots: i32, + #[serde(rename = "headshots")] + pub headshots: i32, + } + ///`val-match-v1.EconomyDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Economy { + #[serde(rename = "loadoutValue")] + pub loadout_value: i32, + #[serde(rename = "weapon")] + pub weapon: String, + #[serde(rename = "armor")] + pub armor: String, + #[serde(rename = "remaining")] + pub remaining: i32, + #[serde(rename = "spent")] + pub spent: i32, + } + ///`val-match-v1.AbilityDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Ability { + #[serde( + rename = "grenadeEffects", + default, + skip_serializing_if = "Option::is_none" + )] + pub grenade_effects: Option, + #[serde( + rename = "ability1Effects", + default, + skip_serializing_if = "Option::is_none" + )] + pub ability1_effects: Option, + #[serde( + rename = "ability2Effects", + default, + skip_serializing_if = "Option::is_none" + )] + pub ability2_effects: Option, + #[serde( + rename = "ultimateEffects", + default, + skip_serializing_if = "Option::is_none" + )] + pub ultimate_effects: Option, + } + ///`val-match-v1.MatchlistDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Matchlist { + #[serde(rename = "puuid")] + pub puuid: String, + #[serde(rename = "history")] + pub history: Vec, + } + ///`val-match-v1.MatchlistEntryDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct MatchlistEntry { + #[serde(rename = "matchId")] + pub match_id: String, + #[serde(rename = "gameStartTimeMillis")] + pub game_start_time_millis: i64, + #[serde(rename = "queueId")] + pub queue_id: String, + } + ///`val-match-v1.RecentMatchesDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct RecentMatches { + #[serde(rename = "currentTime")] + pub current_time: i64, + ///A list of recent match ids. + #[serde(rename = "matchIds")] + pub match_ids: Vec, + } +} +///Data structs used by [`ValRankedV1`](crate::endpoints::ValRankedV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod val_ranked_v1 { + ///`val-ranked-v1.LeaderboardDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Leaderboard { + ///The shard for the given leaderboard. + #[serde(rename = "shard")] + pub shard: String, + ///The act id for the given leaderboard. Act ids can be found using the val-content API. + #[serde(rename = "actId")] + pub act_id: String, + ///The total number of players in the leaderboard. + #[serde(rename = "totalPlayers")] + pub total_players: i64, + #[serde(rename = "players")] + pub players: Vec, + #[serde( + rename = "immortalStartingPage", + default, + skip_serializing_if = "Option::is_none" + )] + pub immortal_starting_page: Option, + #[serde( + rename = "immortalStartingIndex", + default, + skip_serializing_if = "Option::is_none" + )] + pub immortal_starting_index: Option, + #[serde( + rename = "topTierRRThreshold", + default, + skip_serializing_if = "Option::is_none" + )] + pub top_tier_rr_threshold: Option, + #[serde( + rename = "tierDetails", + default, + skip_serializing_if = "Option::is_none" + )] + pub tier_details: Option< + ::std::collections::HashMap, + >, + #[serde(rename = "startIndex", default, skip_serializing_if = "Option::is_none")] + pub start_index: Option, + #[serde(rename = "query", default, skip_serializing_if = "Option::is_none")] + pub query: Option, + } + ///`val-ranked-v1.PlayerDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Player { + ///This field may be omitted if the player has been anonymized. + #[serde(rename = "puuid", default, skip_serializing_if = "Option::is_none")] + pub puuid: Option, + ///This field may be omitted if the player has been anonymized. + #[serde(rename = "gameName", default, skip_serializing_if = "Option::is_none")] + pub game_name: Option, + ///This field may be omitted if the player has been anonymized. + #[serde(rename = "tagLine", default, skip_serializing_if = "Option::is_none")] + pub tag_line: Option, + #[serde(rename = "leaderboardRank")] + pub leaderboard_rank: i64, + #[serde(rename = "rankedRating")] + pub ranked_rating: i64, + #[serde(rename = "numberOfWins")] + pub number_of_wins: i64, + #[serde( + rename = "competitiveTier", + default, + skip_serializing_if = "Option::is_none" + )] + pub competitive_tier: Option, + } + ///`val-ranked-v1.TierDetailDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct TierDetail { + #[serde(rename = "rankedRatingThreshold")] + pub ranked_rating_threshold: i64, + #[serde(rename = "startingPage")] + pub starting_page: i64, + #[serde(rename = "startingIndex")] + pub starting_index: i64, + } +} +///Data structs used by [`ValStatusV1`](crate::endpoints::ValStatusV1) +/// +///Note: this item is generated based on `riotapi-schema`. +#[allow(dead_code)] +pub mod val_status_v1 { + ///`val-status-v1.PlatformDataDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct PlatformData { + #[serde(rename = "id")] + pub id: String, + #[serde(rename = "name")] + pub name: String, + #[serde(rename = "locales")] + pub locales: Vec, + #[serde(rename = "maintenances")] + pub maintenances: Vec, + #[serde(rename = "incidents")] + pub incidents: Vec, + } + ///`val-status-v1.StatusDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Status { + #[serde(rename = "id")] + pub id: i32, + ///(Legal values: scheduled, in_progress, complete) + #[serde(rename = "maintenance_status")] + pub maintenance_status: String, + ///(Legal values: info, warning, critical) + #[serde(rename = "incident_severity")] + pub incident_severity: String, + #[serde(rename = "titles")] + pub titles: Vec, + #[serde(rename = "updates")] + pub updates: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "archive_at")] + pub archive_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + ///(Legal values: windows, macos, android, ios, ps4, xbone, switch) + #[serde(rename = "platforms")] + pub platforms: Vec, + } + ///`val-status-v1.ContentDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Content { + #[serde(rename = "locale")] + pub locale: String, + #[serde(rename = "content")] + pub content: String, + } + ///`val-status-v1.UpdateDto` data object. + /// + ///Note: this item is generated based on `riotapi-schema`. + #[derive(Clone, Debug)] + #[derive(serde::Serialize, crate::de::Deserialize)] + #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] + pub struct Update { + #[serde(rename = "id")] + pub id: i32, + #[serde(rename = "author")] + pub author: String, + #[serde(rename = "publish")] + pub publish: bool, + ///(Legal values: riotclient, riotstatus, game) + #[serde(rename = "publish_locations")] + pub publish_locations: Vec, + #[serde(rename = "translations")] + pub translations: Vec, + #[serde(rename = "created_at")] + pub created_at: String, + #[serde(rename = "updated_at")] + pub updated_at: String, + } +} + diff --git a/riven/src/models.rs b/riven/src/models.rs index 481ac744..cebd8f75 100644 --- a/riven/src/models.rs +++ b/riven/src/models.rs @@ -1,17 +1,4 @@ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -/////////////////////////////////////////////// - -// http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version 996d171a2b79e9bb85c549f47b07c6ef2721fc8a - #![allow(missing_docs)] - //! Data transfer structs. //! //! Separated into separate modules for each endpoint. @@ -19,4846 +6,4 @@ //! //! Note: these modules are automatically generated. -/// Data structs used by [`AccountV1`](crate::endpoints::AccountV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod account_v1 { - /// `account-v1.AccountDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Account { - #[serde(rename = "puuid")] - pub puuid: String, - /// This field may be excluded from the response if the account doesn't have a gameName. - #[serde(rename = "gameName")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_name: Option, - /// This field may be excluded from the response if the account doesn't have a tagLine. - #[serde(rename = "tagLine")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag_line: Option, - } - /// `account-v1.ActiveShardDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ActiveShard { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "game")] - pub game: String, - #[serde(rename = "activeShard")] - pub active_shard: String, - } -} - -/// Data structs used by [`ChampionMasteryV4`](crate::endpoints::ChampionMasteryV4). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod champion_mastery_v4 { - /// `champion-mastery-v4.ChampionMasteryDto` data object. - /// # Description - /// This object contains single Champion Mastery information for player and champion combination. - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ChampionMastery { - /// Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) - #[serde(rename = "puuid")] - pub puuid: String, - /// Number of points needed to achieve next level. Zero if player reached maximum champion level for this champion. - #[serde(rename = "championPointsUntilNextLevel")] - pub champion_points_until_next_level: i64, - /// Is chest granted for this champion or not in current season. - #[serde(rename = "chestGranted")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub chest_granted: Option, - /// Champion ID for this entry. - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// Last time this champion was played by this player - in Unix milliseconds time format. - #[serde(rename = "lastPlayTime")] - pub last_play_time: i64, - /// Champion level for specified player and champion combination. - #[serde(rename = "championLevel")] - pub champion_level: i32, - /// Total number of champion points for this player and champion combination - they are used to determine championLevel. - #[serde(rename = "championPoints")] - pub champion_points: i32, - /// Number of points earned since current level has been achieved. - #[serde(rename = "championPointsSinceLastLevel")] - pub champion_points_since_last_level: i64, - #[serde(rename = "markRequiredForNextLevel")] - pub mark_required_for_next_level: i32, - #[serde(rename = "championSeasonMilestone")] - pub champion_season_milestone: i32, - #[serde(rename = "nextSeasonMilestone")] - pub next_season_milestone: crate::models::champion_mastery_v4::NextSeasonMilestones, - /// The token earned for this champion at the current championLevel. When the championLevel is advanced the tokensEarned resets to 0. - #[serde(rename = "tokensEarned")] - pub tokens_earned: i32, - #[serde(rename = "milestoneGrades")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub milestone_grades: Option>, - } - /// `champion-mastery-v4.NextSeasonMilestonesDto` data object. - /// # Description - /// This object contains required next season milestone information. - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct NextSeasonMilestones { - #[serde(rename = "requireGradeCounts")] - pub require_grade_counts: std::collections::HashMap, - /// Reward marks. - #[serde(rename = "rewardMarks")] - pub reward_marks: i32, - /// Bonus. - #[serde(rename = "bonus")] - pub bonus: bool, - /// Reward configuration. - #[serde(rename = "rewardConfig")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub reward_config: Option, - #[serde(rename = "totalGamesRequires")] - pub total_games_requires: i32, - } - /// `champion-mastery-v4.RewardConfigDto` data object. - /// # Description - /// This object contains required reward config information. - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct RewardConfig { - /// Reward value - #[serde(rename = "rewardValue")] - pub reward_value: String, - /// Reward type - #[serde(rename = "rewardType")] - pub reward_type: String, - /// Maximun reward - #[serde(rename = "maximumReward")] - pub maximum_reward: i32, - } -} - -/// Data structs used by [`ChampionV3`](crate::endpoints::ChampionV3). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod champion_v3 { - /// `champion-v3.ChampionInfo` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ChampionInfo { - #[serde(rename = "maxNewPlayerLevel")] - pub max_new_player_level: i32, - #[serde(rename = "freeChampionIdsForNewPlayers")] - pub free_champion_ids_for_new_players: std::vec::Vec, - #[serde(rename = "freeChampionIds")] - pub free_champion_ids: std::vec::Vec, - } -} - -/// Data structs used by [`ClashV1`](crate::endpoints::ClashV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod clash_v1 { - /// `clash-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Player { - #[serde(rename = "summonerId")] - pub summoner_id: String, - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "teamId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team_id: Option, - /// (Legal values: UNSELECTED, FILL, TOP, JUNGLE, MIDDLE, BOTTOM, UTILITY) - #[serde(rename = "position")] - pub position: String, - /// (Legal values: CAPTAIN, MEMBER) - #[serde(rename = "role")] - pub role: String, - } - /// `clash-v1.TeamDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Team { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "tournamentId")] - pub tournament_id: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "iconId")] - pub icon_id: i32, - #[serde(rename = "tier")] - pub tier: i32, - /// Summoner ID of the team captain. - #[serde(rename = "captain")] - pub captain: String, - #[serde(rename = "abbreviation")] - pub abbreviation: String, - /// Team members. - #[serde(rename = "players")] - pub players: std::vec::Vec, - } - /// `clash-v1.TournamentDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Tournament { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "themeId")] - pub theme_id: i32, - #[serde(rename = "nameKey")] - pub name_key: String, - #[serde(rename = "nameKeySecondary")] - pub name_key_secondary: String, - /// Tournament phase. - #[serde(rename = "schedule")] - pub schedule: std::vec::Vec, - } - /// `clash-v1.TournamentPhaseDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct TournamentPhase { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "registrationTime")] - pub registration_time: i64, - #[serde(rename = "startTime")] - pub start_time: i64, - #[serde(rename = "cancelled")] - pub cancelled: bool, - } -} - -/// Data structs used by [`LeagueExpV4`](crate::endpoints::LeagueExpV4). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod league_exp_v4 { - /// `league-exp-v4.LeagueEntryDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueEntry { - #[serde(rename = "leagueId")] - pub league_id: String, - /// Player's summonerId (Encrypted) - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// Player's encrypted puuid. - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "queueType")] - pub queue_type: crate::consts::QueueType, - #[serde(rename = "tier")] - pub tier: crate::consts::Tier, - /// The player's division within a tier. - #[serde(rename = "rank")] - pub rank: crate::consts::Division, - #[serde(rename = "leaguePoints")] - pub league_points: i32, - /// Winning team on Summoners Rift. First placement in Teamfight Tactics. - #[serde(rename = "wins")] - pub wins: i32, - /// Losing team on Summoners Rift. Second through eighth placement in Teamfight Tactics. - #[serde(rename = "losses")] - pub losses: i32, - #[serde(rename = "hotStreak")] - pub hot_streak: bool, - #[serde(rename = "veteran")] - pub veteran: bool, - #[serde(rename = "freshBlood")] - pub fresh_blood: bool, - #[serde(rename = "inactive")] - pub inactive: bool, - #[serde(rename = "miniSeries")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mini_series: Option, - } - /// `league-exp-v4.MiniSeriesDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MiniSeries { - #[serde(rename = "losses")] - pub losses: i32, - #[serde(rename = "progress")] - pub progress: String, - #[serde(rename = "target")] - pub target: i32, - #[serde(rename = "wins")] - pub wins: i32, - } -} - -/// Data structs used by [`LeagueV4`](crate::endpoints::LeagueV4). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod league_v4 { - /// `league-v4.LeagueListDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueList { - #[serde(rename = "leagueId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub league_id: Option, - #[serde(rename = "entries")] - pub entries: std::vec::Vec, - #[serde(rename = "tier")] - pub tier: crate::consts::Tier, - #[serde(rename = "name")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "queue")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option, - } - /// `league-v4.LeagueItemDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueItem { - #[serde(rename = "freshBlood")] - pub fresh_blood: bool, - /// Winning team on Summoners Rift. - #[serde(rename = "wins")] - pub wins: i32, - #[serde(rename = "miniSeries")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mini_series: Option, - #[serde(rename = "inactive")] - pub inactive: bool, - #[serde(rename = "veteran")] - pub veteran: bool, - #[serde(rename = "hotStreak")] - pub hot_streak: bool, - #[serde(rename = "rank")] - pub rank: crate::consts::Division, - #[serde(rename = "leaguePoints")] - pub league_points: i32, - /// Losing team on Summoners Rift. - #[serde(rename = "losses")] - pub losses: i32, - /// Player's encrypted summonerId. - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// Player's encrypted puuid. - #[serde(rename = "puuid")] - pub puuid: String, - } - /// `league-v4.MiniSeriesDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MiniSeries { - #[serde(rename = "losses")] - pub losses: i32, - #[serde(rename = "progress")] - pub progress: String, - #[serde(rename = "target")] - pub target: i32, - #[serde(rename = "wins")] - pub wins: i32, - } - /// `league-v4.LeagueEntryDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueEntry { - #[serde(rename = "leagueId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub league_id: Option, - /// Player's encrypted summonerId. - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// Player's encrypted puuid. - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "queueType")] - pub queue_type: crate::consts::QueueType, - #[serde(rename = "tier")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, - /// The player's division within a tier. - #[serde(rename = "rank")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option, - #[serde(rename = "leaguePoints")] - pub league_points: i32, - /// Winning team on Summoners Rift. - #[serde(rename = "wins")] - pub wins: i32, - /// Losing team on Summoners Rift. - #[serde(rename = "losses")] - pub losses: i32, - #[serde(rename = "hotStreak")] - pub hot_streak: bool, - #[serde(rename = "veteran")] - pub veteran: bool, - #[serde(rename = "freshBlood")] - pub fresh_blood: bool, - #[serde(rename = "inactive")] - pub inactive: bool, - #[serde(rename = "miniSeries")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mini_series: Option, - } -} - -/// Data structs used by [`LolChallengesV1`](crate::endpoints::LolChallengesV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lol_challenges_v1 { - /// `lol-challenges-v1.ChallengeConfigInfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ChallengeConfigInfo { - #[serde(rename = "id")] - pub id: i64, - #[serde(rename = "localizedNames")] - pub localized_names: std::collections::HashMap>, - /// DISABLED - not visible and not calculated, HIDDEN - not visible, but calculated, ENABLED - visible and calculated, ARCHIVED - visible, but not calculated - #[serde(rename = "state")] - pub state: String, - /// LIFETIME - stats are incremented without reset, SEASON - stats are accumulated by season and reset at the beginning of new season - #[serde(rename = "tracking")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tracking: Option, - #[serde(rename = "startTimestamp")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_timestamp: Option, - #[serde(rename = "endTimestamp")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_timestamp: Option, - #[serde(rename = "leaderboard")] - pub leaderboard: bool, - #[serde(rename = "thresholds")] - pub thresholds: std::collections::HashMap, - } - /// `lol-challenges-v1.State` data object. - /// # Description - /// DISABLED - not visible and not calculated,
- /// HIDDEN - not visible, but calculated,
- /// ENABLED - visible and calculated,
- /// ARCHIVED - visible, but not calculated - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct State { - } - /// `lol-challenges-v1.Tracking` data object. - /// # Description - /// LIFETIME - stats are incremented without reset,
- /// SEASON - stats are accumulated by season and reset at the beginning of new season - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Tracking { - } - /// `lol-challenges-v1.ApexPlayerInfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ApexPlayerInfo { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "value")] - pub value: f64, - #[serde(rename = "position")] - pub position: i32, - } - /// `lol-challenges-v1.Level` data object. - /// # Description - /// 0 NONE,
- /// 1 IRON,
- /// 2 BRONZE,
- /// 3 SILVER,
- /// 4 GOLD,
- /// 5 PLATINUM,
- /// 6 DIAMOND,
- /// 7 MASTER,
- /// 8 GRANDMASTER,
- /// 9 CHALLENGER - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Level { - } - /// `lol-challenges-v1.PlayerInfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerInfo { - #[serde(rename = "challenges")] - pub challenges: std::vec::Vec, - #[serde(rename = "preferences")] - pub preferences: crate::models::lol_challenges_v1::PlayerClientPreferences, - #[serde(rename = "totalPoints")] - pub total_points: crate::models::lol_challenges_v1::ChallengePoints, - #[serde(rename = "categoryPoints")] - pub category_points: std::collections::HashMap, - } - /// `lol-challenges-v1.ChallengeInfo` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ChallengeInfo { - #[serde(rename = "challengeId")] - pub challenge_id: i64, - #[serde(rename = "percentile")] - pub percentile: f64, - #[serde(rename = "level")] - pub level: crate::consts::Tier, - #[serde(rename = "value")] - pub value: f64, - #[serde(rename = "achievedTime")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub achieved_time: Option, - #[serde(rename = "position")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option, - #[serde(rename = "playersInLevel")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub players_in_level: Option, - } - /// `lol-challenges-v1.PlayerClientPreferences` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerClientPreferences { - #[serde(rename = "bannerAccent")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub banner_accent: Option, - #[serde(rename = "title")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub title: Option, - #[serde(rename = "challengeIds")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub challenge_ids: Option>, - #[serde(rename = "crestBorder")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub crest_border: Option, - #[serde(rename = "prestigeCrestBorderLevel")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub prestige_crest_border_level: Option, - } - /// `lol-challenges-v1.ChallengePoints` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ChallengePoints { - #[serde(rename = "level")] - pub level: crate::consts::Tier, - #[serde(rename = "current")] - pub current: i64, - #[serde(rename = "max")] - pub max: i64, - #[serde(rename = "percentile")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub percentile: Option, - } -} - -/// Data structs used by [`LolRsoMatchV1`](crate::endpoints::LolRsoMatchV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lol_rso_match_v1 { - /// `lol-rso-match-v1.MatchDto` data object. - /// # Description - /// UNKNOWN TYPE. - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Match { - } - /// `lol-rso-match-v1.TimelineDto` data object. - /// # Description - /// UNKNOWN TYPE. - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Timeline { - } -} - -/// Data structs used by [`LolStatusV4`](crate::endpoints::LolStatusV4). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lol_status_v4 { - /// `lol-status-v4.PlatformDataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlatformData { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "locales")] - pub locales: std::vec::Vec, - #[serde(rename = "maintenances")] - pub maintenances: std::vec::Vec, - #[serde(rename = "incidents")] - pub incidents: std::vec::Vec, - } - /// `lol-status-v4.StatusDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Status { - #[serde(rename = "id")] - pub id: i32, - /// (Legal values: scheduled, in_progress, complete) - #[serde(rename = "maintenance_status")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub maintenance_status: Option, - /// (Legal values: info, warning, critical) - #[serde(rename = "incident_severity")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub incident_severity: Option, - #[serde(rename = "titles")] - pub titles: std::vec::Vec, - #[serde(rename = "updates")] - pub updates: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "archive_at")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub archive_at: Option, - #[serde(rename = "updated_at")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub updated_at: Option, - /// (Legal values: windows, macos, android, ios, ps4, xbone, switch) - #[serde(rename = "platforms")] - pub platforms: std::vec::Vec, - } - /// `lol-status-v4.ContentDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Content { - #[serde(rename = "locale")] - pub locale: String, - #[serde(rename = "content")] - pub content: String, - } - /// `lol-status-v4.UpdateDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Update { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "author")] - pub author: String, - #[serde(rename = "publish")] - pub publish: bool, - /// (Legal values: riotclient, riotstatus, game) - #[serde(rename = "publish_locations")] - pub publish_locations: std::vec::Vec, - #[serde(rename = "translations")] - pub translations: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - } -} - -/// Data structs used by [`LorDeckV1`](crate::endpoints::LorDeckV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lor_deck_v1 { - /// `lor-deck-v1.DeckDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Deck { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "code")] - pub code: String, - } - /// `lor-deck-v1.NewDeckDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct NewDeck { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "code")] - pub code: String, - } -} - -/// Data structs used by [`LorInventoryV1`](crate::endpoints::LorInventoryV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lor_inventory_v1 { - /// `lor-inventory-v1.CardDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Card { - #[serde(rename = "code")] - pub code: String, - #[serde(rename = "count")] - pub count: String, - } -} - -/// Data structs used by [`LorMatchV1`](crate::endpoints::LorMatchV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lor_match_v1 { - /// `lor-match-v1.MatchDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Match { - /// Match metadata. - #[serde(rename = "metadata")] - pub metadata: crate::models::lor_match_v1::Metadata, - /// Match info. - #[serde(rename = "info")] - pub info: crate::models::lor_match_v1::Info, - } - /// `lor-match-v1.MetadataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - 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 participant PUUIDs. - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - } - /// `lor-match-v1.InfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - 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, - /// (Legal values: standard, eternal) - #[serde(rename = "game_format")] - pub game_format: 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, - } - /// `lor-match-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - 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. -#[allow(dead_code)] -pub mod lor_ranked_v1 { - /// `lor-ranked-v1.LeaderboardDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Leaderboard { - /// A list of players in Master tier. - #[serde(rename = "players")] - pub players: std::vec::Vec, - } - /// `lor-ranked-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Player { - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "rank")] - pub rank: i32, - /// League points. - #[serde(rename = "lp")] - pub lp: i32, - } -} - -/// Data structs used by [`LorStatusV1`](crate::endpoints::LorStatusV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod lor_status_v1 { - /// `lor-status-v1.PlatformDataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlatformData { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "locales")] - pub locales: std::vec::Vec, - #[serde(rename = "maintenances")] - pub maintenances: std::vec::Vec, - #[serde(rename = "incidents")] - pub incidents: std::vec::Vec, - } - /// `lor-status-v1.StatusDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Status { - #[serde(rename = "id")] - pub id: i32, - /// (Legal values: scheduled, in_progress, complete) - #[serde(rename = "maintenance_status")] - pub maintenance_status: String, - /// (Legal values: info, warning, critical) - #[serde(rename = "incident_severity")] - pub incident_severity: String, - #[serde(rename = "titles")] - pub titles: std::vec::Vec, - #[serde(rename = "updates")] - pub updates: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "archive_at")] - pub archive_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - /// (Legal values: windows, macos, android, ios, ps4, xbone, switch) - #[serde(rename = "platforms")] - pub platforms: std::vec::Vec, - } - /// `lor-status-v1.ContentDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Content { - #[serde(rename = "locale")] - pub locale: String, - #[serde(rename = "content")] - pub content: String, - } - /// `lor-status-v1.UpdateDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Update { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "author")] - pub author: String, - #[serde(rename = "publish")] - pub publish: bool, - /// (Legal values: riotclient, riotstatus, game) - #[serde(rename = "publish_locations")] - pub publish_locations: std::vec::Vec, - #[serde(rename = "translations")] - pub translations: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - } -} - -/// Data structs used by [`MatchV5`](crate::endpoints::MatchV5). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod match_v5 { - /// `match-v5.MatchDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Match { - /// Match metadata. - #[serde(rename = "metadata")] - pub metadata: crate::models::match_v5::Metadata, - /// Match info. - #[serde(rename = "info")] - pub info: crate::models::match_v5::Info, - } - /// `match-v5.MetadataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Metadata { - /// Match data version. - #[serde(rename = "dataVersion")] - pub data_version: String, - /// Match id. - #[serde(rename = "matchId")] - pub match_id: String, - /// A list of participant PUUIDs. - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - } - /// `match-v5.InfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Info { - /// Refer to indicate if the game ended in termination. - #[serde(rename = "endOfGameResult")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_of_game_result: Option, - /// Unix timestamp for when the game is created on the game server (i.e., the loading screen). - #[serde(rename = "gameCreation")] - pub game_creation: i64, - /// 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")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_end_timestamp: Option, - #[serde(rename = "gameId")] - pub game_id: i64, - /// Refer to the Game Constants documentation. - #[serde(rename = "gameMode")] - pub game_mode: crate::consts::GameMode, - #[serde(rename = "gameName")] - pub game_name: String, - /// Unix timestamp for when match starts on the game server. - #[serde(rename = "gameStartTimestamp")] - pub game_start_timestamp: i64, - #[serde(rename = "gameType")] - /// - /// Will be `None` if empty string is returned: - #[serde(serialize_with = "crate::consts::serialize_empty_string_none")] - #[serde(deserialize_with = "crate::consts::deserialize_empty_string_none")] - pub game_type: Option, - /// 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: crate::consts::Map, - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - /// Platform where the match was played. - #[serde(rename = "platformId")] - pub platform_id: String, - /// Refer to the Game Constants documentation. - #[serde(rename = "queueId")] - pub queue_id: crate::consts::Queue, - #[serde(rename = "teams")] - pub teams: std::vec::Vec, - /// Tournament code used to generate the match. This field was added to match-v5 in patch 11.13 on June 23rd, 2021. - #[serde(rename = "tournamentCode")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tournament_code: Option, - } - /// `match-v5.ParticipantDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Participant { - /// Yellow crossed swords - #[serde(rename = "allInPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub all_in_pings: Option, - /// Green flag - #[serde(rename = "assistMePings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub assist_me_pings: Option, - #[serde(rename = "assists")] - pub assists: i32, - #[serde(rename = "baronKills")] - pub baron_kills: i32, - #[serde(rename = "bountyLevel")] - pub bounty_level: i32, - #[serde(rename = "champExperience")] - pub champ_experience: i32, - #[serde(rename = "champLevel")] - pub champ_level: i32, - /// Prior to patch 11.4, on Feb 18th, 2021, this field returned invalid championIds. We recommend determining the champion based on the championName field for matches played prior to patch 11.4. - #[serde(rename = "championId")] - /// - /// Instead use [`Self::champion()`] which checks this field then parses [`Self::champion_name`]. - #[deprecated(since = "2.5.0", note = "Use `Participant.champion()` instead. Riot sometimes returns corrupted data for this field: ")] - #[serde(serialize_with = "crate::consts::Champion::serialize_result")] - #[serde(deserialize_with = "crate::consts::Champion::deserialize_result")] - pub champion_id: Result, - #[serde(rename = "championName")] - pub champion_name: String, - /// Blue generic ping (ALT+click) - #[serde(rename = "commandPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub command_pings: Option, - /// This field is currently only utilized for Kayn's transformations. (Legal values: 0 - None, 1 - Slayer, 2 - Assassin) - #[serde(rename = "championTransform")] - pub champion_transform: i32, - #[serde(rename = "consumablesPurchased")] - pub consumables_purchased: i32, - #[serde(rename = "challenges")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub challenges: Option, - #[serde(rename = "damageDealtToBuildings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_dealt_to_buildings: Option, - #[serde(rename = "damageDealtToObjectives")] - pub damage_dealt_to_objectives: i32, - #[serde(rename = "damageDealtToTurrets")] - pub damage_dealt_to_turrets: i32, - #[serde(rename = "damageSelfMitigated")] - pub damage_self_mitigated: i32, - #[serde(rename = "deaths")] - pub deaths: i32, - #[serde(rename = "detectorWardsPlaced")] - pub detector_wards_placed: i32, - #[serde(rename = "doubleKills")] - pub double_kills: i32, - #[serde(rename = "dragonKills")] - pub dragon_kills: i32, - #[serde(rename = "eligibleForProgression")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub eligible_for_progression: Option, - /// Yellow questionmark - #[serde(rename = "enemyMissingPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enemy_missing_pings: Option, - /// Red eyeball - #[serde(rename = "enemyVisionPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enemy_vision_pings: Option, - #[serde(rename = "firstBloodAssist")] - pub first_blood_assist: bool, - #[serde(rename = "firstBloodKill")] - pub first_blood_kill: bool, - #[serde(rename = "firstTowerAssist")] - pub first_tower_assist: bool, - #[serde(rename = "firstTowerKill")] - pub first_tower_kill: bool, - /// This is an offshoot of the OneStone challenge. The code checks if a spell with the same instance ID does the final point of damage to at least 2 Champions. It doesn't matter if they're enemies, but you cannot hurt your friends. - #[serde(rename = "gameEndedInEarlySurrender")] - pub game_ended_in_early_surrender: bool, - #[serde(rename = "gameEndedInSurrender")] - pub game_ended_in_surrender: bool, - #[serde(rename = "holdPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hold_pings: Option, - /// Yellow circle with horizontal line - #[serde(rename = "getBackPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub get_back_pings: Option, - #[serde(rename = "goldEarned")] - pub gold_earned: i32, - #[serde(rename = "goldSpent")] - pub gold_spent: i32, - /// 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 = "individualPosition")] - pub individual_position: String, - #[serde(rename = "inhibitorKills")] - pub inhibitor_kills: i32, - #[serde(rename = "inhibitorTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inhibitor_takedowns: Option, - #[serde(rename = "inhibitorsLost")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inhibitors_lost: Option, - #[serde(rename = "item0")] - pub item0: i32, - #[serde(rename = "item1")] - pub item1: i32, - #[serde(rename = "item2")] - pub item2: i32, - #[serde(rename = "item3")] - pub item3: i32, - #[serde(rename = "item4")] - pub item4: i32, - #[serde(rename = "item5")] - pub item5: i32, - #[serde(rename = "item6")] - pub item6: i32, - #[serde(rename = "itemsPurchased")] - pub items_purchased: i32, - #[serde(rename = "killingSprees")] - pub killing_sprees: i32, - #[serde(rename = "kills")] - pub kills: i32, - #[serde(rename = "lane")] - pub lane: String, - #[serde(rename = "largestCriticalStrike")] - pub largest_critical_strike: i32, - #[serde(rename = "largestKillingSpree")] - pub largest_killing_spree: i32, - #[serde(rename = "largestMultiKill")] - pub largest_multi_kill: i32, - #[serde(rename = "longestTimeSpentLiving")] - pub longest_time_spent_living: i32, - #[serde(rename = "magicDamageDealt")] - pub magic_damage_dealt: i32, - #[serde(rename = "magicDamageDealtToChampions")] - pub magic_damage_dealt_to_champions: i32, - #[serde(rename = "magicDamageTaken")] - pub magic_damage_taken: i32, - #[serde(rename = "missions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub missions: Option, - /// neutralMinionsKilled = mNeutralMinionsKilled, which is incremented on kills of kPet and kJungleMonster - #[serde(rename = "neutralMinionsKilled")] - pub neutral_minions_killed: i32, - /// Green ward - #[serde(rename = "needVisionPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub need_vision_pings: Option, - #[serde(rename = "nexusKills")] - pub nexus_kills: i32, - #[serde(rename = "nexusTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nexus_takedowns: Option, - #[serde(rename = "nexusLost")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub nexus_lost: Option, - #[serde(rename = "objectivesStolen")] - pub objectives_stolen: i32, - #[serde(rename = "objectivesStolenAssists")] - pub objectives_stolen_assists: i32, - /// Blue arrow pointing at ground - #[serde(rename = "onMyWayPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub on_my_way_pings: Option, - #[serde(rename = "participantId")] - pub participant_id: i32, - #[serde(rename = "playerScore0", alias = "PlayerScore0")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score0: Option, - #[serde(rename = "playerScore1", alias = "PlayerScore1")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score1: Option, - #[serde(rename = "playerScore2", alias = "PlayerScore2")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score2: Option, - #[serde(rename = "playerScore3", alias = "PlayerScore3")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score3: Option, - #[serde(rename = "playerScore4", alias = "PlayerScore4")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score4: Option, - #[serde(rename = "playerScore5", alias = "PlayerScore5")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score5: Option, - #[serde(rename = "playerScore6", alias = "PlayerScore6")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score6: Option, - #[serde(rename = "playerScore7", alias = "PlayerScore7")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score7: Option, - #[serde(rename = "playerScore8", alias = "PlayerScore8")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score8: Option, - #[serde(rename = "playerScore9", alias = "PlayerScore9")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score9: Option, - #[serde(rename = "playerScore10", alias = "PlayerScore10")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score10: Option, - #[serde(rename = "playerScore11", alias = "PlayerScore11")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score11: Option, - #[serde(rename = "pentaKills")] - pub penta_kills: i32, - #[serde(rename = "perks")] - pub perks: crate::models::match_v5::Perks, - #[serde(rename = "physicalDamageDealt")] - pub physical_damage_dealt: i32, - #[serde(rename = "physicalDamageDealtToChampions")] - pub physical_damage_dealt_to_champions: i32, - #[serde(rename = "physicalDamageTaken")] - pub physical_damage_taken: i32, - #[serde(rename = "placement")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub placement: Option, - #[serde(rename = "playerAugment1")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_augment1: Option, - #[serde(rename = "playerAugment2")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_augment2: Option, - #[serde(rename = "playerAugment3")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_augment3: Option, - #[serde(rename = "playerAugment4")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_augment4: Option, - #[serde(rename = "playerSubteamId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_subteam_id: Option, - /// Green minion - #[serde(rename = "pushPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub push_pings: Option, - #[serde(rename = "profileIcon")] - pub profile_icon: i32, - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "quadraKills")] - pub quadra_kills: i32, - #[serde(rename = "riotIdGameName")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id_game_name: Option, - #[serde(rename = "riotIdTagline")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id_tagline: Option, - #[serde(rename = "role")] - pub role: String, - #[serde(rename = "sightWardsBoughtInGame")] - pub sight_wards_bought_in_game: i32, - #[serde(rename = "spell1Casts")] - pub spell1_casts: i32, - #[serde(rename = "spell2Casts")] - pub spell2_casts: i32, - #[serde(rename = "spell3Casts")] - pub spell3_casts: i32, - #[serde(rename = "spell4Casts")] - pub spell4_casts: i32, - #[serde(rename = "subteamPlacement")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub subteam_placement: Option, - #[serde(rename = "summoner1Casts")] - pub summoner1_casts: i32, - #[serde(rename = "summoner1Id")] - pub summoner1_id: i32, - #[serde(rename = "summoner2Casts")] - pub summoner2_casts: i32, - #[serde(rename = "summoner2Id")] - pub summoner2_id: i32, - #[serde(rename = "summonerId")] - pub summoner_id: String, - #[serde(rename = "summonerLevel")] - pub summoner_level: i32, - #[serde(rename = "summonerName")] - pub summoner_name: String, - #[serde(rename = "teamEarlySurrendered")] - pub team_early_surrendered: bool, - #[serde(rename = "teamId")] - 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, - #[serde(rename = "timeCCingOthers")] - pub time_c_cing_others: i32, - #[serde(rename = "timePlayed")] - pub time_played: i32, - #[serde(rename = "totalAllyJungleMinionsKilled")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_ally_jungle_minions_killed: Option, - #[serde(rename = "totalDamageDealt")] - pub total_damage_dealt: i32, - #[serde(rename = "totalDamageDealtToChampions")] - pub total_damage_dealt_to_champions: i32, - #[serde(rename = "totalDamageShieldedOnTeammates")] - pub total_damage_shielded_on_teammates: i32, - #[serde(rename = "totalDamageTaken")] - pub total_damage_taken: i32, - #[serde(rename = "totalEnemyJungleMinionsKilled")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_enemy_jungle_minions_killed: Option, - /// Whenever positive health is applied (which translates to all heals in the game but not things like regeneration), totalHeal is incremented by the amount of health received. This includes healing enemies, jungle monsters, yourself, etc - #[serde(rename = "totalHeal")] - pub total_heal: i32, - /// Whenever positive health is applied (which translates to all heals in the game but not things like regeneration), totalHealsOnTeammates is incremented by the amount of health received. This is post modified, so if you heal someone missing 5 health for 100 you will get +5 totalHealsOnTeammates - #[serde(rename = "totalHealsOnTeammates")] - pub total_heals_on_teammates: i32, - /// totalMillionsKilled = mMinionsKilled, which is only incremented on kills of kTeamMinion, kMeleeLaneMinion, kSuperLaneMinion, kRangedLaneMinion and kSiegeLaneMinion - #[serde(rename = "totalMinionsKilled")] - pub total_minions_killed: i32, - #[serde(rename = "totalTimeCCDealt")] - pub total_time_cc_dealt: i32, - #[serde(rename = "totalTimeSpentDead")] - pub total_time_spent_dead: i32, - #[serde(rename = "totalUnitsHealed")] - pub total_units_healed: i32, - #[serde(rename = "tripleKills")] - pub triple_kills: i32, - #[serde(rename = "trueDamageDealt")] - pub true_damage_dealt: i32, - #[serde(rename = "trueDamageDealtToChampions")] - pub true_damage_dealt_to_champions: i32, - #[serde(rename = "trueDamageTaken")] - pub true_damage_taken: i32, - #[serde(rename = "turretKills")] - pub turret_kills: i32, - #[serde(rename = "turretTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub turret_takedowns: Option, - #[serde(rename = "turretsLost")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub turrets_lost: Option, - #[serde(rename = "unrealKills")] - pub unreal_kills: i32, - #[serde(rename = "visionScore")] - pub vision_score: i32, - #[serde(rename = "visionClearedPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vision_cleared_pings: Option, - #[serde(rename = "visionWardsBoughtInGame")] - pub vision_wards_bought_in_game: i32, - #[serde(rename = "wardsKilled")] - pub wards_killed: i32, - #[serde(rename = "wardsPlaced")] - pub wards_placed: i32, - #[serde(rename = "win")] - pub win: bool, - #[serde(rename = "baitPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bait_pings: Option, - /// - #[serde(rename = "dangerPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub danger_pings: Option, - /// - #[serde(rename = "basicPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub basic_pings: Option, - #[serde(rename = "playerAugment5")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_augment5: Option, - #[serde(rename = "playerAugment6")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_augment6: Option, - /// Deprecated, use `riotIdGameName`. This field name was briefly used instead of `riotIdGameName`, prior to patch 14.5. - #[serde(rename = "riotIdName")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id_name: Option, - /// - #[serde(rename = "retreatPings")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub retreat_pings: Option, - } - /// `match-v5.ChallengesDto` data object. - /// # Description - /// Challenges DTO - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Challenges { - #[serde(rename = "12AssistStreakCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub x12_assist_streak_count: Option, - #[serde(rename = "baronBuffGoldAdvantageOverThreshold")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub baron_buff_gold_advantage_over_threshold: Option, - #[serde(rename = "controlWardTimeCoverageInRiverOrEnemyHalf")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub control_ward_time_coverage_in_river_or_enemy_half: Option, - #[serde(rename = "earliestBaron")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub earliest_baron: Option, - #[serde(rename = "earliestDragonTakedown")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub earliest_dragon_takedown: Option, - #[serde(rename = "earliestElderDragon")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub earliest_elder_dragon: Option, - #[serde(rename = "earlyLaningPhaseGoldExpAdvantage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub early_laning_phase_gold_exp_advantage: Option, - #[serde(rename = "fasterSupportQuestCompletion")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub faster_support_quest_completion: Option, - #[serde(rename = "fastestLegendary")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fastest_legendary: Option, - #[serde(rename = "hadAfkTeammate")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub had_afk_teammate: Option, - #[serde(rename = "highestChampionDamage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub highest_champion_damage: Option, - #[serde(rename = "highestCrowdControlScore")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub highest_crowd_control_score: Option, - #[serde(rename = "highestWardKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub highest_ward_kills: Option, - #[serde(rename = "junglerKillsEarlyJungle")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jungler_kills_early_jungle: Option, - #[serde(rename = "killsOnLanersEarlyJungleAsJungler")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills_on_laners_early_jungle_as_jungler: Option, - #[serde(rename = "laningPhaseGoldExpAdvantage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub laning_phase_gold_exp_advantage: Option, - #[serde(rename = "legendaryCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legendary_count: Option, - #[serde(rename = "maxCsAdvantageOnLaneOpponent")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub max_cs_advantage_on_lane_opponent: Option, - #[serde(rename = "maxLevelLeadLaneOpponent")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub max_level_lead_lane_opponent: Option, - #[serde(rename = "mostWardsDestroyedOneSweeper")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub most_wards_destroyed_one_sweeper: Option, - #[serde(rename = "mythicItemUsed")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mythic_item_used: Option, - #[serde(rename = "playedChampSelectPosition")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub played_champ_select_position: Option, - #[serde(rename = "soloTurretsLategame")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub solo_turrets_lategame: Option, - #[serde(rename = "takedownsFirst25Minutes")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns_first25_minutes: Option, - #[serde(rename = "teleportTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub teleport_takedowns: Option, - #[serde(rename = "thirdInhibitorDestroyedTime")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub third_inhibitor_destroyed_time: Option, - #[serde(rename = "threeWardsOneSweeperCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub three_wards_one_sweeper_count: Option, - #[serde(rename = "visionScoreAdvantageLaneOpponent")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vision_score_advantage_lane_opponent: Option, - #[serde(rename = "InfernalScalePickup")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub infernal_scale_pickup: Option, - #[serde(rename = "fistBumpParticipation")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fist_bump_participation: Option, - #[serde(rename = "voidMonsterKill")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub void_monster_kill: Option, - #[serde(rename = "abilityUses")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ability_uses: Option, - #[serde(rename = "acesBefore15Minutes")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub aces_before15_minutes: Option, - #[serde(rename = "alliedJungleMonsterKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub allied_jungle_monster_kills: Option, - #[serde(rename = "baronTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub baron_takedowns: Option, - #[serde(rename = "blastConeOppositeOpponentCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub blast_cone_opposite_opponent_count: Option, - #[serde(rename = "bountyGold")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bounty_gold: Option, - #[serde(rename = "buffsStolen")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub buffs_stolen: Option, - #[serde(rename = "completeSupportQuestInTime")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub complete_support_quest_in_time: Option, - #[serde(rename = "controlWardsPlaced")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub control_wards_placed: Option, - #[serde(rename = "damagePerMinute")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_per_minute: Option, - #[serde(rename = "damageTakenOnTeamPercentage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_taken_on_team_percentage: Option, - #[serde(rename = "dancedWithRiftHerald")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub danced_with_rift_herald: Option, - #[serde(rename = "deathsByEnemyChamps")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deaths_by_enemy_champs: Option, - #[serde(rename = "dodgeSkillShotsSmallWindow")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dodge_skill_shots_small_window: Option, - #[serde(rename = "doubleAces")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub double_aces: Option, - #[serde(rename = "dragonTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub dragon_takedowns: Option, - #[serde(rename = "legendaryItemUsed")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub legendary_item_used: Option>, - #[serde(rename = "effectiveHealAndShielding")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub effective_heal_and_shielding: Option, - #[serde(rename = "elderDragonKillsWithOpposingSoul")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub elder_dragon_kills_with_opposing_soul: Option, - #[serde(rename = "elderDragonMultikills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub elder_dragon_multikills: Option, - #[serde(rename = "enemyChampionImmobilizations")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enemy_champion_immobilizations: Option, - #[serde(rename = "enemyJungleMonsterKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub enemy_jungle_monster_kills: Option, - #[serde(rename = "epicMonsterKillsNearEnemyJungler")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub epic_monster_kills_near_enemy_jungler: Option, - #[serde(rename = "epicMonsterKillsWithin30SecondsOfSpawn")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub epic_monster_kills_within30_seconds_of_spawn: Option, - #[serde(rename = "epicMonsterSteals")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub epic_monster_steals: Option, - #[serde(rename = "epicMonsterStolenWithoutSmite")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub epic_monster_stolen_without_smite: Option, - #[serde(rename = "firstTurretKilled")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first_turret_killed: Option, - #[serde(rename = "firstTurretKilledTime")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first_turret_killed_time: Option, - #[serde(rename = "flawlessAces")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub flawless_aces: Option, - #[serde(rename = "fullTeamTakedown")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub full_team_takedown: Option, - #[serde(rename = "gameLength")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_length: Option, - #[serde(rename = "getTakedownsInAllLanesEarlyJungleAsLaner")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub get_takedowns_in_all_lanes_early_jungle_as_laner: Option, - #[serde(rename = "goldPerMinute")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gold_per_minute: Option, - #[serde(rename = "hadOpenNexus")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub had_open_nexus: Option, - #[serde(rename = "immobilizeAndKillWithAlly")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub immobilize_and_kill_with_ally: Option, - #[serde(rename = "initialBuffCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub initial_buff_count: Option, - #[serde(rename = "initialCrabCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub initial_crab_count: Option, - #[serde(rename = "jungleCsBefore10Minutes")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jungle_cs_before10_minutes: Option, - #[serde(rename = "junglerTakedownsNearDamagedEpicMonster")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub jungler_takedowns_near_damaged_epic_monster: Option, - #[serde(rename = "kda")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kda: Option, - #[serde(rename = "killAfterHiddenWithAlly")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kill_after_hidden_with_ally: Option, - #[serde(rename = "killedChampTookFullTeamDamageSurvived")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub killed_champ_took_full_team_damage_survived: Option, - #[serde(rename = "killingSprees")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub killing_sprees: Option, - #[serde(rename = "killParticipation")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kill_participation: Option, - #[serde(rename = "killsNearEnemyTurret")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills_near_enemy_turret: Option, - #[serde(rename = "killsOnOtherLanesEarlyJungleAsLaner")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills_on_other_lanes_early_jungle_as_laner: Option, - #[serde(rename = "killsOnRecentlyHealedByAramPack")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills_on_recently_healed_by_aram_pack: Option, - #[serde(rename = "killsUnderOwnTurret")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills_under_own_turret: Option, - #[serde(rename = "killsWithHelpFromEpicMonster")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills_with_help_from_epic_monster: Option, - #[serde(rename = "knockEnemyIntoTeamAndKill")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub knock_enemy_into_team_and_kill: Option, - #[serde(rename = "kTurretsDestroyedBeforePlatesFall")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub k_turrets_destroyed_before_plates_fall: Option, - #[serde(rename = "landSkillShotsEarlyGame")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub land_skill_shots_early_game: Option, - #[serde(rename = "laneMinionsFirst10Minutes")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub lane_minions_first10_minutes: Option, - #[serde(rename = "lostAnInhibitor")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub lost_an_inhibitor: Option, - #[serde(rename = "maxKillDeficit")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub max_kill_deficit: Option, - #[serde(rename = "mejaisFullStackInTime")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mejais_full_stack_in_time: Option, - #[serde(rename = "moreEnemyJungleThanOpponent")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub more_enemy_jungle_than_opponent: Option, - /// This is an offshoot of the OneStone challenge. The code checks if a spell with the same instance ID does the final point of damage to at least 2 Champions. It doesn't matter if they're enemies, but you cannot hurt your friends. - #[serde(rename = "multiKillOneSpell")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multi_kill_one_spell: Option, - #[serde(rename = "multikills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multikills: Option, - #[serde(rename = "multikillsAfterAggressiveFlash")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multikills_after_aggressive_flash: Option, - #[serde(rename = "multiTurretRiftHeraldCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multi_turret_rift_herald_count: Option, - #[serde(rename = "outerTurretExecutesBefore10Minutes")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outer_turret_executes_before10_minutes: Option, - #[serde(rename = "outnumberedKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outnumbered_kills: Option, - #[serde(rename = "outnumberedNexusKill")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub outnumbered_nexus_kill: Option, - #[serde(rename = "perfectDragonSoulsTaken")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub perfect_dragon_souls_taken: Option, - #[serde(rename = "perfectGame")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub perfect_game: Option, - #[serde(rename = "pickKillWithAlly")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub pick_kill_with_ally: Option, - #[serde(rename = "poroExplosions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub poro_explosions: Option, - #[serde(rename = "quickCleanse")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quick_cleanse: Option, - #[serde(rename = "quickFirstTurret")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quick_first_turret: Option, - #[serde(rename = "quickSoloKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quick_solo_kills: Option, - #[serde(rename = "riftHeraldTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rift_herald_takedowns: Option, - #[serde(rename = "saveAllyFromDeath")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub save_ally_from_death: Option, - #[serde(rename = "scuttleCrabKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub scuttle_crab_kills: Option, - #[serde(rename = "shortestTimeToAceFromFirstTakedown")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub shortest_time_to_ace_from_first_takedown: Option, - #[serde(rename = "skillshotsDodged")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub skillshots_dodged: Option, - #[serde(rename = "skillshotsHit")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub skillshots_hit: Option, - #[serde(rename = "snowballsHit")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub snowballs_hit: Option, - #[serde(rename = "soloBaronKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub solo_baron_kills: Option, - #[serde(rename = "SWARM_DefeatAatrox")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_defeat_aatrox: Option, - #[serde(rename = "SWARM_DefeatBriar")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_defeat_briar: Option, - #[serde(rename = "SWARM_DefeatMiniBosses")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_defeat_mini_bosses: Option, - #[serde(rename = "SWARM_EvolveWeapon")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_evolve_weapon: Option, - #[serde(rename = "SWARM_Have3Passives")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_have3_passives: Option, - #[serde(rename = "SWARM_KillEnemy")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_kill_enemy: Option, - #[serde(rename = "SWARM_PickupGold")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_pickup_gold: Option, - #[serde(rename = "SWARM_ReachLevel50")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_reach_level50: Option, - #[serde(rename = "SWARM_Survive15Min")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_survive15_min: Option, - #[serde(rename = "SWARM_WinWith5EvolvedWeapons")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub swarm_win_with5_evolved_weapons: Option, - #[serde(rename = "soloKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub solo_kills: Option, - #[serde(rename = "stealthWardsPlaced")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stealth_wards_placed: Option, - #[serde(rename = "survivedSingleDigitHpCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub survived_single_digit_hp_count: Option, - #[serde(rename = "survivedThreeImmobilizesInFight")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub survived_three_immobilizes_in_fight: Option, - #[serde(rename = "takedownOnFirstTurret")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedown_on_first_turret: Option, - #[serde(rename = "takedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns: Option, - #[serde(rename = "takedownsAfterGainingLevelAdvantage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns_after_gaining_level_advantage: Option, - #[serde(rename = "takedownsBeforeJungleMinionSpawn")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns_before_jungle_minion_spawn: Option, - #[serde(rename = "takedownsFirstXMinutes")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns_first_x_minutes: Option, - #[serde(rename = "takedownsInAlcove")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns_in_alcove: Option, - #[serde(rename = "takedownsInEnemyFountain")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub takedowns_in_enemy_fountain: Option, - #[serde(rename = "teamBaronKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team_baron_kills: Option, - #[serde(rename = "teamDamagePercentage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team_damage_percentage: Option, - #[serde(rename = "teamElderDragonKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team_elder_dragon_kills: Option, - #[serde(rename = "teamRiftHeraldKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team_rift_herald_kills: Option, - #[serde(rename = "tookLargeDamageSurvived")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub took_large_damage_survived: Option, - #[serde(rename = "turretPlatesTaken")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub turret_plates_taken: Option, - /// Any player who damages a tower that is destroyed within 30 seconds of a Rift Herald charge will receive credit. A player who does not damage the tower will not receive credit. - #[serde(rename = "turretsTakenWithRiftHerald")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub turrets_taken_with_rift_herald: Option, - #[serde(rename = "turretTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub turret_takedowns: Option, - #[serde(rename = "twentyMinionsIn3SecondsCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub twenty_minions_in3_seconds_count: Option, - #[serde(rename = "twoWardsOneSweeperCount")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub two_wards_one_sweeper_count: Option, - #[serde(rename = "unseenRecalls")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unseen_recalls: Option, - #[serde(rename = "visionScorePerMinute")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vision_score_per_minute: Option, - #[serde(rename = "wardsGuarded")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub wards_guarded: Option, - #[serde(rename = "wardTakedowns")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ward_takedowns: Option, - #[serde(rename = "wardTakedownsBefore20M")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ward_takedowns_before20_m: Option, - #[serde(rename = "HealFromMapSources")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub heal_from_map_sources: Option, - } - /// `match-v5.MissionsDto` data object. - /// # Description - /// Missions DTO - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Missions { - #[serde(rename = "playerScore0", alias = "PlayerScore0")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score0: Option, - #[serde(rename = "playerScore1", alias = "PlayerScore1")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score1: Option, - #[serde(rename = "playerScore2", alias = "PlayerScore2")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score2: Option, - #[serde(rename = "playerScore3", alias = "PlayerScore3")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score3: Option, - #[serde(rename = "playerScore4", alias = "PlayerScore4")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score4: Option, - #[serde(rename = "playerScore5", alias = "PlayerScore5")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score5: Option, - #[serde(rename = "playerScore6", alias = "PlayerScore6")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score6: Option, - #[serde(rename = "playerScore7", alias = "PlayerScore7")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score7: Option, - #[serde(rename = "playerScore8", alias = "PlayerScore8")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score8: Option, - #[serde(rename = "playerScore9", alias = "PlayerScore9")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score9: Option, - #[serde(rename = "playerScore10", alias = "PlayerScore10")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score10: Option, - #[serde(rename = "playerScore11", alias = "PlayerScore11")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score11: Option, - } - /// `match-v5.PerksDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Perks { - #[serde(rename = "statPerks")] - pub stat_perks: crate::models::match_v5::PerkStats, - #[serde(rename = "styles")] - pub styles: std::vec::Vec, - } - /// `match-v5.PerkStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PerkStats { - #[serde(rename = "defense")] - pub defense: i32, - #[serde(rename = "flex")] - pub flex: i32, - #[serde(rename = "offense")] - pub offense: i32, - } - /// `match-v5.PerkStyleDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PerkStyle { - #[serde(rename = "description")] - pub description: String, - #[serde(rename = "selections")] - pub selections: std::vec::Vec, - #[serde(rename = "style")] - pub style: i32, - } - /// `match-v5.PerkStyleSelectionDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PerkStyleSelection { - #[serde(rename = "perk")] - pub perk: i32, - #[serde(rename = "var1")] - pub var1: i32, - #[serde(rename = "var2")] - pub var2: i32, - #[serde(rename = "var3")] - pub var3: i32, - } - /// `match-v5.TeamDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Team { - #[serde(rename = "bans")] - pub bans: std::vec::Vec, - #[serde(rename = "objectives")] - pub objectives: crate::models::match_v5::Objectives, - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - #[serde(rename = "win")] - pub win: bool, - #[serde(rename = "feats")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feats: Option, - } - /// `match-v5.BanDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Ban { - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - #[serde(rename = "pickTurn")] - pub pick_turn: i32, - } - /// `match-v5.ObjectivesDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Objectives { - #[serde(rename = "baron")] - pub baron: crate::models::match_v5::Objective, - #[serde(rename = "champion")] - pub champion: crate::models::match_v5::Objective, - #[serde(rename = "dragon")] - pub dragon: crate::models::match_v5::Objective, - #[serde(rename = "horde")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub horde: Option, - #[serde(rename = "inhibitor")] - pub inhibitor: crate::models::match_v5::Objective, - #[serde(rename = "riftHerald")] - pub rift_herald: crate::models::match_v5::Objective, - #[serde(rename = "tower")] - pub tower: crate::models::match_v5::Objective, - #[serde(rename = "atakhan")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub atakhan: Option, - } - /// `match-v5.ObjectiveDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Objective { - #[serde(rename = "first")] - pub first: bool, - #[serde(rename = "kills")] - pub kills: i32, - } - /// `match-v5.TimelineDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Timeline { - /// Match metadata. - #[serde(rename = "metadata")] - pub metadata: crate::models::match_v5::MetadataTimeLine, - /// Match info. - #[serde(rename = "info")] - pub info: crate::models::match_v5::InfoTimeLine, - } - /// `match-v5.MetadataTimeLineDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MetadataTimeLine { - /// Match data version. - #[serde(rename = "dataVersion")] - pub data_version: String, - /// Match id. - #[serde(rename = "matchId")] - pub match_id: String, - /// A list of participant PUUIDs. - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - } - /// `match-v5.InfoTimeLineDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct InfoTimeLine { - /// Refer to indicate if the game ended in termination. - #[serde(rename = "endOfGameResult")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_of_game_result: Option, - #[serde(rename = "frameInterval")] - pub frame_interval: i64, - #[serde(rename = "gameId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_id: Option, - #[serde(rename = "participants")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub participants: Option>, - #[serde(rename = "frames")] - pub frames: std::vec::Vec, - } - /// `match-v5.ParticipantTimeLineDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ParticipantTimeLine { - #[serde(rename = "participantId")] - pub participant_id: i32, - #[serde(rename = "puuid")] - pub puuid: String, - } - /// `match-v5.FramesTimeLineDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FramesTimeLine { - #[serde(rename = "events")] - pub events: std::vec::Vec, - #[serde(rename = "participantFrames")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub participant_frames: Option>, - #[serde(rename = "timestamp")] - pub timestamp: i32, - } - /// `match-v5.EventsTimeLineDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct EventsTimeLine { - #[serde(rename = "timestamp")] - pub timestamp: i64, - #[serde(rename = "realTimestamp")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub real_timestamp: Option, - #[serde(rename = "type")] - pub r#type: String, - #[serde(rename = "itemId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item_id: Option, - #[serde(rename = "participantId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub participant_id: Option, - #[serde(rename = "levelUpType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level_up_type: Option, - #[serde(rename = "skillSlot")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub skill_slot: Option, - #[serde(rename = "creatorId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub creator_id: Option, - #[serde(rename = "wardType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ward_type: Option, - #[serde(rename = "level")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub level: Option, - #[serde(rename = "assistingParticipantIds")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub assisting_participant_ids: Option>, - #[serde(rename = "bounty")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bounty: Option, - #[serde(rename = "killStreakLength")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kill_streak_length: Option, - #[serde(rename = "killerId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub killer_id: Option, - #[serde(rename = "position")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub position: Option, - #[serde(rename = "victimDamageDealt")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub victim_damage_dealt: Option>, - #[serde(rename = "victimDamageReceived")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub victim_damage_received: Option>, - #[serde(rename = "victimId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub victim_id: Option, - #[serde(rename = "killType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kill_type: Option, - #[serde(rename = "laneType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub lane_type: Option, - #[serde(rename = "teamId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub team_id: Option, - #[serde(rename = "multiKillLength")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub multi_kill_length: Option, - #[serde(rename = "killerTeamId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub killer_team_id: Option, - #[serde(rename = "monsterType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub monster_type: Option, - #[serde(rename = "monsterSubType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub monster_sub_type: Option, - #[serde(rename = "buildingType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub building_type: Option, - #[serde(rename = "towerType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tower_type: Option, - #[serde(rename = "afterId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub after_id: Option, - #[serde(rename = "beforeId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub before_id: Option, - #[serde(rename = "goldGain")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gold_gain: Option, - #[serde(rename = "gameId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_id: Option, - #[serde(rename = "winningTeam")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub winning_team: Option, - #[serde(rename = "transformType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub transform_type: Option, - #[serde(rename = "name")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "shutdownBounty")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub shutdown_bounty: Option, - #[serde(rename = "actualStartTime")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub actual_start_time: Option, - #[serde(rename = "featType")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feat_type: Option, - #[serde(rename = "featValue")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feat_value: Option, - } - /// `match-v5.ParticipantFramesDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ParticipantFrames { - /// Key value mapping for each participant - #[serde(rename = "1-9")] - pub x1_9: crate::models::match_v5::ParticipantFrame, - } - /// `match-v5.ParticipantFrameDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ParticipantFrame { - #[serde(rename = "championStats")] - pub champion_stats: crate::models::match_v5::ChampionStats, - #[serde(rename = "currentGold")] - pub current_gold: i32, - #[serde(rename = "damageStats")] - pub damage_stats: crate::models::match_v5::DamageStats, - #[serde(rename = "goldPerSecond")] - pub gold_per_second: i32, - #[serde(rename = "jungleMinionsKilled")] - pub jungle_minions_killed: i32, - #[serde(rename = "level")] - pub level: i32, - #[serde(rename = "minionsKilled")] - pub minions_killed: i32, - #[serde(rename = "participantId")] - pub participant_id: i32, - #[serde(rename = "position")] - pub position: crate::models::match_v5::Position, - #[serde(rename = "timeEnemySpentControlled")] - pub time_enemy_spent_controlled: i32, - #[serde(rename = "totalGold")] - pub total_gold: i32, - #[serde(rename = "xp")] - pub xp: i32, - } - /// `match-v5.ChampionStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ChampionStats { - #[serde(rename = "abilityHaste")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ability_haste: Option, - #[serde(rename = "abilityPower")] - pub ability_power: i32, - #[serde(rename = "armor")] - pub armor: i32, - #[serde(rename = "armorPen")] - pub armor_pen: i32, - #[serde(rename = "armorPenPercent")] - pub armor_pen_percent: i32, - #[serde(rename = "attackDamage")] - pub attack_damage: i32, - #[serde(rename = "attackSpeed")] - pub attack_speed: i32, - #[serde(rename = "bonusArmorPenPercent")] - pub bonus_armor_pen_percent: i32, - #[serde(rename = "bonusMagicPenPercent")] - pub bonus_magic_pen_percent: i32, - #[serde(rename = "ccReduction")] - pub cc_reduction: i32, - #[serde(rename = "cooldownReduction")] - pub cooldown_reduction: i32, - #[serde(rename = "health")] - pub health: i32, - #[serde(rename = "healthMax")] - pub health_max: i32, - #[serde(rename = "healthRegen")] - pub health_regen: i32, - #[serde(rename = "lifesteal")] - pub lifesteal: i32, - #[serde(rename = "magicPen")] - pub magic_pen: i32, - #[serde(rename = "magicPenPercent")] - pub magic_pen_percent: i32, - #[serde(rename = "magicResist")] - pub magic_resist: i32, - #[serde(rename = "movementSpeed")] - pub movement_speed: i32, - #[serde(rename = "omnivamp")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub omnivamp: Option, - #[serde(rename = "physicalVamp")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_vamp: Option, - #[serde(rename = "power")] - pub power: i32, - #[serde(rename = "powerMax")] - pub power_max: i32, - #[serde(rename = "powerRegen")] - pub power_regen: i32, - #[serde(rename = "spellVamp")] - pub spell_vamp: i32, - } - /// `match-v5.DamageStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct DamageStats { - #[serde(rename = "magicDamageDone")] - pub magic_damage_done: i32, - #[serde(rename = "magicDamageDoneToChampions")] - pub magic_damage_done_to_champions: i32, - #[serde(rename = "magicDamageTaken")] - pub magic_damage_taken: i32, - #[serde(rename = "physicalDamageDone")] - pub physical_damage_done: i32, - #[serde(rename = "physicalDamageDoneToChampions")] - pub physical_damage_done_to_champions: i32, - #[serde(rename = "physicalDamageTaken")] - pub physical_damage_taken: i32, - #[serde(rename = "totalDamageDone")] - pub total_damage_done: i32, - #[serde(rename = "totalDamageDoneToChampions")] - pub total_damage_done_to_champions: i32, - #[serde(rename = "totalDamageTaken")] - pub total_damage_taken: i32, - #[serde(rename = "trueDamageDone")] - pub true_damage_done: i32, - #[serde(rename = "trueDamageDoneToChampions")] - pub true_damage_done_to_champions: i32, - #[serde(rename = "trueDamageTaken")] - pub true_damage_taken: i32, - } - /// `match-v5.PositionDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Position { - #[serde(rename = "x")] - pub x: i32, - #[serde(rename = "y")] - pub y: i32, - } - /// `match-v5.FeatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Feats { - #[serde(rename = "EPIC_MONSTER_KILL")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub epic_monster_kill: Option, - #[serde(rename = "FIRST_BLOOD")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first_blood: Option, - #[serde(rename = "FIRST_TURRET")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub first_turret: Option, - } - /// `match-v5.MatchTimelineVictimDamage` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MatchTimelineVictimDamage { - #[serde(rename = "basic")] - pub basic: bool, - #[serde(rename = "magicDamage")] - pub magic_damage: i32, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "participantId")] - pub participant_id: i32, - #[serde(rename = "physicalDamage")] - pub physical_damage: i32, - #[serde(rename = "spellName")] - pub spell_name: String, - #[serde(rename = "spellSlot")] - pub spell_slot: i32, - #[serde(rename = "trueDamage")] - pub true_damage: i32, - #[serde(rename = "type")] - pub r#type: String, - } - /// `match-v5.FeatDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Feat { - #[serde(rename = "featState")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub feat_state: Option, - } -} - -/// Data structs used by [`SpectatorTftV5`](crate::endpoints::SpectatorTftV5). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod spectator_tft_v5 { - /// `spectator-tft-v5.CurrentGameInfo` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct CurrentGameInfo { - /// The ID of the game - #[serde(rename = "gameId")] - pub game_id: i64, - /// The game type - #[serde(rename = "gameType")] - pub game_type: crate::consts::GameType, - /// The game start time represented in epoch milliseconds - #[serde(rename = "gameStartTime")] - pub game_start_time: i64, - /// The ID of the map - #[serde(rename = "mapId")] - pub map_id: crate::consts::Map, - /// The amount of time in seconds that has passed since the game started - #[serde(rename = "gameLength")] - pub game_length: i64, - /// The ID of the platform on which the game is being played - #[serde(rename = "platformId")] - pub platform_id: String, - /// The game mode - #[serde(rename = "gameMode")] - pub game_mode: crate::consts::GameMode, - /// Banned champion information - #[serde(rename = "bannedChampions")] - pub banned_champions: std::vec::Vec, - /// The queue type (queue types are documented on the Game Constants page) - #[serde(rename = "gameQueueConfigId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_queue_config_id: Option, - /// The observer information - #[serde(rename = "observers")] - pub observers: crate::models::spectator_tft_v5::Observer, - /// The participant information - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - } - /// `spectator-tft-v5.BannedChampion` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct BannedChampion { - /// The turn during which the champion was banned - #[serde(rename = "pickTurn")] - pub pick_turn: i32, - /// The ID of the banned champion - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// The ID of the team that banned the champion - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - } - /// `spectator-tft-v5.Observer` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Observer { - /// Key used to decrypt the spectator grid game data for playback - #[serde(rename = "encryptionKey")] - pub encryption_key: String, - } - /// `spectator-tft-v5.CurrentGameParticipant` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct CurrentGameParticipant { - /// The ID of the champion played by this participant - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// Perks/Runes Reforged Information - #[serde(rename = "perks")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub perks: Option, - /// The ID of the profile icon used by this participant - #[serde(rename = "profileIconId")] - pub profile_icon_id: i64, - /// The team ID of this participant, indicating the participant's team - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - /// The encrypted summoner ID of this participant - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// The encrypted puuid of this participant - #[serde(rename = "puuid")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub puuid: Option, - /// The ID of the first summoner spell used by this participant - #[serde(rename = "spell1Id")] - pub spell1_id: i64, - /// The ID of the second summoner spell used by this participant - #[serde(rename = "spell2Id")] - pub spell2_id: i64, - /// List of Game Customizations - #[serde(rename = "gameCustomizationObjects")] - pub game_customization_objects: std::vec::Vec, - #[serde(rename = "riotId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id: Option, - } - /// `spectator-tft-v5.Perks` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Perks { - /// IDs of the perks/runes assigned. - #[serde(rename = "perkIds")] - pub perk_ids: std::vec::Vec, - /// Primary runes path - #[serde(rename = "perkStyle")] - pub perk_style: i64, - /// Secondary runes path - #[serde(rename = "perkSubStyle")] - pub perk_sub_style: i64, - } - /// `spectator-tft-v5.GameCustomizationObject` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct GameCustomizationObject { - /// Category identifier for Game Customization - #[serde(rename = "category")] - pub category: String, - /// Game Customization content - #[serde(rename = "content")] - pub content: String, - } - /// `spectator-tft-v5.FeaturedGames` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FeaturedGames { - /// The list of featured games - #[serde(rename = "gameList")] - pub game_list: std::vec::Vec, - /// The suggested interval to wait before requesting FeaturedGames again - #[serde(rename = "clientRefreshInterval")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub client_refresh_interval: Option, - } - /// `spectator-tft-v5.FeaturedGameInfo` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FeaturedGameInfo { - /// The game mode
- /// (Legal values: TFT) - #[serde(rename = "gameMode")] - pub game_mode: crate::consts::GameMode, - /// The amount of time in seconds that has passed since the game started - #[serde(rename = "gameLength")] - pub game_length: i64, - /// The ID of the map - #[serde(rename = "mapId")] - pub map_id: crate::consts::Map, - /// The game type
- /// (Legal values: MATCHED) - #[serde(rename = "gameType")] - pub game_type: crate::consts::GameType, - /// Banned champion information - #[serde(rename = "bannedChampions")] - pub banned_champions: std::vec::Vec, - /// The ID of the game - #[serde(rename = "gameId")] - pub game_id: i64, - /// The observer information - #[serde(rename = "observers")] - pub observers: crate::models::spectator_tft_v5::Observer, - /// The queue type (queue types are documented on the Game Constants page) - #[serde(rename = "gameQueueConfigId")] - pub game_queue_config_id: crate::consts::Queue, - /// The participant information - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - /// The ID of the platform on which the game is being played - #[serde(rename = "platformId")] - pub platform_id: String, - } - /// `spectator-tft-v5.Participant` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Participant { - /// The ID of the second summoner spell used by this participant - #[serde(rename = "spell2Id")] - pub spell2_id: i64, - /// The ID of the profile icon used by this participant - #[serde(rename = "profileIconId")] - pub profile_icon_id: i64, - /// Encrypted summoner ID of this participant - #[serde(rename = "summonerId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summoner_id: Option, - /// Encrypted puuid of this participant - #[serde(rename = "puuid")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub puuid: Option, - /// The ID of the champion played by this participant - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// The team ID of this participant, indicating the participant's team - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - /// The ID of the first summoner spell used by this participant - #[serde(rename = "spell1Id")] - pub spell1_id: i64, - #[serde(rename = "riotId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id: Option, - } -} - -/// Data structs used by [`SpectatorV5`](crate::endpoints::SpectatorV5). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod spectator_v5 { - /// `spectator-v5.CurrentGameInfo` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct CurrentGameInfo { - /// The ID of the game - #[serde(rename = "gameId")] - pub game_id: i64, - /// The game type - #[serde(rename = "gameType")] - pub game_type: crate::consts::GameType, - /// The game start time represented in epoch milliseconds - #[serde(rename = "gameStartTime")] - pub game_start_time: i64, - /// The ID of the map - #[serde(rename = "mapId")] - pub map_id: crate::consts::Map, - /// The amount of time in seconds that has passed since the game started - #[serde(rename = "gameLength")] - pub game_length: i64, - /// The ID of the platform on which the game is being played - #[serde(rename = "platformId")] - pub platform_id: String, - /// The game mode - #[serde(rename = "gameMode")] - pub game_mode: crate::consts::GameMode, - /// Banned champion information - #[serde(rename = "bannedChampions")] - pub banned_champions: std::vec::Vec, - /// The queue type (queue types are documented on the Game Constants page) - #[serde(rename = "gameQueueConfigId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_queue_config_id: Option, - /// The observer information - #[serde(rename = "observers")] - pub observers: crate::models::spectator_v5::Observer, - /// The participant information - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - } - /// `spectator-v5.BannedChampion` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct BannedChampion { - /// The turn during which the champion was banned - #[serde(rename = "pickTurn")] - pub pick_turn: i32, - /// The ID of the banned champion - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// The ID of the team that banned the champion - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - } - /// `spectator-v5.Observer` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Observer { - /// Key used to decrypt the spectator grid game data for playback - #[serde(rename = "encryptionKey")] - pub encryption_key: String, - } - /// `spectator-v5.CurrentGameParticipant` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct CurrentGameParticipant { - /// The ID of the champion played by this participant - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// Perks/Runes Reforged Information - #[serde(rename = "perks")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub perks: Option, - /// The ID of the profile icon used by this participant - #[serde(rename = "profileIconId")] - pub profile_icon_id: i64, - /// Flag indicating whether or not this participant is a bot - #[serde(rename = "bot")] - pub bot: bool, - /// The team ID of this participant, indicating the participant's team - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - /// The encrypted summoner ID of this participant - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// The encrypted puuid of this participant - #[serde(rename = "puuid")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub puuid: Option, - /// The ID of the first summoner spell used by this participant - #[serde(rename = "spell1Id")] - pub spell1_id: i64, - /// The ID of the second summoner spell used by this participant - #[serde(rename = "spell2Id")] - pub spell2_id: i64, - /// List of Game Customizations - #[serde(rename = "gameCustomizationObjects")] - pub game_customization_objects: std::vec::Vec, - #[serde(rename = "riotId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id: Option, - } - /// `spectator-v5.Perks` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Perks { - /// IDs of the perks/runes assigned. - #[serde(rename = "perkIds")] - pub perk_ids: std::vec::Vec, - /// Primary runes path - #[serde(rename = "perkStyle")] - pub perk_style: i64, - /// Secondary runes path - #[serde(rename = "perkSubStyle")] - pub perk_sub_style: i64, - } - /// `spectator-v5.GameCustomizationObject` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct GameCustomizationObject { - /// Category identifier for Game Customization - #[serde(rename = "category")] - pub category: String, - /// Game Customization content - #[serde(rename = "content")] - pub content: String, - } - /// `spectator-v5.FeaturedGames` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FeaturedGames { - /// The list of featured games - #[serde(rename = "gameList")] - pub game_list: std::vec::Vec, - /// The suggested interval to wait before requesting FeaturedGames again - #[serde(rename = "clientRefreshInterval")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub client_refresh_interval: Option, - } - /// `spectator-v5.FeaturedGameInfo` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FeaturedGameInfo { - /// The game mode
- /// (Legal values: CLASSIC, ODIN, ARAM, TUTORIAL, ONEFORALL, ASCENSION, FIRSTBLOOD, KINGPORO) - #[serde(rename = "gameMode")] - pub game_mode: crate::consts::GameMode, - /// The amount of time in seconds that has passed since the game started - #[serde(rename = "gameLength")] - pub game_length: i64, - /// The ID of the map - #[serde(rename = "mapId")] - pub map_id: crate::consts::Map, - /// The game type
- /// (Legal values: CUSTOM_GAME, MATCHED_GAME, TUTORIAL_GAME) - #[serde(rename = "gameType")] - pub game_type: crate::consts::GameType, - /// Banned champion information - #[serde(rename = "bannedChampions")] - pub banned_champions: std::vec::Vec, - /// The ID of the game - #[serde(rename = "gameId")] - pub game_id: i64, - /// The observer information - #[serde(rename = "observers")] - pub observers: crate::models::spectator_v5::Observer, - /// The queue type (queue types are documented on the Game Constants page) - #[serde(rename = "gameQueueConfigId")] - pub game_queue_config_id: crate::consts::Queue, - /// The participant information - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - /// The ID of the platform on which the game is being played - #[serde(rename = "platformId")] - pub platform_id: String, - } - /// `spectator-v5.Participant` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Participant { - /// Flag indicating whether or not this participant is a bot - #[serde(rename = "bot")] - pub bot: bool, - /// The ID of the second summoner spell used by this participant - #[serde(rename = "spell2Id")] - pub spell2_id: i64, - /// The ID of the profile icon used by this participant - #[serde(rename = "profileIconId")] - pub profile_icon_id: i64, - /// Encrypted summoner ID of this participant - #[serde(rename = "summonerId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summoner_id: Option, - /// Encrypted puuid of this participant - #[serde(rename = "puuid")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub puuid: Option, - /// The ID of the champion played by this participant - #[serde(rename = "championId")] - pub champion_id: crate::consts::Champion, - /// The team ID of this participant, indicating the participant's team - #[serde(rename = "teamId")] - pub team_id: crate::consts::Team, - /// The ID of the first summoner spell used by this participant - #[serde(rename = "spell1Id")] - pub spell1_id: i64, - #[serde(rename = "riotId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id: Option, - } -} - -/// Data structs used by [`SummonerV4`](crate::endpoints::SummonerV4). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod summoner_v4 { - /// `summoner-v4.SummonerDTO` data object. - /// # Description - /// represents a summoner - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Summoner { - /// Encrypted account ID. Max length 56 characters. - #[serde(rename = "accountId")] - pub account_id: String, - /// ID of the summoner icon associated with the summoner. - #[serde(rename = "profileIconId")] - pub profile_icon_id: i32, - /// 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")] - pub revision_date: i64, - /// Encrypted summoner ID. Max length 63 characters. - #[serde(rename = "id")] - pub id: String, - /// Encrypted PUUID. Exact length of 78 characters. - #[serde(rename = "puuid")] - pub puuid: String, - /// Summoner level associated with the summoner. - #[serde(rename = "summonerLevel")] - pub summoner_level: i64, - } -} - -/// Data structs used by [`TftLeagueV1`](crate::endpoints::TftLeagueV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod tft_league_v1 { - /// `tft-league-v1.LeagueListDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueList { - #[serde(rename = "leagueId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub league_id: Option, - #[serde(rename = "entries")] - pub entries: std::vec::Vec, - #[serde(rename = "tier")] - pub tier: crate::consts::Tier, - #[serde(rename = "name")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - #[serde(rename = "queue")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue: Option, - } - /// `tft-league-v1.LeagueItemDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueItem { - #[serde(rename = "freshBlood")] - pub fresh_blood: bool, - /// First placement. - #[serde(rename = "wins")] - pub wins: i32, - #[serde(rename = "miniSeries")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mini_series: Option, - #[serde(rename = "inactive")] - pub inactive: bool, - #[serde(rename = "veteran")] - pub veteran: bool, - #[serde(rename = "hotStreak")] - pub hot_streak: bool, - #[serde(rename = "rank")] - pub rank: crate::consts::Division, - #[serde(rename = "leaguePoints")] - pub league_points: i32, - /// Second through eighth placement. - #[serde(rename = "losses")] - pub losses: i32, - /// Player's encrypted summonerId. - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// Player's encrypted puuid. - #[serde(rename = "puuid")] - pub puuid: String, - } - /// `tft-league-v1.MiniSeriesDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MiniSeries { - #[serde(rename = "losses")] - pub losses: i32, - #[serde(rename = "progress")] - pub progress: String, - #[serde(rename = "target")] - pub target: i32, - #[serde(rename = "wins")] - pub wins: i32, - } - /// `tft-league-v1.LeagueEntryDTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LeagueEntry { - /// Player Universal Unique Identifier. Exact length of 78 characters. (Encrypted) - #[serde(rename = "puuid")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub puuid: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "leagueId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub league_id: Option, - /// Player's encrypted summonerId. - #[serde(rename = "summonerId")] - pub summoner_id: String, - #[serde(rename = "queueType")] - pub queue_type: crate::consts::QueueType, - /// Only included for the RANKED_TFT_TURBO queueType.
- /// (Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY) - #[serde(rename = "ratedTier")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rated_tier: Option, - /// Only included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "ratedRating")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rated_rating: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "tier")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier: Option, - /// The player's division within a tier. Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "rank")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub rank: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "leaguePoints")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub league_points: Option, - /// First placement. - #[serde(rename = "wins")] - pub wins: i32, - /// Second through eighth placement. - #[serde(rename = "losses")] - pub losses: i32, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "hotStreak")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub hot_streak: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "veteran")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub veteran: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "freshBlood")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub fresh_blood: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "inactive")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inactive: Option, - /// Not included for the RANKED_TFT_TURBO queueType. - #[serde(rename = "miniSeries")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub mini_series: Option, - } - /// `tft-league-v1.TopRatedLadderEntryDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct TopRatedLadderEntry { - #[serde(rename = "summonerId")] - pub summoner_id: String, - /// (Legal values: ORANGE, PURPLE, BLUE, GREEN, GRAY) - #[serde(rename = "ratedTier")] - pub rated_tier: String, - #[serde(rename = "ratedRating")] - pub rated_rating: i32, - /// First placement. - #[serde(rename = "wins")] - pub wins: i32, - #[serde(rename = "previousUpdateLadderPosition")] - pub previous_update_ladder_position: i32, - } -} - -/// Data structs used by [`TftMatchV1`](crate::endpoints::TftMatchV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod tft_match_v1 { - /// `tft-match-v1.MatchDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Match { - /// Match metadata. - #[serde(rename = "metadata")] - pub metadata: crate::models::tft_match_v1::Metadata, - /// Match info. - #[serde(rename = "info")] - pub info: crate::models::tft_match_v1::Info, - } - /// `tft-match-v1.MetadataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - 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 participant PUUIDs. - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - } - /// `tft-match-v1.InfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Info { - /// Unix timestamp. - #[serde(rename = "game_datetime")] - pub game_datetime: i64, - /// Game length in seconds. - #[serde(rename = "game_length")] - pub game_length: f32, - /// Game variation key. Game variations documented in TFT static data. - #[serde(rename = "game_variation")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_variation: Option, - /// Game client version. - #[serde(rename = "game_version")] - pub game_version: String, - #[serde(rename = "participants")] - pub participants: std::vec::Vec, - /// Please refer to the League of Legends documentation. - #[serde(rename = "queue_id")] - pub queue_id: crate::consts::Queue, - /// Teamfight Tactics set number. - #[serde(rename = "tft_set_number")] - pub tft_set_number: i32, - #[serde(rename = "tft_game_type")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tft_game_type: Option, - #[serde(rename = "tft_set_core_name")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tft_set_core_name: Option, - #[serde(rename = "endOfGameResult")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub end_of_game_result: Option, - #[serde(rename = "gameCreation")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_creation: Option, - #[serde(rename = "gameId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_id: Option, - #[serde(rename = "mapId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub map_id: Option, - /// Please refer to the League of Legends documentation. - #[serde(rename = "queueId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub queue_id_: Option, - } - /// `tft-match-v1.ParticipantDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Participant { - /// Participant's companion. - #[serde(rename = "companion")] - pub companion: crate::models::tft_match_v1::Companion, - /// Gold left after participant was eliminated. - #[serde(rename = "gold_left")] - pub gold_left: i32, - /// The round the participant was eliminated in. Note: If the player was eliminated in stage 2-1 their last_round would be 5. - #[serde(rename = "last_round")] - pub last_round: i32, - /// Participant Little Legend level. Note: This is not the number of active units. - #[serde(rename = "level")] - pub level: i32, - /// Participant placement upon elimination. - #[serde(rename = "placement")] - pub placement: i32, - /// Number of players the participant eliminated. - #[serde(rename = "players_eliminated")] - pub players_eliminated: i32, - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "riotIdGameName")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id_game_name: Option, - #[serde(rename = "riotIdTagline")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub riot_id_tagline: Option, - /// The number of seconds before the participant was eliminated. - #[serde(rename = "time_eliminated")] - pub time_eliminated: f32, - /// Damage the participant dealt to other players. - #[serde(rename = "total_damage_to_players")] - pub total_damage_to_players: i32, - /// A complete list of traits for the participant's active units. - #[serde(rename = "traits")] - pub traits: std::vec::Vec, - /// A list of active units for the participant. - #[serde(rename = "units")] - pub units: std::vec::Vec, - #[serde(rename = "augments")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub augments: Option>, - #[serde(rename = "partner_group_id")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub partner_group_id: Option, - #[serde(rename = "missions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub missions: Option, - #[serde(rename = "win")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub win: Option, - #[serde(rename = "skill_tree")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub skill_tree: Option>, - } - /// `tft-match-v1.TraitDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Trait { - /// Trait name. - #[serde(rename = "name")] - pub name: String, - /// Number of units with this trait. - #[serde(rename = "num_units")] - pub num_units: i32, - /// Current style for this trait. (0 = No style, 1 = Bronze, 2 = Silver, 3 = Gold, 4 = Chromatic) - #[serde(rename = "style")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub style: Option, - /// Current active tier for the trait. - #[serde(rename = "tier_current")] - pub tier_current: i32, - /// Total tiers for the trait. - #[serde(rename = "tier_total")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier_total: Option, - } - /// `tft-match-v1.UnitDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Unit { - /// A list of the unit's items. Please refer to the Teamfight Tactics documentation for item ids. - #[serde(rename = "items")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub items: Option>, - /// This field was introduced in patch 9.22 with data_version 2. - #[serde(rename = "character_id")] - pub character_id: String, - /// If a unit is chosen as part of the Fates set mechanic, the chosen trait will be indicated by this field. Otherwise this field is excluded from the response. - #[serde(rename = "chosen")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub chosen: Option, - /// Unit name. This field is often left blank. - #[serde(rename = "name")] - pub name: String, - /// Unit rarity. This doesn't equate to the unit cost. - #[serde(rename = "rarity")] - pub rarity: i32, - /// Unit tier. - #[serde(rename = "tier")] - pub tier: i32, - #[serde(rename = "itemNames")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item_names: Option>, - } - /// `tft-match-v1.CompanionDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Companion { - #[serde(rename = "item_ID")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub item_id: Option, - #[serde(rename = "skin_ID")] - pub skin_id: i32, - #[serde(rename = "content_ID")] - pub content_id: String, - #[serde(rename = "species")] - pub species: String, - } - /// `tft-match-v1.ParticipantMissionsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ParticipantMissions { - #[serde(rename = "Assists")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub assists: Option, - #[serde(rename = "DamageDealt")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_dealt: Option, - #[serde(rename = "DamageDealtToObjectives")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_dealt_to_objectives: Option, - #[serde(rename = "DamageDealtToTurrets")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_dealt_to_turrets: Option, - #[serde(rename = "DamageTaken")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub damage_taken: Option, - #[serde(rename = "DoubleKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub double_kills: Option, - #[serde(rename = "GoldEarned")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gold_earned: Option, - #[serde(rename = "GoldSpent")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub gold_spent: Option, - #[serde(rename = "InhibitorsDestroyed")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub inhibitors_destroyed: Option, - #[serde(rename = "Kills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub kills: Option, - #[serde(rename = "LargestKillingSpree")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub largest_killing_spree: Option, - #[serde(rename = "LargestMultiKill")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub largest_multi_kill: Option, - #[serde(rename = "MagicDamageDealt")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub magic_damage_dealt: Option, - #[serde(rename = "MagicDamageDealtToChampions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub magic_damage_dealt_to_champions: Option, - #[serde(rename = "NeutralMinionsKilledTeamJungle")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub neutral_minions_killed_team_jungle: Option, - #[serde(rename = "PhysicalDamageDealt")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_damage_dealt: Option, - #[serde(rename = "PhysicalDamageTaken")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_damage_taken: Option, - #[serde(rename = "PlayerScore0")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score0: Option, - #[serde(rename = "PlayerScore1")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score1: Option, - #[serde(rename = "PlayerScore2")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score2: Option, - #[serde(rename = "PlayerScore3")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score3: Option, - #[serde(rename = "PlayerScore4")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score4: Option, - #[serde(rename = "PlayerScore5")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score5: Option, - #[serde(rename = "PlayerScore6")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score6: Option, - #[serde(rename = "PlayerScore9")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score9: Option, - #[serde(rename = "PlayerScore10")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score10: Option, - #[serde(rename = "PlayerScore11")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub player_score11: Option, - #[serde(rename = "QuadraKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub quadra_kills: Option, - #[serde(rename = "Spell1Casts")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub spell1_casts: Option, - #[serde(rename = "Spell2Casts")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub spell2_casts: Option, - #[serde(rename = "Spell3Casts")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub spell3_casts: Option, - #[serde(rename = "Spell4Casts")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub spell4_casts: Option, - #[serde(rename = "SummonerSpell1Casts")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub summoner_spell1_casts: Option, - #[serde(rename = "TimeCCOthers")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub time_cc_others: Option, - #[serde(rename = "TotalMinionsKilled")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_minions_killed: Option, - #[serde(rename = "TrueDamageDealtToChampions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub true_damage_dealt_to_champions: Option, - #[serde(rename = "UnrealKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub unreal_kills: Option, - #[serde(rename = "VisionScore")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub vision_score: Option, - #[serde(rename = "WardsKilled")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub wards_killed: Option, - #[serde(rename = "Deaths")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub deaths: Option, - #[serde(rename = "KillingSprees")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub killing_sprees: Option, - #[serde(rename = "MagicDamageTaken")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub magic_damage_taken: Option, - #[serde(rename = "PentaKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub penta_kills: Option, - #[serde(rename = "PhysicalDamageDealtToChampions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub physical_damage_dealt_to_champions: Option, - #[serde(rename = "TotalDamageDealtToChampions")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub total_damage_dealt_to_champions: Option, - #[serde(rename = "TripleKills")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub triple_kills: Option, - #[serde(rename = "TrueDamageDealt")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub true_damage_dealt: Option, - #[serde(rename = "TrueDamageTaken")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub true_damage_taken: Option, - } -} - -/// Data structs used by [`TftStatusV1`](crate::endpoints::TftStatusV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod tft_status_v1 { - /// `tft-status-v1.PlatformDataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlatformData { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "locales")] - pub locales: std::vec::Vec, - #[serde(rename = "maintenances")] - pub maintenances: std::vec::Vec, - #[serde(rename = "incidents")] - pub incidents: std::vec::Vec, - } - /// `tft-status-v1.StatusDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Status { - #[serde(rename = "id")] - pub id: i32, - /// (Legal values: scheduled, in_progress, complete) - #[serde(rename = "maintenance_status")] - pub maintenance_status: String, - /// (Legal values: info, warning, critical) - #[serde(rename = "incident_severity")] - pub incident_severity: String, - #[serde(rename = "titles")] - pub titles: std::vec::Vec, - #[serde(rename = "updates")] - pub updates: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "archive_at")] - pub archive_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - /// (Legal values: windows, macos, android, ios, ps4, xbone, switch) - #[serde(rename = "platforms")] - pub platforms: std::vec::Vec, - } - /// `tft-status-v1.ContentDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Content { - #[serde(rename = "locale")] - pub locale: String, - #[serde(rename = "content")] - pub content: String, - } - /// `tft-status-v1.UpdateDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Update { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "author")] - pub author: String, - #[serde(rename = "publish")] - pub publish: bool, - /// (Legal values: riotclient, riotstatus, game) - #[serde(rename = "publish_locations")] - pub publish_locations: std::vec::Vec, - #[serde(rename = "translations")] - pub translations: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - } -} - -/// Data structs used by [`TftSummonerV1`](crate::endpoints::TftSummonerV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod tft_summoner_v1 { - /// `tft-summoner-v1.SummonerDTO` data object. - /// # Description - /// represents a summoner - /// - /// Note: This struct is automatically generated - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Summoner { - /// Encrypted account ID. Max length 56 characters. - #[serde(rename = "accountId")] - pub account_id: String, - /// ID of the summoner icon associated with the summoner. - #[serde(rename = "profileIconId")] - pub profile_icon_id: i32, - /// 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")] - pub revision_date: i64, - /// Encrypted summoner ID. Max length 63 characters. - #[serde(rename = "id")] - pub id: String, - /// Encrypted PUUID. Exact length of 78 characters. - #[serde(rename = "puuid")] - pub puuid: String, - /// Summoner level associated with the summoner. - #[serde(rename = "summonerLevel")] - pub summoner_level: i64, - } -} - -/// Data structs used by [`TournamentStubV5`](crate::endpoints::TournamentStubV5). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod tournament_stub_v5 { - /// `tournament-stub-v5.TournamentCodeParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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(default, skip_serializing_if = "Option::is_none")] - pub allowed_participants: Option>, - /// 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(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// The team size of the game. Valid values are 1-5. - #[serde(rename = "teamSize")] - pub team_size: i32, - /// The pick type of the game.
- /// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT) - #[serde(rename = "pickType")] - pub pick_type: String, - /// The map type of the game.
- /// (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) - #[serde(rename = "mapType")] - pub map_type: String, - /// The spectator type of the game.
- /// (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, - } - /// `tournament-stub-v5.TournamentCodeV5DTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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.
- /// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR) - #[serde(rename = "region")] - pub region: crate::consts::TournamentRegion, - /// 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, - } - /// `tournament-stub-v5.LobbyEventV5DTOWrapper` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LobbyEventV5Wrapper { - #[serde(rename = "eventList")] - pub event_list: std::vec::Vec, - } - /// `tournament-stub-v5.LobbyEventV5DTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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, - } - /// `tournament-stub-v5.ProviderRegistrationParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ProviderRegistrationParametersV5 { - /// The region in which the provider will be running tournaments.
- /// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR) - #[serde(rename = "region")] - pub region: crate::consts::TournamentRegion, - /// 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, - } - /// `tournament-stub-v5.TournamentRegistrationParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - } -} - -/// Data structs used by [`TournamentV5`](crate::endpoints::TournamentV5). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod tournament_v5 { - /// `tournament-v5.TournamentCodeParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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(default, skip_serializing_if = "Option::is_none")] - pub allowed_participants: Option>, - /// 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(default, skip_serializing_if = "Option::is_none")] - pub metadata: Option, - /// The team size of the game. Valid values are 1-5. - #[serde(rename = "teamSize")] - pub team_size: i32, - /// The pick type of the game.
- /// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT) - #[serde(rename = "pickType")] - pub pick_type: String, - /// The map type of the game.
- /// (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) - #[serde(rename = "mapType")] - pub map_type: String, - /// The spectator type of the game.
- /// (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, - } - /// `tournament-v5.TournamentCodeV5DTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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.
- /// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR, PH, SG, TH, TW, VN) - #[serde(rename = "region")] - pub region: crate::consts::TournamentRegion, - /// 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, - } - /// `tournament-v5.TournamentCodeUpdateParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct TournamentCodeUpdateParametersV5 { - /// 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(default, skip_serializing_if = "Option::is_none")] - pub allowed_participants: Option>, - /// The pick type
- /// (Legal values: BLIND_PICK, DRAFT_MODE, ALL_RANDOM, TOURNAMENT_DRAFT) - #[serde(rename = "pickType")] - pub pick_type: String, - /// The map type
- /// (Legal values: SUMMONERS_RIFT, HOWLING_ABYSS) - #[serde(rename = "mapType")] - pub map_type: String, - /// The spectator type
- /// (Legal values: NONE, LOBBYONLY, ALL) - #[serde(rename = "spectatorType")] - pub spectator_type: String, - } - /// `tournament-v5.TournamentGamesV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct TournamentGamesV5 { - #[serde(rename = "winningTeam")] - pub winning_team: std::vec::Vec, - #[serde(rename = "losingTeam")] - pub losing_team: std::vec::Vec, - /// Tournament Code - #[serde(rename = "shortCode")] - pub short_code: String, - /// Metadata for the TournamentCode - #[serde(rename = "metaData")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub meta_data: Option, - #[serde(rename = "gameId")] - pub game_id: i64, - #[serde(rename = "gameName")] - pub game_name: String, - #[serde(rename = "gameType")] - pub game_type: String, - /// Game Map ID - #[serde(rename = "gameMap")] - pub game_map: i32, - #[serde(rename = "gameMode")] - pub game_mode: String, - /// Region of the game - #[serde(rename = "region")] - pub region: crate::consts::TournamentRegion, - } - /// `tournament-v5.TournamentTeamV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct TournamentTeamV5 { - /// Player Unique UUID (Encrypted) - #[serde(rename = "puuid")] - pub puuid: String, - } - /// `tournament-v5.LobbyEventV5DTOWrapper` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LobbyEventV5Wrapper { - #[serde(rename = "eventList")] - pub event_list: std::vec::Vec, - } - /// `tournament-v5.LobbyEventV5DTO` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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, - } - /// `tournament-v5.ProviderRegistrationParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ProviderRegistrationParametersV5 { - /// The region in which the provider will be running tournaments.
- /// (Legal values: BR, EUNE, EUW, JP, LAN, LAS, NA, OCE, PBE, RU, TR, KR, PH, SG, TH, TW, VN) - #[serde(rename = "region")] - pub region: crate::consts::TournamentRegion, - /// 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, - } - /// `tournament-v5.TournamentRegistrationParametersV5` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::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(default, skip_serializing_if = "Option::is_none")] - pub name: Option, - } -} - -/// Data structs used by [`ValConsoleMatchV1`](crate::endpoints::ValConsoleMatchV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod val_console_match_v1 { - /// `val-console-match-v1.MatchDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Match { - #[serde(rename = "matchInfo")] - pub match_info: crate::models::val_console_match_v1::MatchInfo, - #[serde(rename = "players")] - pub players: std::vec::Vec, - #[serde(rename = "coaches")] - pub coaches: std::vec::Vec, - #[serde(rename = "teams")] - pub teams: std::vec::Vec, - #[serde(rename = "roundResults")] - pub round_results: std::vec::Vec, - } - /// `val-console-match-v1.MatchInfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MatchInfo { - #[serde(rename = "matchId")] - pub match_id: String, - #[serde(rename = "mapId")] - pub map_id: String, - #[serde(rename = "gameLengthMillis")] - pub game_length_millis: i32, - #[serde(rename = "gameStartMillis")] - pub game_start_millis: i64, - #[serde(rename = "provisioningFlowId")] - pub provisioning_flow_id: String, - #[serde(rename = "isCompleted")] - pub is_completed: bool, - #[serde(rename = "customGameName")] - pub custom_game_name: String, - #[serde(rename = "queueId")] - pub queue_id: String, - #[serde(rename = "gameMode")] - pub game_mode: String, - #[serde(rename = "isRanked")] - pub is_ranked: bool, - #[serde(rename = "seasonId")] - pub season_id: String, - } - /// `val-console-match-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Player { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "gameName")] - pub game_name: String, - #[serde(rename = "tagLine")] - pub tag_line: String, - #[serde(rename = "teamId")] - pub team_id: String, - #[serde(rename = "partyId")] - pub party_id: String, - #[serde(rename = "characterId")] - pub character_id: String, - #[serde(rename = "stats")] - pub stats: crate::models::val_console_match_v1::PlayerStats, - #[serde(rename = "competitiveTier")] - pub competitive_tier: i32, - #[serde(rename = "playerCard")] - pub player_card: String, - #[serde(rename = "playerTitle")] - pub player_title: String, - } - /// `val-console-match-v1.PlayerStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerStats { - #[serde(rename = "score")] - pub score: i32, - #[serde(rename = "roundsPlayed")] - pub rounds_played: i32, - #[serde(rename = "kills")] - pub kills: i32, - #[serde(rename = "deaths")] - pub deaths: i32, - #[serde(rename = "assists")] - pub assists: i32, - #[serde(rename = "playtimeMillis")] - pub playtime_millis: i32, - #[serde(rename = "abilityCasts")] - pub ability_casts: crate::models::val_console_match_v1::AbilityCasts, - } - /// `val-console-match-v1.AbilityCastsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct AbilityCasts { - #[serde(rename = "grenadeCasts")] - pub grenade_casts: i32, - #[serde(rename = "ability1Casts")] - pub ability1_casts: i32, - #[serde(rename = "ability2Casts")] - pub ability2_casts: i32, - #[serde(rename = "ultimateCasts")] - pub ultimate_casts: i32, - } - /// `val-console-match-v1.CoachDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Coach { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "teamId")] - pub team_id: String, - } - /// `val-console-match-v1.TeamDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Team { - /// This is an arbitrary string. Red and Blue in bomb modes. The puuid of the player in deathmatch. - #[serde(rename = "teamId")] - pub team_id: String, - #[serde(rename = "won")] - pub won: bool, - #[serde(rename = "roundsPlayed")] - pub rounds_played: i32, - #[serde(rename = "roundsWon")] - pub rounds_won: i32, - /// Team points scored. Number of kills in deathmatch. - #[serde(rename = "numPoints")] - pub num_points: i32, - } - /// `val-console-match-v1.RoundResultDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct RoundResult { - #[serde(rename = "roundNum")] - pub round_num: i32, - #[serde(rename = "roundResult")] - pub round_result: String, - #[serde(rename = "roundCeremony")] - pub round_ceremony: String, - #[serde(rename = "winningTeam")] - pub winning_team: String, - /// PUUID of player - #[serde(rename = "bombPlanter")] - pub bomb_planter: String, - /// PUUID of player - #[serde(rename = "bombDefuser")] - pub bomb_defuser: String, - #[serde(rename = "plantRoundTime")] - pub plant_round_time: i32, - #[serde(rename = "plantPlayerLocations")] - pub plant_player_locations: std::vec::Vec, - #[serde(rename = "plantLocation")] - pub plant_location: crate::models::val_console_match_v1::Location, - #[serde(rename = "plantSite")] - pub plant_site: String, - #[serde(rename = "defuseRoundTime")] - pub defuse_round_time: i32, - #[serde(rename = "defusePlayerLocations")] - pub defuse_player_locations: std::vec::Vec, - #[serde(rename = "defuseLocation")] - pub defuse_location: crate::models::val_console_match_v1::Location, - #[serde(rename = "playerStats")] - pub player_stats: std::vec::Vec, - #[serde(rename = "roundResultCode")] - pub round_result_code: String, - } - /// `val-console-match-v1.PlayerLocationsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerLocations { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "viewRadians")] - pub view_radians: f32, - #[serde(rename = "location")] - pub location: crate::models::val_console_match_v1::Location, - } - /// `val-console-match-v1.LocationDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Location { - #[serde(rename = "x")] - pub x: i32, - #[serde(rename = "y")] - pub y: i32, - } - /// `val-console-match-v1.PlayerRoundStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerRoundStats { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "kills")] - pub kills: std::vec::Vec, - #[serde(rename = "damage")] - pub damage: std::vec::Vec, - #[serde(rename = "score")] - pub score: i32, - #[serde(rename = "economy")] - pub economy: crate::models::val_console_match_v1::Economy, - #[serde(rename = "ability")] - pub ability: crate::models::val_console_match_v1::Ability, - } - /// `val-console-match-v1.KillDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Kill { - #[serde(rename = "timeSinceGameStartMillis")] - pub time_since_game_start_millis: i32, - #[serde(rename = "timeSinceRoundStartMillis")] - pub time_since_round_start_millis: i32, - /// PUUID - #[serde(rename = "killer")] - pub killer: String, - /// PUUID - #[serde(rename = "victim")] - pub victim: String, - #[serde(rename = "victimLocation")] - pub victim_location: crate::models::val_console_match_v1::Location, - /// List of PUUIDs - #[serde(rename = "assistants")] - pub assistants: std::vec::Vec, - #[serde(rename = "playerLocations")] - pub player_locations: std::vec::Vec, - #[serde(rename = "finishingDamage")] - pub finishing_damage: crate::models::val_console_match_v1::FinishingDamage, - } - /// `val-console-match-v1.FinishingDamageDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FinishingDamage { - #[serde(rename = "damageType")] - pub damage_type: String, - #[serde(rename = "damageItem")] - pub damage_item: String, - #[serde(rename = "isSecondaryFireMode")] - pub is_secondary_fire_mode: bool, - } - /// `val-console-match-v1.DamageDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Damage { - /// PUUID - #[serde(rename = "receiver")] - pub receiver: String, - #[serde(rename = "damage")] - pub damage: i32, - #[serde(rename = "legshots")] - pub legshots: i32, - #[serde(rename = "bodyshots")] - pub bodyshots: i32, - #[serde(rename = "headshots")] - pub headshots: i32, - } - /// `val-console-match-v1.EconomyDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Economy { - #[serde(rename = "loadoutValue")] - pub loadout_value: i32, - #[serde(rename = "weapon")] - pub weapon: String, - #[serde(rename = "armor")] - pub armor: String, - #[serde(rename = "remaining")] - pub remaining: i32, - #[serde(rename = "spent")] - pub spent: i32, - } - /// `val-console-match-v1.AbilityDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Ability { - #[serde(rename = "grenadeEffects")] - pub grenade_effects: String, - #[serde(rename = "ability1Effects")] - pub ability1_effects: String, - #[serde(rename = "ability2Effects")] - pub ability2_effects: String, - #[serde(rename = "ultimateEffects")] - pub ultimate_effects: String, - } - /// `val-console-match-v1.MatchlistDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Matchlist { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "history")] - pub history: std::vec::Vec, - } - /// `val-console-match-v1.MatchlistEntryDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MatchlistEntry { - #[serde(rename = "matchId")] - pub match_id: String, - #[serde(rename = "gameStartTimeMillis")] - pub game_start_time_millis: i64, - #[serde(rename = "queueId")] - pub queue_id: String, - } - /// `val-console-match-v1.RecentMatchesDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct RecentMatches { - #[serde(rename = "currentTime")] - pub current_time: i64, - /// A list of recent match ids. - #[serde(rename = "matchIds")] - pub match_ids: std::vec::Vec, - } -} - -/// Data structs used by [`ValConsoleRankedV1`](crate::endpoints::ValConsoleRankedV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod val_console_ranked_v1 { - /// `val-console-ranked-v1.LeaderboardDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Leaderboard { - /// The shard for the given leaderboard. - #[serde(rename = "shard")] - pub shard: String, - /// The act id for the given leaderboard. Act ids can be found using the val-content API. - #[serde(rename = "actId")] - pub act_id: String, - /// The total number of players in the leaderboard. - #[serde(rename = "totalPlayers")] - pub total_players: i64, - #[serde(rename = "players")] - pub players: std::vec::Vec, - } - /// `val-console-ranked-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Player { - /// This field may be omitted if the player has been anonymized. - #[serde(rename = "puuid")] - pub puuid: String, - /// This field may be omitted if the player has been anonymized. - #[serde(rename = "gameName")] - pub game_name: String, - /// This field may be omitted if the player has been anonymized. - #[serde(rename = "tagLine")] - pub tag_line: String, - #[serde(rename = "leaderboardRank")] - pub leaderboard_rank: i64, - #[serde(rename = "rankedRating")] - pub ranked_rating: i64, - #[serde(rename = "numberOfWins")] - pub number_of_wins: i64, - } -} - -/// Data structs used by [`ValContentV1`](crate::endpoints::ValContentV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod val_content_v1 { - /// `val-content-v1.ContentDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Content { - #[serde(rename = "version")] - pub version: String, - #[serde(rename = "characters")] - pub characters: std::vec::Vec, - #[serde(rename = "maps")] - pub maps: std::vec::Vec, - #[serde(rename = "chromas")] - pub chromas: std::vec::Vec, - #[serde(rename = "skins")] - pub skins: std::vec::Vec, - #[serde(rename = "skinLevels")] - pub skin_levels: std::vec::Vec, - #[serde(rename = "equips")] - pub equips: std::vec::Vec, - #[serde(rename = "gameModes")] - pub game_modes: std::vec::Vec, - #[serde(rename = "sprays")] - pub sprays: std::vec::Vec, - #[serde(rename = "sprayLevels")] - pub spray_levels: std::vec::Vec, - #[serde(rename = "charms")] - pub charms: std::vec::Vec, - #[serde(rename = "charmLevels")] - pub charm_levels: std::vec::Vec, - #[serde(rename = "playerCards")] - pub player_cards: std::vec::Vec, - #[serde(rename = "playerTitles")] - pub player_titles: std::vec::Vec, - #[serde(rename = "acts")] - pub acts: std::vec::Vec, - #[serde(rename = "ceremonies")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ceremonies: Option>, - #[serde(rename = "totems")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub totems: Option>, - } - /// `val-content-v1.ContentItemDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct ContentItem { - #[serde(rename = "name")] - pub name: String, - /// This field is excluded from the response when a locale is set - #[serde(rename = "localizedNames")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub localized_names: Option, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "assetName")] - pub asset_name: String, - /// This field is only included for maps and game modes. These values are used in the match response. - #[serde(rename = "assetPath")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub asset_path: Option, - } - /// `val-content-v1.LocalizedNamesDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct LocalizedNames { - #[serde(rename = "ar-AE")] - pub ar_ae: String, - #[serde(rename = "de-DE")] - pub de_de: String, - #[serde(rename = "en-GB")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub en_gb: Option, - #[serde(rename = "en-US")] - pub en_us: String, - #[serde(rename = "es-ES")] - pub es_es: String, - #[serde(rename = "es-MX")] - pub es_mx: String, - #[serde(rename = "fr-FR")] - pub fr_fr: String, - #[serde(rename = "id-ID")] - pub id_id: String, - #[serde(rename = "it-IT")] - pub it_it: String, - #[serde(rename = "ja-JP")] - pub ja_jp: String, - #[serde(rename = "ko-KR")] - pub ko_kr: String, - #[serde(rename = "pl-PL")] - pub pl_pl: String, - #[serde(rename = "pt-BR")] - pub pt_br: String, - #[serde(rename = "ru-RU")] - pub ru_ru: String, - #[serde(rename = "th-TH")] - pub th_th: String, - #[serde(rename = "tr-TR")] - pub tr_tr: String, - #[serde(rename = "vi-VN")] - pub vi_vn: String, - #[serde(rename = "zh-CN")] - pub zh_cn: String, - #[serde(rename = "zh-TW")] - pub zh_tw: String, - } - /// `val-content-v1.ActDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Act { - #[serde(rename = "name")] - pub name: String, - /// This field is excluded from the response when a locale is set - #[serde(rename = "localizedNames")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub localized_names: Option, - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "isActive")] - pub is_active: bool, - #[serde(rename = "parentId")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub parent_id: Option, - #[serde(rename = "type")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub r#type: Option, - } -} - -/// Data structs used by [`ValMatchV1`](crate::endpoints::ValMatchV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod val_match_v1 { - /// `val-match-v1.MatchDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Match { - #[serde(rename = "matchInfo")] - pub match_info: crate::models::val_match_v1::MatchInfo, - #[serde(rename = "players")] - pub players: std::vec::Vec, - #[serde(rename = "coaches")] - pub coaches: std::vec::Vec, - #[serde(rename = "teams")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub teams: Option>, - #[serde(rename = "roundResults")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub round_results: Option>, - } - /// `val-match-v1.MatchInfoDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MatchInfo { - #[serde(rename = "matchId")] - pub match_id: String, - #[serde(rename = "mapId")] - pub map_id: String, - #[serde(rename = "gameLengthMillis")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_length_millis: Option, - #[serde(rename = "gameStartMillis")] - pub game_start_millis: i64, - #[serde(rename = "provisioningFlowId")] - pub provisioning_flow_id: String, - #[serde(rename = "isCompleted")] - pub is_completed: bool, - #[serde(rename = "customGameName")] - pub custom_game_name: String, - #[serde(rename = "queueId")] - pub queue_id: String, - #[serde(rename = "gameMode")] - pub game_mode: String, - #[serde(rename = "isRanked")] - pub is_ranked: bool, - #[serde(rename = "seasonId")] - pub season_id: String, - #[serde(rename = "gameVersion")] - pub game_version: String, - #[serde(rename = "region")] - pub region: String, - #[serde(rename = "premierMatchInfo")] - pub premier_match_info: serde_json::Map, - } - /// `val-match-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Player { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "gameName")] - pub game_name: String, - #[serde(rename = "tagLine")] - pub tag_line: String, - #[serde(rename = "teamId")] - pub team_id: String, - #[serde(rename = "partyId")] - pub party_id: String, - #[serde(rename = "characterId")] - pub character_id: String, - #[serde(rename = "stats")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub stats: Option, - #[serde(rename = "competitiveTier")] - pub competitive_tier: i32, - #[serde(rename = "playerCard")] - pub player_card: String, - #[serde(rename = "playerTitle")] - pub player_title: String, - #[serde(rename = "isObserver")] - pub is_observer: bool, - #[serde(rename = "accountLevel")] - pub account_level: i32, - } - /// `val-match-v1.PlayerStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerStats { - #[serde(rename = "score")] - pub score: i32, - #[serde(rename = "roundsPlayed")] - pub rounds_played: i32, - #[serde(rename = "kills")] - pub kills: i32, - #[serde(rename = "deaths")] - pub deaths: i32, - #[serde(rename = "assists")] - pub assists: i32, - #[serde(rename = "playtimeMillis")] - pub playtime_millis: i32, - #[serde(rename = "abilityCasts")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ability_casts: Option, - } - /// `val-match-v1.AbilityCastsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct AbilityCasts { - #[serde(rename = "grenadeCasts")] - pub grenade_casts: i32, - #[serde(rename = "ability1Casts")] - pub ability1_casts: i32, - #[serde(rename = "ability2Casts")] - pub ability2_casts: i32, - #[serde(rename = "ultimateCasts")] - pub ultimate_casts: i32, - } - /// `val-match-v1.CoachDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Coach { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "teamId")] - pub team_id: String, - } - /// `val-match-v1.TeamDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Team { - /// This is an arbitrary string. Red and Blue in bomb modes. The puuid of the player in deathmatch. - #[serde(rename = "teamId")] - pub team_id: String, - #[serde(rename = "won")] - pub won: bool, - #[serde(rename = "roundsPlayed")] - pub rounds_played: i32, - #[serde(rename = "roundsWon")] - pub rounds_won: i32, - /// Team points scored. Number of kills in deathmatch. - #[serde(rename = "numPoints")] - pub num_points: i32, - } - /// `val-match-v1.RoundResultDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct RoundResult { - #[serde(rename = "roundNum")] - pub round_num: i32, - #[serde(rename = "roundResult")] - pub round_result: String, - #[serde(rename = "roundCeremony")] - pub round_ceremony: String, - #[serde(rename = "winningTeam")] - pub winning_team: String, - /// PUUID of player - #[serde(rename = "bombPlanter")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bomb_planter: Option, - /// PUUID of player - #[serde(rename = "bombDefuser")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub bomb_defuser: Option, - #[serde(rename = "plantRoundTime")] - pub plant_round_time: i32, - #[serde(rename = "plantPlayerLocations")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub plant_player_locations: Option>, - #[serde(rename = "plantLocation")] - pub plant_location: crate::models::val_match_v1::Location, - #[serde(rename = "plantSite")] - pub plant_site: String, - #[serde(rename = "defuseRoundTime")] - pub defuse_round_time: i32, - #[serde(rename = "defusePlayerLocations")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub defuse_player_locations: Option>, - #[serde(rename = "defuseLocation")] - pub defuse_location: crate::models::val_match_v1::Location, - #[serde(rename = "playerStats")] - pub player_stats: std::vec::Vec, - #[serde(rename = "roundResultCode")] - pub round_result_code: String, - #[serde(rename = "winningTeamRole")] - pub winning_team_role: String, - } - /// `val-match-v1.PlayerLocationsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerLocations { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "viewRadians")] - pub view_radians: f32, - #[serde(rename = "location")] - pub location: crate::models::val_match_v1::Location, - } - /// `val-match-v1.LocationDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Location { - #[serde(rename = "x")] - pub x: i32, - #[serde(rename = "y")] - pub y: i32, - } - /// `val-match-v1.PlayerRoundStatsDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlayerRoundStats { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "kills")] - pub kills: std::vec::Vec, - #[serde(rename = "damage")] - pub damage: std::vec::Vec, - #[serde(rename = "score")] - pub score: i32, - #[serde(rename = "economy")] - pub economy: crate::models::val_match_v1::Economy, - #[serde(rename = "ability")] - pub ability: crate::models::val_match_v1::Ability, - } - /// `val-match-v1.KillDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Kill { - #[serde(rename = "timeSinceGameStartMillis")] - pub time_since_game_start_millis: i32, - #[serde(rename = "timeSinceRoundStartMillis")] - pub time_since_round_start_millis: i32, - /// PUUID - #[serde(rename = "killer")] - pub killer: String, - /// PUUID - #[serde(rename = "victim")] - pub victim: String, - #[serde(rename = "victimLocation")] - pub victim_location: crate::models::val_match_v1::Location, - /// List of PUUIDs - #[serde(rename = "assistants")] - pub assistants: std::vec::Vec, - #[serde(rename = "playerLocations")] - pub player_locations: std::vec::Vec, - #[serde(rename = "finishingDamage")] - pub finishing_damage: crate::models::val_match_v1::FinishingDamage, - } - /// `val-match-v1.FinishingDamageDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct FinishingDamage { - #[serde(rename = "damageType")] - pub damage_type: String, - #[serde(rename = "damageItem")] - pub damage_item: String, - #[serde(rename = "isSecondaryFireMode")] - pub is_secondary_fire_mode: bool, - } - /// `val-match-v1.DamageDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Damage { - /// PUUID - #[serde(rename = "receiver")] - pub receiver: String, - #[serde(rename = "damage")] - pub damage: i32, - #[serde(rename = "legshots")] - pub legshots: i32, - #[serde(rename = "bodyshots")] - pub bodyshots: i32, - #[serde(rename = "headshots")] - pub headshots: i32, - } - /// `val-match-v1.EconomyDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Economy { - #[serde(rename = "loadoutValue")] - pub loadout_value: i32, - #[serde(rename = "weapon")] - pub weapon: String, - #[serde(rename = "armor")] - pub armor: String, - #[serde(rename = "remaining")] - pub remaining: i32, - #[serde(rename = "spent")] - pub spent: i32, - } - /// `val-match-v1.AbilityDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Ability { - #[serde(rename = "grenadeEffects")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub grenade_effects: Option, - #[serde(rename = "ability1Effects")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ability1_effects: Option, - #[serde(rename = "ability2Effects")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ability2_effects: Option, - #[serde(rename = "ultimateEffects")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub ultimate_effects: Option, - } - /// `val-match-v1.MatchlistDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Matchlist { - #[serde(rename = "puuid")] - pub puuid: String, - #[serde(rename = "history")] - pub history: std::vec::Vec, - } - /// `val-match-v1.MatchlistEntryDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct MatchlistEntry { - #[serde(rename = "matchId")] - pub match_id: String, - #[serde(rename = "gameStartTimeMillis")] - pub game_start_time_millis: i64, - #[serde(rename = "queueId")] - pub queue_id: String, - } - /// `val-match-v1.RecentMatchesDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct RecentMatches { - #[serde(rename = "currentTime")] - pub current_time: i64, - /// A list of recent match ids. - #[serde(rename = "matchIds")] - pub match_ids: std::vec::Vec, - } -} - -/// Data structs used by [`ValRankedV1`](crate::endpoints::ValRankedV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod val_ranked_v1 { - /// `val-ranked-v1.LeaderboardDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Leaderboard { - /// The shard for the given leaderboard. - #[serde(rename = "shard")] - pub shard: String, - /// The act id for the given leaderboard. Act ids can be found using the val-content API. - #[serde(rename = "actId")] - pub act_id: String, - /// The total number of players in the leaderboard. - #[serde(rename = "totalPlayers")] - pub total_players: i64, - #[serde(rename = "players")] - pub players: std::vec::Vec, - #[serde(rename = "immortalStartingPage")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub immortal_starting_page: Option, - #[serde(rename = "immortalStartingIndex")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub immortal_starting_index: Option, - #[serde(rename = "topTierRRThreshold")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub top_tier_rr_threshold: Option, - #[serde(rename = "tierDetails")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tier_details: Option>, - #[serde(rename = "startIndex")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub start_index: Option, - #[serde(rename = "query")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub query: Option, - } - /// `val-ranked-v1.PlayerDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Player { - /// This field may be omitted if the player has been anonymized. - #[serde(rename = "puuid")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub puuid: Option, - /// This field may be omitted if the player has been anonymized. - #[serde(rename = "gameName")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub game_name: Option, - /// This field may be omitted if the player has been anonymized. - #[serde(rename = "tagLine")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub tag_line: Option, - #[serde(rename = "leaderboardRank")] - pub leaderboard_rank: i64, - #[serde(rename = "rankedRating")] - pub ranked_rating: i64, - #[serde(rename = "numberOfWins")] - pub number_of_wins: i64, - #[serde(rename = "competitiveTier")] - #[serde(default, skip_serializing_if = "Option::is_none")] - pub competitive_tier: Option, - } - /// `val-ranked-v1.TierDetailDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct TierDetail { - #[serde(rename = "rankedRatingThreshold")] - pub ranked_rating_threshold: i64, - #[serde(rename = "startingPage")] - pub starting_page: i64, - #[serde(rename = "startingIndex")] - pub starting_index: i64, - } -} - -/// Data structs used by [`ValStatusV1`](crate::endpoints::ValStatusV1). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod val_status_v1 { - /// `val-status-v1.PlatformDataDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct PlatformData { - #[serde(rename = "id")] - pub id: String, - #[serde(rename = "name")] - pub name: String, - #[serde(rename = "locales")] - pub locales: std::vec::Vec, - #[serde(rename = "maintenances")] - pub maintenances: std::vec::Vec, - #[serde(rename = "incidents")] - pub incidents: std::vec::Vec, - } - /// `val-status-v1.StatusDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Status { - #[serde(rename = "id")] - pub id: i32, - /// (Legal values: scheduled, in_progress, complete) - #[serde(rename = "maintenance_status")] - pub maintenance_status: String, - /// (Legal values: info, warning, critical) - #[serde(rename = "incident_severity")] - pub incident_severity: String, - #[serde(rename = "titles")] - pub titles: std::vec::Vec, - #[serde(rename = "updates")] - pub updates: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "archive_at")] - pub archive_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - /// (Legal values: windows, macos, android, ios, ps4, xbone, switch) - #[serde(rename = "platforms")] - pub platforms: std::vec::Vec, - } - /// `val-status-v1.ContentDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Content { - #[serde(rename = "locale")] - pub locale: String, - #[serde(rename = "content")] - pub content: String, - } - /// `val-status-v1.UpdateDto` data object. - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct Update { - #[serde(rename = "id")] - pub id: i32, - #[serde(rename = "author")] - pub author: String, - #[serde(rename = "publish")] - pub publish: bool, - /// (Legal values: riotclient, riotstatus, game) - #[serde(rename = "publish_locations")] - pub publish_locations: std::vec::Vec, - #[serde(rename = "translations")] - pub translations: std::vec::Vec, - #[serde(rename = "created_at")] - pub created_at: String, - #[serde(rename = "updated_at")] - pub updated_at: String, - } -} +include_autogen!("models.gen.rs"); diff --git a/riven/srcgen/.gitignore b/riven/srcgen/.gitignore deleted file mode 100644 index 3f7b14b2..00000000 --- a/riven/srcgen/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -.*.json diff --git a/riven/srcgen/consts/champion.rs.dt b/riven/srcgen/consts/champion.rs.dt deleted file mode 100644 index b22ab462..00000000 --- a/riven/srcgen/consts/champion.rs.dt +++ /dev/null @@ -1,168 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const champions = require('./.champion.json') - .filter(({ id }) => id > 0) - /* Ignore strawberry champions for now */ - .filter(({ alias }) => !alias.startsWith('Strawberry_')) - .sortBy(({ name }) => name); - - const constName = name => dotUtils.changeCase.constantCase(name).replace(/[^_A-Z0-9]+/g, ''); - const constNamePad = 12; -}}{{= dotUtils.preamble() }} - -newtype_enum! { - /// A League of Legends champion. - /// - /// This newtype acts as a C-like enum; each variant corresponds to an - /// integer value. Using a newtype allows _unknown_ variants to be - /// represented. This is important when Riot adds new champions. - /// - /// Field | Name | Identifier | Id - /// ---|---|---|--- - /// `NONE` | None (no ban) | | -1 -{{ - for (const { id, alias, name } of champions) { -}} - /// `{{= constName(name) }}` | "{{= name }}" | "{{= alias }}" | {{= id }} -{{ - } -}} - pub newtype_enum Champion(i16) { - /// `-1`, none. Appears when a champion ban is not used in champ select. - NONE = -1, - -{{ - for (const { id, alias, name } of champions) { -}} - /// `{{= id }}`. - {{= constName(name) }} = {{= id }}, -{{ - } -}} - } -} - -impl Champion { - /// The champion's name (`en_US` localization). - pub const fn name(self) -> Option<&'static str> { - match self { -{{ - for (const { name } of champions) { -}} - Self::{{= constName(name).padEnd(constNamePad) }} => Some("{{= name }}"), -{{ - } -}} - _ => None, - } - } - - /// The champion's identifier key. Somtimes called "key", "identifier", or "alias". - /// This is mainly used in DDragon paths. - /// - /// This is generally the `en_US` name with spaces and punctuation removed, - /// capitalization preserved, however the follow are exceptions: - /// - /// Field | Name | Identifier | Id - /// ---|---|---|--- -{{ - for (const { id, alias, name } of champions) { - if (name.replace(/[^a-zA-Z0-9]+/, '') !== alias) { -}} - /// `{{= constName(name) }}` | "{{= name }}" | "{{= alias }}" | {{= id }} -{{ - } - } -}} - pub const fn identifier(self) -> Option<&'static str> { - match self { -{{ - for (const { name, alias } of champions) { -}} - Self::{{= constName(name).padEnd(constNamePad) }} => Some("{{= alias }}"), -{{ - } -}} - _ => None, - } - } - - /// https://github.com/MingweiSamuel/Riven/issues/36 - pub(crate) fn serialize_result( - val: &Result, - serializer: S, - ) -> Result - where - S: serde::ser::Serializer, - { - use serde::ser::Serialize; - val.unwrap_or(Champion(-1)).serialize(serializer) - } - - /// https://github.com/MingweiSamuel/Riven/issues/36 - pub(crate) fn deserialize_result<'de, D>( - deserializer: D, - ) -> Result, D::Error> - where - D: serde::de::Deserializer<'de>, - { - use std::convert::TryInto; - ::deserialize(deserializer).map(|id| id.try_into().map(Self)) - } -} - -/// The error used for failures in [`Champion`]'s -/// [`FromStr`](std::str::FromStr) implementation. -/// -/// Currently only internally stores the four characters used to parse the -/// champion, but may change in the future. -#[derive(Debug)] -pub struct ParseChampionError([char; 4]); -impl std::fmt::Display for ParseChampionError { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - let s: String = self.0.iter().copied().take_while(|&c| '\0' != c).collect(); - write!(f, "Failed to parse unknown champion prefix: {:?}", s) - } -} -impl std::error::Error for ParseChampionError {} - -impl std::str::FromStr for Champion { - type Err = ParseChampionError; - fn from_str(s: &str) -> Result { - let mut chars = ['\0'; 4]; - s.chars() - .take(4) - .filter(|c| c.is_ascii_alphanumeric()) - .map(|c| c.to_ascii_uppercase()) - .enumerate() - .for_each(|(i, c)| chars[i] = c); - match chars { -{{ - const keyStrings = (name, alias) => new Set([].concat(...[ name, alias ].map(s => s.toUpperCase()) - .map(s => [ - s.replace(/[^A-Z0-9]+/, '').substring(0, 4), - s.split(/[^A-Z0-9]/, 1)[0].substring(0, 4), - s.split(/[^A-Z]/, 1)[0].substring(0, 4), - ]))); - for (const { id, alias, name } of champions) { - for (const prefix of keyStrings(name, alias)) { - const chars = Object.assign(Array(4).fill('\\0'), Array.from(prefix)) - .map(c => `'${c}'`) - .map(c => c.padStart(4)); -}} - /* {{= prefix.padEnd(4) }} */ [{{= chars.join(', ') }}] => Ok(Champion::{{= constName(name) }}), -{{ - } - } -}} - unknown => Err(ParseChampionError(unknown)), - } - } -} - -impl std::convert::TryFrom<&str> for Champion { - type Error = ::Err; - fn try_from(value: &str) -> Result { - ::from_str(value) - } -} diff --git a/riven/srcgen/consts/game_mode.rs.dt b/riven/srcgen/consts/game_mode.rs.dt deleted file mode 100644 index abba75bf..00000000 --- a/riven/srcgen/consts/game_mode.rs.dt +++ /dev/null @@ -1,33 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const gameModes = require('./.gameModes.json'); -}}{{= dotUtils.preamble() }} - -use strum_macros::{ EnumString, EnumVariantNames, IntoStaticStr }; - -/// League of Legends game mode, such as Classic, -/// ARAM, URF, One For All, Ascension, etc. -#[non_exhaustive] -#[derive(Debug, Clone)] -#[derive(Eq, PartialEq, Hash)] -#[derive(EnumString, EnumVariantNames, IntoStaticStr)] -#[repr(u8)] -pub enum GameMode { - /// Catch-all variant for new, unknown game modes. - #[strum(default)] - UNKNOWN(String), - -{{ - for (const e of gameModes) { - const desc = e['x-desc'] ? e['x-desc'].split('\n') : []; -}} -{{~ desc :line }} - /// {{= line }} -{{~}} - {{= e['x-name'] }}, -{{ - } -}} -} - -serde_strum_unknown!(GameMode); diff --git a/riven/srcgen/consts/game_type.rs.dt b/riven/srcgen/consts/game_type.rs.dt deleted file mode 100644 index 663d2258..00000000 --- a/riven/srcgen/consts/game_type.rs.dt +++ /dev/null @@ -1,32 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const gameTypes = require('./.gameTypes.json'); -}}{{= dotUtils.preamble() }} - -use strum_macros::{ EnumString, Display, AsRefStr, IntoStaticStr }; - -/// League of Legends game type: matched game, custom game, or tutorial game. -#[derive(Debug, Copy, Clone)] -#[derive(Eq, PartialEq, Hash)] -#[derive(EnumString, Display, AsRefStr, IntoStaticStr)] -#[derive(serde::Serialize, crate::de::Deserialize)] -#[repr(u8)] -pub enum GameType { -{{ - for (const e of gameTypes) { - const desc = e['x-desc'] ? e['x-desc'].split('\n') : []; - const nameNoGame = e['x-name'].replace(/_GAME$/, ""); -}} -{{~ desc :line }} - /// {{= line }} -{{~}} - #[strum(to_string = "{{= e['x-name'] }}", serialize = "{{= nameNoGame }}")] - #[serde(alias = "{{= nameNoGame }}")] - {{= e['x-name'] }}, -{{ - } -}} -} - -#[cfg(test)] -mod test; diff --git a/riven/srcgen/consts/map.rs.dt b/riven/srcgen/consts/map.rs.dt deleted file mode 100644 index d97f6476..00000000 --- a/riven/srcgen/consts/map.rs.dt +++ /dev/null @@ -1,22 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const maps = require('./.maps.json'); -}}{{= dotUtils.preamble() }} - -newtype_enum! { - /// A League of Legends map. - pub newtype_enum Map(u8) { -{{ - for (const e of maps) { - const desc = e['x-desc'] ? e['x-desc'].split('\n') : []; -}} - /// `{{= e['x-value'] }}`. -{{~ desc :line }} - /// {{= line }} -{{~}} - {{= e['x-name'] }} = {{= e['x-value'] }}, -{{ - } -}} - } -} diff --git a/riven/srcgen/consts/queue.rs.dt b/riven/srcgen/consts/queue.rs.dt deleted file mode 100644 index 585111d3..00000000 --- a/riven/srcgen/consts/queue.rs.dt +++ /dev/null @@ -1,29 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const queues = require('./.queues.json'); -}}{{= dotUtils.preamble() }} - -newtype_enum! { - /// A League of Legends matchmaking queue. - pub newtype_enum Queue(u16) { -{{ - for (const e of queues) { - const desc = e['x-desc'] ? e['x-desc'].split('\n') : []; -}} - /// `{{= e['x-value'] }}`. -{{~ desc :line }} - /// {{= line }} -{{~}} -{{? e.notes }} - /// - /// {{= e.notes }} -{{?}} -{{? e['x-deprecated'] }} - #[deprecated(note="{{= e.notes }}")] -{{?}} - {{= e['x-name'] }} = {{= e['x-value'] }}, -{{ - } -}} - } -} diff --git a/riven/srcgen/consts/queue_type.rs.dt b/riven/srcgen/consts/queue_type.rs.dt deleted file mode 100644 index 1d13cefa..00000000 --- a/riven/srcgen/consts/queue_type.rs.dt +++ /dev/null @@ -1,39 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const queueTypes = require('./.queueTypes.json'); -}}{{= dotUtils.preamble() }} - -use strum_macros::{ EnumString, EnumVariantNames, IntoStaticStr }; - -/// LoL or TFT ranked queue types. -#[non_exhaustive] -#[derive(Debug, Clone)] -#[derive(Eq, PartialEq, Hash)] -#[derive(EnumString, EnumVariantNames, IntoStaticStr)] -#[repr(u8)] -pub enum QueueType { - /// Catch-all variant for new, unknown queue types. - #[strum(default)] - UNKNOWN(String), - -{{ - for (const e of queueTypes) { - const desc = e['x-desc'] ? e['x-desc'].split('\n') : []; -}} -{{~ desc :line }} - /// {{= line }} -{{~}} -{{? e['x-deprecated'] }} - /// {{= e.notes }} - #[deprecated(note="{{= e.notes }}")] -{{?}} - {{= e['x-name'] }}, -{{ - } -}} -} - -serde_strum_unknown!(QueueType); - -#[cfg(test)] -mod test; diff --git a/riven/srcgen/consts/route.rs.dt b/riven/srcgen/consts/route.rs.dt deleted file mode 100644 index cba3aef0..00000000 --- a/riven/srcgen/consts/route.rs.dt +++ /dev/null @@ -1,195 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const routesTable = require('./.routesTable.json'); -}}{{= dotUtils.preamble() }} -#![allow(clippy::upper_case_acronyms)] - -use num_enum::{ IntoPrimitive, TryFromPrimitive }; -use strum_macros::{ EnumString, EnumIter, Display, IntoStaticStr }; - -/// Regional routes, used in tournament services, Legends of Runeterra (LoR), and other some endpoints. -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -pub enum RegionalRoute { -{{ - for (const [ name, { id, description, deprecated } ] of Object.entries(routesTable['regional'])) { - const desc = description.split('\n'); -}} -{{~ desc :line }} - /// {{= line }} -{{~}} - /// - /// `{{= id }}` (riotapi-schema ID/repr) -{{? deprecated }} - #[deprecated] -{{?}} - {{= name.toUpperCase() }} = {{= id }}, - -{{ - } -}} -} - -/// Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR). -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -// Note: strum(serialize = ...) actually specifies extra DEserialization values. -pub enum PlatformRoute { -{{ - for (const [ name, { id, description, altName, deprecated } ] of Object.entries(routesTable['platform'])) { - const desc = description.split('\n'); -}} -{{~ desc :line }} - /// {{= line }} -{{~}} - /// - /// `{{= id }}` (riotapi-schema ID/repr) -{{? deprecated }} - #[deprecated] -{{?}} -{{? altName }} - #[strum(to_string="{{= name.toUpperCase() }}", serialize="{{= altName }}")] -{{?}} - {{= name.toUpperCase() }} = {{= id }}, - -{{ - } -}} -} - -impl PlatformRoute { - /// Converts this [`PlatformRoute`] into its corresponding - /// [`RegionalRoute`] for LoL and TFT match endpoints. - /// For example, [`match-v5`](crate::endpoints::MatchV5). - pub fn to_regional(self) -> RegionalRoute { - match self { -{{ - for (const [ name, { regionalRoute } ] of Object.entries(routesTable['platform'])) { -}} - Self::{{= name.toUpperCase() }} => RegionalRoute::{{= regionalRoute.toUpperCase() }}, -{{ - } -}} - } - } - - /// Converts this [`PlatformRoute`] into its corresponding - /// [`RegionalRoute`] for LoR endpoints. - /// For example, [`lor-match-v1`](crate::endpoints::LorMatchV1). - pub fn to_regional_lor(self) -> RegionalRoute { - match self { -{{ - for (const [ name, { regionalRouteLor } ] of Object.entries(routesTable['platform'])) { -}} - Self::{{= name.toUpperCase() }} => RegionalRoute::{{= regionalRouteLor.toUpperCase() }}, -{{ - } -}} - } - } - - /// Used in the LoL Tournament API. Specifically - /// [`TournamentStubV5`](crate::endpoints::TournamentStubV5)/[`TournamentV5`](crate::endpoints::TournamentV5). - pub fn to_tournament_region(self) -> Option { - match self { -{{ - for (const [ name, { tournamentRegion } ] of Object.entries(routesTable['platform'])) { - if (!tournamentRegion) continue; -}} - Self::{{= name.toUpperCase() }} => Some(TournamentRegion::{{= tournamentRegion }}), -{{ - } -}} - _other => None, - } - } - - /// Get the slightly more human-friendly alternate name for this `PlatformRoute`. Specifically - /// excludes any trailing numbers and appends extra N(orth), S(outh), E(ast), and/or W(est) - /// suffixes to some names. Some of these are old region names which are often still used as - /// user-facing names, e.g. on op.gg. - /// - /// Note these strings *are* handled by the `FromStr` implementation, if you wish to parse them - /// back into `PlatformRoute`s. - pub fn as_region_str(self) -> &'static str { - match self { -{{ - for (const [ name, { altName } ] of Object.entries(routesTable['platform'])) { - if (!altName) continue; -}} - Self::{{= name.toUpperCase() }} => "{{= altName }}", -{{ - } -}} - other => other.into(), - } - } -} - -/// Platform routes for Valorant. -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -pub enum ValPlatformRoute { -{{ - for (const [ name, { id, description, deprecated } ] of Object.entries(routesTable['val-platform'])) { - const desc = description.split('\n'); -}} -{{~ desc :line }} - /// {{= line }} -{{~}} - /// - /// `{{= id }}` (riotapi-schema ID/repr) -{{? deprecated }} - #[deprecated] -{{?}} - {{= name.toUpperCase() }} = {{= id }}, - -{{ - } -}} -} - -/// Tournament regions for League of Legends (LoL) used in -/// [`TournamentStubV5`](crate::endpoints::TournamentStubV5)/[`TournamentV5`](crate::endpoints::TournamentV5). -#[derive(Debug)] -#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)] -#[derive(IntoPrimitive, TryFromPrimitive)] -#[derive(EnumString, EnumIter, Display, IntoStaticStr)] -#[derive(serde::Serialize, crate::de::Deserialize)] -#[derive(Clone, Copy)] -#[repr(u8)] -#[non_exhaustive] -// Note: strum(serialize = ...) actually specifies extra DEserialization values. -pub enum TournamentRegion { -{{ - for (const [ name, { id, description, tournamentRegion, deprecated } ] of Object.entries(routesTable['platform'])) { - if (tournamentRegion) { - const desc = description.split('\n'); -}} -{{~ desc :line }} - /// {{= line }} -{{~}} -{{? deprecated }} - #[deprecated] -{{?}} - {{= tournamentRegion }} = {{= id }}, -{{ - } - } -}} -} diff --git a/riven/srcgen/consts/season.rs.dt b/riven/srcgen/consts/season.rs.dt deleted file mode 100644 index 0eb5f31d..00000000 --- a/riven/srcgen/consts/season.rs.dt +++ /dev/null @@ -1,22 +0,0 @@ -{{ - const dotUtils = require('./dotUtils.js'); - const seasons = require('./.seasons.json'); -}}{{= dotUtils.preamble() }} - -newtype_enum! { - /// A League of Legends season for competitive matchmaking. - pub newtype_enum Season(u8) { -{{ - for (const e of seasons) { - const desc = e['x-desc'] ? e['x-desc'].split('\n') : []; -}} - /// `{{= e['x-value'] }}`. -{{~ desc :line }} - /// {{= line }} -{{~}} - {{= e['x-name'] }} = {{= e['x-value'] }}, -{{ - } -}} - } -} diff --git a/riven/srcgen/dotUtils.js b/riven/srcgen/dotUtils.js deleted file mode 100644 index 19b28300..00000000 --- a/riven/srcgen/dotUtils.js +++ /dev/null @@ -1,168 +0,0 @@ -const changeCase = require('change-case'); - -// flatMap: https://gist.github.com/samgiles/762ee337dff48623e729 -// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: -Array.prototype.flatMap = function(lambda) { - return Array.prototype.concat.apply([], this.map(lambda)); -}; -Array.prototype.groupBy = function(lambda) { - return Object.entries(this.reduce((agg, x) => { - const k = lambda(x); - (agg[k] = agg[k] || []).push(x); - return agg; - }, {})); -}; -Array.prototype.sortBy = function(lambda) { - return this.sort((a, b) => { - const va = lambda(a); - const vb = lambda(b); - if ((typeof va) !== (typeof vb)) - throw Error(`Mismatched sort types: ${typeof va}, ${typeof vb}.`); - if (typeof va === 'number') - return va - vb; - if (typeof va === 'string') - return va.localeCompare(vb); - throw Error(`Unknown sort type: ${typeof va}.`); - }); -}; - -function preamble() { - return `\ -#![cfg_attr(any(), rustfmt::skip)] -/////////////////////////////////////////////// -// // -// ! // -// This file is automatically generated! // -// Do not directly edit! // -// // -///////////////////////////////////////////////`; -} - -function capitalize(input) { - return input[0].toUpperCase() + input.slice(1); -} - -function decapitalize(input) { - return input[0].toLowerCase() + input.slice(1); -} - -function normalizeSchemaName(name) { - return name.replace(/DTO/ig, ''); -} - -function normalizeArgName(name) { - const tokens = name.split('_'); - const argName = decapitalize(tokens.map(capitalize).join('')); - return 'base' === argName ? 'Base' : argName; -} - -function normalizePropName(propName) { - let out = changeCase.snakeCase(propName); - if (/^\d/.test(out)) // No leading digits. - out = 'x' + out; - if ('type' === out) - return 'r#' + out; - return out; -} - -function stringifyType(prop, { optional = false, fullpath = true, owned = true }) { - if (prop.anyOf) { - prop = prop.anyOf[0]; - } - if (optional) { - return `Option<${stringifyType(prop, { fullpath, owned })}>`; - } - - let enumType = prop['x-enum']; - if (enumType && 'locale' !== enumType) - return 'crate::consts::' + changeCase.pascalCase(enumType); - - let refType = prop['$ref']; - if (refType) { - let [endpoint, schema] = refType.slice(refType.lastIndexOf('/') + 1).split('.'); - return 'crate::models::' + changeCase.snakeCase(endpoint) + '::' + normalizeSchemaName(schema); - } - switch (prop.type) { - case 'boolean': return 'bool'; - case 'integer': return ('int32' === prop.format ? 'i32' : 'i64'); - case 'number': return ('float' === prop.format ? 'f32' : 'f64'); - case 'array': - const subprop = stringifyType(prop.items, { optional, fullpath, owned }); - return (owned ? (fullpath ? 'std::vec::' : '') + `Vec<${subprop}>` : `&[${subprop}]`); - case 'string': return (owned ? 'String' : '&str'); - case 'object': - if (1 === Object.keys(prop).length) { // Only `{ "type": "object" }`. - return 'serde_json::Map' - } - return 'std::collections::HashMap<' + stringifyType(prop['x-key'], { optional, fullpath, owned }) + ', ' + - stringifyType(prop.additionalProperties, { optional, fullpath, owned }) + '>'; - default: return prop.type; - } -} - -function formatJsonProperty(name, prop) { - const alias = prop['x-alias']; - if (alias) - return `#[serde(rename = ${JSON.stringify(name)}, alias = ${JSON.stringify(alias)})]`; - else - return `#[serde(rename = ${JSON.stringify(name)})]`; -} - -function formatAddQueryParam(param) { - const k = `"${param.name}"`; - const name = normalizePropName(param.name); - const condStart = param.required ? '' : `if let Some(${name}) = ${name} { `; - const condEnd = param.required ? '' : ' } else { request }' - const prop = param.schema; - switch (prop.type) { - case 'array': return `let request = ${condStart}request.query(&*${name}.iter()` - + `.map(|w| ( ${k}, w )).collect::>())${condEnd};`; - case 'object': - throw 'unsupported'; - default: - return `let request = ${condStart}request.query(&[ (${k}, ${name}) ])${condEnd};`; - } -} - -function formatAddHeaderParam(param) { - const k = `"${param.name}"`; - const name = changeCase.snakeCase(param.name); - const condStart = param.required ? '' : `mut request = request; if let Some(${name}) = ${name} { `; - const condEnd = param.required ? '' : ' }' - const prop = param.schema; - switch (prop.type) { - case 'string': - return `let ${condStart}request = request.header(${k}, ${name});${condEnd}`; - case 'object': - throw 'unsupported'; - default: - return `let ${condStart}request = request.header(${k}, ${name}.to_string());${condEnd}`; - } -} - -function formatRouteArgument(route, pathParams = []) { - if (!pathParams.length) - return `"${route}"`; - - route = route.replace(/\{\S+?\}/g, '{}'); - const args = pathParams - .map(({name}) => name) - .map(changeCase.snakeCase) - .join(', '); - return `&format!("${route}", ${args})`; -} - -module.exports = { - changeCase, - preamble, - capitalize, - decapitalize, - normalizeSchemaName, - normalizeArgName, - normalizePropName, - stringifyType, - formatJsonProperty, - formatAddQueryParam, - formatAddHeaderParam, - formatRouteArgument, -}; \ No newline at end of file diff --git a/riven/srcgen/endpoints.rs.dt b/riven/srcgen/endpoints.rs.dt deleted file mode 100644 index fc1eb980..00000000 --- a/riven/srcgen/endpoints.rs.dt +++ /dev/null @@ -1,219 +0,0 @@ -{{ - const spec = require('./.spec.json'); - const dotUtils = require('./dotUtils.js'); -}}{{= dotUtils.preamble() }} - -// http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version {{= spec.info.version }} - -//! Automatically generated endpoint handles. -#![allow(clippy::let_and_return, clippy::too_many_arguments)] - -use std::future::Future; -use std::vec::Vec; - -#[cfg(feature="metrics")] -use crate::metrics; - -#[cfg(feature="tracing")] -use tracing::Instrument; -use reqwest::Method; - -use crate::Result; -use crate::consts::{ RegionalRoute, PlatformRoute, ValPlatformRoute }; -use crate::riot_api::RiotApi; - -{{ - const endpointGroups = {}; - for (let path of Object.entries(spec.paths)) { - let ep = path[1]['x-endpoint']; - endpointGroups[ep] = endpointGroups[ep] || []; - endpointGroups[ep].push(path); - } -}} -impl RiotApi { -{{ - for (const endpointName of Object.keys(endpointGroups)) { - const method = dotUtils.changeCase.snakeCase(endpointName); - const type = dotUtils.changeCase.pascalCase(endpointName); -}} - /// Returns a handle for accessing [{{= type }}](crate::endpoints::{{= type }}) endpoints. - /// # Riot Developer API Reference - /// `{{= endpointName }}` - /// - /// Note: this method is automatically generated. - #[inline] - pub fn {{= method }}(&self) -> {{= type }} { - {{= type }} { base: self } - } -{{ - } -}} -} -{{ - for (let [ endpointName, endpointMethods ] of Object.entries(endpointGroups)) - { - let endpoint = dotUtils.changeCase.pascalCase(endpointName); - const endpoint_snake_case = dotUtils.changeCase.snakeCase(endpointName); -}} - -/// {{= endpoint }} endpoints handle, accessed by calling [`{{= endpoint_snake_case }}()`](RiotApi::{{= endpoint_snake_case }}) on a [`RiotApi`] instance. -/// # Riot Developer API Reference -/// `{{= endpointName }}` -/// -/// Note: this struct is automatically generated. -#[repr(transparent)] -pub struct {{= endpoint }}<'a> { - base: &'a RiotApi, -} -impl<'a> {{= endpoint }}<'a> { -{{ - for (const [ route, path ] of endpointMethods) - { - for (const [ verb, operation ] of Object.entries(path)) - { - if (verb.startsWith('x-')) continue; - - const operationId = operation.operationId; - const method = dotUtils.changeCase.snakeCase(operationId.slice(operationId.indexOf('.') + 1)); - - const resp200 = operation.responses['200']; - const isRso = (null != operation.security) && (null != operation.security[0]['rso']); - - /* Return type checks. */ - let hasReturn = false; - let returnType = '()'; - let returnTypeTurbofish = ''; - let returnOptional = false; - if (resp200 && resp200.content) - { - hasReturn = true; - const jsonInfo = resp200.content['application/json']; - - const parseType = dotUtils.stringifyType(jsonInfo.schema, { fullpath: false }); - returnTypeTurbofish = `::<${parseType}>`; - returnOptional = !!operation['x-nullable-404']; - returnType = returnOptional ? `Option<${parseType}>` : parseType; - } - - /* Body content checks. */ - let bodyType = null; - if (operation.requestBody) - { - const jsonInfo = operation.requestBody.content['application/json']; - bodyType = dotUtils.stringifyType(jsonInfo.schema, { fullpath: false }); - } - - /* Description processing. */ - let descArr = operation.description.split('\n'); - - /* Build argument comment & string. */ - const argBuilder = [ - 'route: ', dotUtils.changeCase.pascalCase(operation['x-route-enum']), 'Route' - ]; - if (isRso) { - argBuilder.push(', access_token: impl std::fmt::Display'); - } - - /* Add body params before path/query. */ - if (bodyType) { - argBuilder.push(', body: &', bodyType); - } - - /* Path and query params. */ - const allParams = operation.parameters; - let queryParams = []; - let headerParams = []; - let routeArgument; - if (allParams && allParams.length) - { - const pathParams = allParams.filter(p => 'path' === p.in) - .sortBy(({ name }) => route.indexOf(name)); - - const reqQueryParams = allParams.filter(p => 'query' === p.in && p.required); - const optQueryParams = allParams.filter(p => 'query' === p.in && !p.required) - .sortBy(({ name }) => { - let match = /(^[a-z]+|[A-Z]+(?![a-z])|[A-Z][a-z]+)/.exec(name); - return match.slice(1).reverse().join(''); - }); - queryParams = reqQueryParams.concat(optQueryParams); - - headerParams = allParams.filter(p => 'header' === p.in); - - for (let paramList of [ pathParams, reqQueryParams, optQueryParams, headerParams ]) - { - const required = paramList === pathParams; - for (const param of paramList) - { - argBuilder.push(', ', dotUtils.normalizePropName(param.name), ': ', - dotUtils.stringifyType(param.schema, { optional: !(required || param.required), owned: false })); - } - } - - routeArgument = dotUtils.formatRouteArgument(route, pathParams); - } - else - { - routeArgument = dotUtils.formatRouteArgument(route); - } - - for (var descLine of descArr) - { -}} - ///{{= descLine ? ' ' + descLine : '' }} -{{ - } -}} - /// # Parameters - /// * `route` - Route to query. -{{? isRso }} - /// * `access_token` - RSO access token. -{{?}} -{{~ allParams || [] :param }} - /// * `{{= dotUtils.changeCase.snakeCase(param.name) }}` ({{= param.required ? 'required' : 'optional' }}, in {{= param.in }}){{= param.description ? ' - ' + param.description : ''}} -{{~}} -{{? isRso }} - /// # RSO - /// This endpoint uses [Riot Sign On](https://developer.riotgames.com/docs/lol#rso-integration) - /// via the `access_token` parameter, instead of the Riot API key. -{{?}} - /// # Riot Developer API Reference - /// `{{= operationId }}` - /// - /// Note: this method is automatically generated. - pub fn {{= method }}(&self, {{= argBuilder.join('') }}) - -> impl Future> + 'a - { - let route_str = route.into(); - let request = self.base.request(Method::{{= verb.toUpperCase() }}, route_str, {{= routeArgument }}); -{{? isRso }} - let mut request = request.bearer_auth(access_token); - if let Some(clear) = self.base.get_rso_clear_header() { request = request.header(clear, "") } -{{?}} -{{~ queryParams :queryParam }} - {{= dotUtils.formatAddQueryParam(queryParam) }} -{{~}} -{{~ headerParams :headerParam }} - {{= dotUtils.formatAddHeaderParam(headerParam) }} -{{~}} -{{? bodyType }} - let request = request - .body(serde_json::ser::to_vec(body).unwrap()) - .header(reqwest::header::CONTENT_TYPE, "application/json"); -{{?}} - let future = self.base.execute{{= hasReturn ? (returnOptional ? '_opt' : '_val') : '' }}{{= returnTypeTurbofish }}("{{= operationId }}", route_str, request); - #[cfg(feature = "tracing")] - let future = future.instrument(tracing::info_span!("{{= operationId }}", route = route_str)); - #[cfg(feature = "metrics")] - let future = metrics::timed(future, "{{= operationId }}", route_str); - future - } - -{{ - } - } -}} -} -{{ - } -}} diff --git a/riven/srcgen/index.js b/riven/srcgen/index.js deleted file mode 100644 index e520eb49..00000000 --- a/riven/srcgen/index.js +++ /dev/null @@ -1,89 +0,0 @@ -const util = require('util'); -const fs = require('fs'); -fs.readFileAsync = util.promisify(fs.readFile); -fs.writeFileAsync = util.promisify(fs.writeFile); -const req = require("request-promise-native"); - -process.chdir(__dirname); - -const files = [ - [ - 'http://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-summary.json', - '.champion.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/openapi-3.0.0.json', - '.spec.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/enums/seasons.json', - '.seasons.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/enums/queues.json', - '.queues.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/enums/queueTypes.json', - '.queueTypes.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/enums/gameTypes.json', - '.gameTypes.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/enums/gameModes.json', - '.gameModes.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/enums/maps.json', - '.maps.json' - ], - [ - 'http://www.mingweisamuel.com/riotapi-schema/routesTable.json', - '.routesTable.json' - ], -]; - -const downloadFilesPromise = Promise.all(files.map(([url, file]) => req(url) - .then(body => fs.writeFileAsync(file, body, "utf8")))); - -const doT = require('dot'); -const glob = require('glob-promise'); - -const log = a => { console.log(a); return a; }; -const suffix = '.dt'; - -doT.templateSettings = { - evaluate: /\r?\n?\{\{([\s\S]+?)\}\}/g, - interpolate: /\r?\n?\{\{=([\s\S]+?)\}\}/g, - encode: /\r?\n?\{\{!([\s\S]+?)\}\}/g, - use: /\r?\n?\{\{#([\s\S]+?)\}\}/g, - define: /\r?\n?\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g, - conditional: /\r?\n?\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g, - iterate: /\r?\n?\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g, - varname: 'it', - strip: false, - append: false, - selfcontained: false -}; - -global.require = require; - -downloadFilesPromise.then(() => glob.promise("**/*" + suffix, { ignore: ["**/node_modules/**"] })) - .then(files => Promise.all(files - .map(log) - .map(file => fs.readFileAsync(file, "utf8") - .then(input => { - try { - return doT.template(input)({}); - } - catch (e) { - console.error(`Error thrown while running "${file}":`, e); - throw e; - } - }) - .then(output => fs.writeFileAsync("../src/" + file.slice(0, -suffix.length), output, "utf8")) - ) - )) - .catch(console.error); \ No newline at end of file diff --git a/riven/srcgen/meta.rs.dt b/riven/srcgen/meta.rs.dt deleted file mode 100644 index 79837c63..00000000 --- a/riven/srcgen/meta.rs.dt +++ /dev/null @@ -1,31 +0,0 @@ -{{ - const spec = require('./.spec.json'); - const dotUtils = require('./dotUtils.js'); - - const operations = []; - for (const [ route, path ] of Object.entries(spec.paths)) { - for (const [ method, operation ] of Object.entries(path)) { - if (method.startsWith('x-')) continue; - operations.push({ route, method, operation }); - } - } -}}{{= dotUtils.preamble() }} - -// http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version {{= spec.info.version }} - -//! Metadata about the Riot API and Riven. -//! -//! Note: this modules is automatically generated. - -/// Metadata for endpoints. Each tuple corresponds to one endpoint and contains -/// the HTTP [`Method`](reqwest::Method), `str` path, and the method's `str` ID. -pub static ALL_ENDPOINTS: [(reqwest::Method, &str, &str); {{= operations.length }}] = [ -{{ - for (const { route, method, operation } of operations) { -}} - (reqwest::Method::{{= method.toUpperCase() }}, "{{= route }}", "{{= operation.operationId }}"), -{{ - } -}} -]; diff --git a/riven/srcgen/models.rs.dt b/riven/srcgen/models.rs.dt deleted file mode 100644 index 04558837..00000000 --- a/riven/srcgen/models.rs.dt +++ /dev/null @@ -1,97 +0,0 @@ -{{ - const spec = require('./.spec.json'); - const dotUtils = require('./dotUtils.js'); -}}{{= dotUtils.preamble() }} - -// http://www.mingweisamuel.com/riotapi-schema/tool/ -// Version {{= spec.info.version }} - -#![allow(missing_docs)] - -//! Data transfer structs. -//! -//! Separated into separate modules for each endpoint. -//! Several modules contain structs with the same name, so be sure to use the right ones. -//! -//! Note: these modules are automatically generated. - -{{ - let schemas = spec.components.schemas; - let schemaKeyByEndpoint = Object.keys(schemas) - .filter(schemaKey => 'Error' != schemaKey) - .groupBy(schemaKey => schemaKey.split('.')[0]); - - for (let [endpoint, schemaKeyGroup] of schemaKeyByEndpoint) { - const endpoint_pascal_case = dotUtils.changeCase.pascalCase(endpoint); -}} -/// Data structs used by [`{{= endpoint_pascal_case }}`](crate::endpoints::{{= endpoint_pascal_case }}). -/// -/// Note: this module is automatically generated. -#[allow(dead_code)] -pub mod {{= dotUtils.changeCase.snakeCase(endpoint) }} { -{{ - for (let schemaKey of schemaKeyGroup) { - const [, rawSchemaName] = schemaKey.split('.'); - const schemaName = dotUtils.normalizeSchemaName(rawSchemaName); - const schema = schemas[schemaKey]; - const props = schema.properties; - const requiredSet = new Set(schema.required); -}} - /// `{{= endpoint }}.{{= rawSchemaName }}` data object. -{{? schema.description }} - /// # Description - /// {{= schema.description.replace(/https?:\/\/\S+[^\s\.!?]/g, "<$&>").split('\n').map(x => x.trim()).join('
\r\n /// ') }} - /// - /// Note: This struct is automatically generated -{{?}} - #[derive(Clone, Debug)] - #[derive(serde::Serialize, crate::de::Deserialize)] - #[cfg_attr(feature = "deny-unknown-fields", serde(deny_unknown_fields))] - pub struct {{= schemaName }} { -{{ - const usedNames = new Set(); - for (let [ propKey, prop ] of Object.entries(props)) - { - const optional = !requiredSet.has(propKey); - - let name = dotUtils.normalizePropName(propKey); - while (usedNames.has(name)) { - name += '_'; - } - usedNames.add(name); -}} -{{? prop.description }} - /// {{= prop.description.replace(/https?:\/\/\S+[^\s\.!?]/g, "<$&>").split('\n').map(x => x.trim()).join('
\r\n /// ') }} -{{?}} - {{= dotUtils.formatJsonProperty(propKey, prop) }} -{{? optional }} - #[serde(default, skip_serializing_if = "Option::is_none")] -{{?}} -{{? 'championId' === propKey && (prop.description || '').includes('this field returned invalid championIds') }} - /// - /// Instead use [`Self::champion()`] which checks this field then parses [`Self::champion_name`]. - #[deprecated(since = "2.5.0", note = "Use `Participant.champion()` instead. Riot sometimes returns corrupted data for this field: ")] - #[serde(serialize_with = "crate::consts::Champion::serialize_result")] - #[serde(deserialize_with = "crate::consts::Champion::deserialize_result")] - pub {{= name }}: Result, -{{?? 'gameType' === propKey && 'Info' === schemaName && 'match-v5' === endpoint }} - /// - /// Will be `None` if empty string is returned: - #[serde(serialize_with = "crate::consts::serialize_empty_string_none")] - #[serde(deserialize_with = "crate::consts::deserialize_empty_string_none")] - pub {{= name }}: Option, -{{??}} - pub {{= name }}: {{= dotUtils.stringifyType(prop, { optional }) }}, -{{?}} -{{ - } -}} - } -{{ - } -}} -} - -{{ - } -}} \ No newline at end of file diff --git a/riven/srcgen/package-lock.json b/riven/srcgen/package-lock.json deleted file mode 100644 index fc4f2b24..00000000 --- a/riven/srcgen/package-lock.json +++ /dev/null @@ -1,1445 +0,0 @@ -{ - "name": "dot-gen", - "version": "0.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "dot-gen", - "version": "0.0.0", - "license": "GPL-2.0", - "dependencies": { - "change-case": "^3.1.0", - "dot": "^1.1.3", - "glob": "^7.1.2", - "glob-promise": "^3.3.0", - "request": "^2.88.0", - "request-promise-native": "^1.0.7" - }, - "devDependencies": {} - }, - "node_modules/@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, - "node_modules/@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "dependencies": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "node_modules/@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" - }, - "node_modules/@types/node": { - "version": "12.11.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.1.tgz", - "integrity": "sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A==" - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/ajv/node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - }, - "node_modules/asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "engines": { - "node": ">=0.8" - } - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "engines": { - "node": "*" - } - }, - "node_modules/aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "dependencies": { - "tweetnacl": "^0.14.3" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", - "dependencies": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "node_modules/change-case": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-3.1.0.tgz", - "integrity": "sha512-2AZp7uJZbYEzRPsFoa+ijKdvp9zsrnnt6+yFokfwEpeJm0xuJDVoxiRCAaTzyJND8GJkofo2IcKWaUZ/OECVzw==", - "dependencies": { - "camel-case": "^3.0.0", - "constant-case": "^2.0.0", - "dot-case": "^2.1.0", - "header-case": "^1.0.0", - "is-lower-case": "^1.1.0", - "is-upper-case": "^1.1.0", - "lower-case": "^1.1.1", - "lower-case-first": "^1.0.0", - "no-case": "^2.3.2", - "param-case": "^2.1.0", - "pascal-case": "^2.0.0", - "path-case": "^2.1.0", - "sentence-case": "^2.1.0", - "snake-case": "^2.1.0", - "swap-case": "^1.1.0", - "title-case": "^2.1.0", - "upper-case": "^1.1.1", - "upper-case-first": "^1.1.0" - } - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "node_modules/constant-case": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz", - "integrity": "sha1-QXV2TTidP6nI7NKRhu1gBSQ7akY=", - "dependencies": { - "snake-case": "^2.1.0", - "upper-case": "^1.1.1" - } - }, - "node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "dependencies": { - "assert-plus": "^1.0.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/dot": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dot/-/dot-1.1.3.tgz", - "integrity": "sha512-/nt74Rm+PcfnirXGEdhZleTwGC2LMnuKTeeTIlI82xb5loBBoXNYzr2ezCroPSMtilK8EZIfcNZwOcHN+ib1Lg==", - "engines": [ - "node >=0.2.6" - ], - "bin": { - "dottojs": "bin/dot-packer" - } - }, - "node_modules/dot-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-2.1.1.tgz", - "integrity": "sha1-NNzzf1Co6TwrO8qLt/uRVcfaO+4=", - "dependencies": { - "no-case": "^2.2.0" - } - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "engines": [ - "node >=0.6.0" - ] - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "engines": { - "node": "*" - } - }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dependencies": { - "assert-plus": "^1.0.0" - } - }, - "node_modules/glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - } - }, - "node_modules/glob-promise": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", - "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", - "dependencies": { - "@types/glob": "*" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "glob": "*" - } - }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "engines": { - "node": ">=4" - } - }, - "node_modules/har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "deprecated": "this library is no longer supported", - "dependencies": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/header-case": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz", - "integrity": "sha1-lTWXMZfBRLCWE81l0xfvGZY70C0=", - "dependencies": { - "no-case": "^2.2.0", - "upper-case": "^1.1.3" - } - }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - }, - "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/is-lower-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz", - "integrity": "sha1-fhR75HaNxGbbO/shzGCzHmrWk5M=", - "dependencies": { - "lower-case": "^1.1.0" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "node_modules/is-upper-case": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz", - "integrity": "sha1-jQsfp+eTOh5YSDYA7H2WYcuvdW8=", - "dependencies": { - "upper-case": "^1.1.0" - } - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - }, - "engines": { - "node": ">=0.6.0" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" - }, - "node_modules/lower-case-first": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lower-case-first/-/lower-case-first-1.0.2.tgz", - "integrity": "sha1-5dp8JvKacHO+AtUrrJmA5ZIq36E=", - "dependencies": { - "lower-case": "^1.1.2" - } - }, - "node_modules/mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "dependencies": { - "mime-db": "1.40.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "dependencies": { - "lower-case": "^1.1.1" - } - }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "engines": { - "node": "*" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/param-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", - "dependencies": { - "no-case": "^2.2.0" - } - }, - "node_modules/pascal-case": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-2.0.1.tgz", - "integrity": "sha1-LVeNNFX2YNpl7KGO+VtODekSdh4=", - "dependencies": { - "camel-case": "^3.0.0", - "upper-case-first": "^1.1.0" - } - }, - "node_modules/path-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-2.1.1.tgz", - "integrity": "sha1-lLgDfDctP+KQbkZbtF4l0ibo7qU=", - "dependencies": { - "no-case": "^2.2.0" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "node_modules/psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "engines": { - "node": ">=6" - } - }, - "node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "engines": { - "node": ">= 4" - } - }, - "node_modules/request-promise-core": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", - "dependencies": { - "lodash": "^4.17.11" - }, - "engines": { - "node": ">=0.10.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/request-promise-native": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", - "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", - "dependencies": { - "request-promise-core": "1.1.2", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - }, - "engines": { - "node": ">=0.12.0" - }, - "peerDependencies": { - "request": "^2.34" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" - }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sentence-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-2.1.1.tgz", - "integrity": "sha1-H24t2jnBaL+S0T+G1KkYkz9mftQ=", - "dependencies": { - "no-case": "^2.2.0", - "upper-case-first": "^1.1.2" - } - }, - "node_modules/snake-case": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", - "integrity": "sha1-Qb2xtz8w7GagTU4srRt2OH1NbZ8=", - "dependencies": { - "no-case": "^2.2.0" - } - }, - "node_modules/sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/swap-case": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/swap-case/-/swap-case-1.1.2.tgz", - "integrity": "sha1-w5IDpFhzhfrTyFCgvRvK+ggZdOM=", - "dependencies": { - "lower-case": "^1.1.1", - "upper-case": "^1.1.1" - } - }, - "node_modules/title-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/title-case/-/title-case-2.1.1.tgz", - "integrity": "sha1-PhJyFtpY0rxb7PE3q5Ha46fNj6o=", - "dependencies": { - "no-case": "^2.2.0", - "upper-case": "^1.0.3" - } - }, - "node_modules/tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "dependencies": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/tough-cookie/node_modules/punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "dependencies": { - "safe-buffer": "^5.0.1" - }, - "engines": { - "node": "*" - } - }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "node_modules/upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" - }, - "node_modules/upper-case-first": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.1.2.tgz", - "integrity": "sha1-XXm+3P8UQZUY/S7bCgUHybaFkRU=", - "dependencies": { - "upper-case": "^1.1.1" - } - }, - "node_modules/uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "bin": { - "uuid": "bin/uuid" - } - }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "engines": [ - "node >=0.6.0" - ], - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - }, - "dependencies": { - "@types/events": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", - "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" - }, - "@types/glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", - "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", - "requires": { - "@types/events": "*", - "@types/minimatch": "*", - "@types/node": "*" - } - }, - "@types/minimatch": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", - "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==" - }, - "@types/node": { - "version": "12.11.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.11.1.tgz", - "integrity": "sha512-TJtwsqZ39pqcljJpajeoofYRfeZ7/I/OMUQ5pR4q5wOKf2ocrUvBAZUMhWsOvKx3dVc/aaV5GluBivt0sWqA5A==" - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "dependencies": { - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" - } - } - }, - "asn1": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", - "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", - "requires": { - "safer-buffer": "~2.1.0" - } - }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" - }, - "aws4": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" - }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" - }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "requires": { - "tweetnacl": "^0.14.3" - } - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "camel-case": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-3.0.0.tgz", - "integrity": "sha1-yjw2iKTpzzpM2nd9xNy8cTJJz3M=", - "requires": { - "no-case": "^2.2.0", - "upper-case": "^1.1.1" - } - }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" - }, - "change-case": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/change-case/-/change-case-3.1.0.tgz", - "integrity": "sha512-2AZp7uJZbYEzRPsFoa+ijKdvp9zsrnnt6+yFokfwEpeJm0xuJDVoxiRCAaTzyJND8GJkofo2IcKWaUZ/OECVzw==", - "requires": { - "camel-case": "^3.0.0", - "constant-case": "^2.0.0", - "dot-case": "^2.1.0", - "header-case": "^1.0.0", - "is-lower-case": "^1.1.0", - "is-upper-case": "^1.1.0", - "lower-case": "^1.1.1", - "lower-case-first": "^1.0.0", - "no-case": "^2.3.2", - "param-case": "^2.1.0", - "pascal-case": "^2.0.0", - "path-case": "^2.1.0", - "sentence-case": "^2.1.0", - "snake-case": "^2.1.0", - "swap-case": "^1.1.0", - "title-case": "^2.1.0", - "upper-case": "^1.1.1", - "upper-case-first": "^1.1.0" - } - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - }, - "constant-case": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/constant-case/-/constant-case-2.0.0.tgz", - "integrity": "sha1-QXV2TTidP6nI7NKRhu1gBSQ7akY=", - "requires": { - "snake-case": "^2.1.0", - "upper-case": "^1.1.1" - } - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" - }, - "dot": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/dot/-/dot-1.1.3.tgz", - "integrity": "sha512-/nt74Rm+PcfnirXGEdhZleTwGC2LMnuKTeeTIlI82xb5loBBoXNYzr2ezCroPSMtilK8EZIfcNZwOcHN+ib1Lg==" - }, - "dot-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-2.1.1.tgz", - "integrity": "sha1-NNzzf1Co6TwrO8qLt/uRVcfaO+4=", - "requires": { - "no-case": "^2.2.0" - } - }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" - } - }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" - }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" - }, - "fast-json-stable-stringify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" - }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "requires": { - "assert-plus": "^1.0.0" - } - }, - "glob": { - "version": "7.1.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", - "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-promise": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/glob-promise/-/glob-promise-3.4.0.tgz", - "integrity": "sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==", - "requires": { - "@types/glob": "*" - } - }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" - }, - "har-validator": { - "version": "5.1.3", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", - "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", - "requires": { - "ajv": "^6.5.5", - "har-schema": "^2.0.0" - } - }, - "header-case": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz", - "integrity": "sha1-lTWXMZfBRLCWE81l0xfvGZY70C0=", - "requires": { - "no-case": "^2.2.0", - "upper-case": "^1.1.3" - } - }, - "http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "is-lower-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-lower-case/-/is-lower-case-1.1.3.tgz", - "integrity": "sha1-fhR75HaNxGbbO/shzGCzHmrWk5M=", - "requires": { - "lower-case": "^1.1.0" - } - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" - }, - "is-upper-case": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/is-upper-case/-/is-upper-case-1.1.2.tgz", - "integrity": "sha1-jQsfp+eTOh5YSDYA7H2WYcuvdW8=", - "requires": { - "upper-case": "^1.1.0" - } - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" - }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==" - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" - }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" - }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "lower-case": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz", - "integrity": "sha1-miyr0bno4K6ZOkv31YdcOcQujqw=" - }, - "lower-case-first": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/lower-case-first/-/lower-case-first-1.0.2.tgz", - "integrity": "sha1-5dp8JvKacHO+AtUrrJmA5ZIq36E=", - "requires": { - "lower-case": "^1.1.2" - } - }, - "mime-db": { - "version": "1.40.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", - "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" - }, - "mime-types": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", - "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", - "requires": { - "mime-db": "1.40.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "no-case": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/no-case/-/no-case-2.3.2.tgz", - "integrity": "sha512-rmTZ9kz+f3rCvK2TD1Ue/oZlns7OGoIWP4fc3llxxRXlOkHKoWPPWJOfFYpITabSow43QJbRIoHQXtt10VldyQ==", - "requires": { - "lower-case": "^1.1.1" - } - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" - } - }, - "param-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/param-case/-/param-case-2.1.1.tgz", - "integrity": "sha1-35T9jPZTHs915r75oIWPvHK+Ikc=", - "requires": { - "no-case": "^2.2.0" - } - }, - "pascal-case": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-2.0.1.tgz", - "integrity": "sha1-LVeNNFX2YNpl7KGO+VtODekSdh4=", - "requires": { - "camel-case": "^3.0.0", - "upper-case-first": "^1.1.0" - } - }, - "path-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/path-case/-/path-case-2.1.1.tgz", - "integrity": "sha1-lLgDfDctP+KQbkZbtF4l0ibo7qU=", - "requires": { - "no-case": "^2.2.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" - }, - "psl": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.4.0.tgz", - "integrity": "sha512-HZzqCGPecFLyoRj5HLfuDSKYTJkAfB5thKBIkRHtGjWwY7p1dAyveIbXIq4tO0KYfDF2tHqPUgY9SDnGm00uFw==" - }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - }, - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==" - }, - "request": { - "version": "2.88.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", - "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.0", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.4.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - } - }, - "request-promise-core": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", - "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", - "requires": { - "lodash": "^4.17.11" - } - }, - "request-promise-native": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", - "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", - "requires": { - "request-promise-core": "1.1.2", - "stealthy-require": "^1.1.1", - "tough-cookie": "^2.3.3" - } - }, - "safe-buffer": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" - }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "sentence-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/sentence-case/-/sentence-case-2.1.1.tgz", - "integrity": "sha1-H24t2jnBaL+S0T+G1KkYkz9mftQ=", - "requires": { - "no-case": "^2.2.0", - "upper-case-first": "^1.1.2" - } - }, - "snake-case": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-2.1.0.tgz", - "integrity": "sha1-Qb2xtz8w7GagTU4srRt2OH1NbZ8=", - "requires": { - "no-case": "^2.2.0" - } - }, - "sshpk": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", - "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, - "swap-case": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/swap-case/-/swap-case-1.1.2.tgz", - "integrity": "sha1-w5IDpFhzhfrTyFCgvRvK+ggZdOM=", - "requires": { - "lower-case": "^1.1.1", - "upper-case": "^1.1.1" - } - }, - "title-case": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/title-case/-/title-case-2.1.1.tgz", - "integrity": "sha1-PhJyFtpY0rxb7PE3q5Ha46fNj6o=", - "requires": { - "no-case": "^2.2.0", - "upper-case": "^1.0.3" - } - }, - "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", - "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" - }, - "dependencies": { - "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" - } - } - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "requires": { - "safe-buffer": "^5.0.1" - } - }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "upper-case": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/upper-case/-/upper-case-1.1.3.tgz", - "integrity": "sha1-9rRQHC7EzdJrp4vnIilh3ndiFZg=" - }, - "upper-case-first": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/upper-case-first/-/upper-case-first-1.1.2.tgz", - "integrity": "sha1-XXm+3P8UQZUY/S7bCgUHybaFkRU=", - "requires": { - "upper-case": "^1.1.1" - } - }, - "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", - "requires": { - "punycode": "^2.1.0" - } - }, - "uuid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", - "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - } - } -} diff --git a/riven/srcgen/package.json b/riven/srcgen/package.json deleted file mode 100644 index 8f49a4d3..00000000 --- a/riven/srcgen/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "dot-gen", - "version": "0.0.0", - "description": "", - "main": "index.js", - "dependencies": { - "change-case": "^3.1.0", - "dot": "^1.1.3", - "glob": "^7.1.2", - "glob-promise": "^3.3.0", - "request": "^2.88.0", - "request-promise-native": "^1.0.7" - }, - "devDependencies": {}, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "GPL-2.0" -}