2023-01-08 04:07:35 +00:00
|
|
|
///////////////////////////////////////////////
|
|
|
|
// //
|
|
|
|
// ! //
|
|
|
|
// This file is automatically generated! //
|
|
|
|
// Do not directly edit! //
|
|
|
|
// //
|
|
|
|
///////////////////////////////////////////////
|
|
|
|
|
2021-05-22 04:07:31 +00:00
|
|
|
use num_enum::{ IntoPrimitive, TryFromPrimitive };
|
|
|
|
use strum_macros::{ EnumString, EnumIter, Display, IntoStaticStr };
|
|
|
|
|
|
|
|
/// Regional routes, used in tournament services, Legends of Runterra, and other 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 {
|
2023-01-08 04:07:35 +00:00
|
|
|
/// North and South America.
|
|
|
|
///
|
|
|
|
/// `1` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
AMERICAS = 1,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Asia, used for LoL matches (`match-v5`) and TFT matches (`tft-match-v1`).
|
|
|
|
///
|
|
|
|
/// `2` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
ASIA = 2,
|
|
|
|
|
|
|
|
/// Europe.
|
2023-01-08 04:07:35 +00:00
|
|
|
///
|
|
|
|
/// `3` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
EUROPE = 3,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// South East Asia, used for LoR, LoL matches (`match-v5`), and TFT matches (`tft-match-v1`).
|
|
|
|
///
|
|
|
|
/// `4` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
SEA = 4,
|
2023-01-08 04:07:35 +00:00
|
|
|
|
|
|
|
/// 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,
|
|
|
|
|
2021-05-22 04:07:31 +00:00
|
|
|
}
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR).
|
2021-05-22 04:07:31 +00:00
|
|
|
#[derive(Debug)]
|
|
|
|
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)]
|
|
|
|
#[derive(IntoPrimitive, TryFromPrimitive)]
|
|
|
|
#[derive(EnumString, EnumIter, Display, IntoStaticStr)]
|
|
|
|
#[derive(Clone, Copy)]
|
|
|
|
#[repr(u8)]
|
|
|
|
#[non_exhaustive]
|
2022-02-09 04:27:58 +00:00
|
|
|
// Note: strum(serialize = ...) actually specifies extra DEserialization values.
|
2021-05-22 04:07:31 +00:00
|
|
|
pub enum PlatformRoute {
|
|
|
|
/// Brazil.
|
2023-01-08 04:07:35 +00:00
|
|
|
///
|
|
|
|
/// `16` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="BR1", serialize="BR")]
|
|
|
|
BR1 = 16,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Europe, Northeast.
|
|
|
|
///
|
|
|
|
/// `17` (riotapi-schema ID/repr)
|
2021-05-22 04:59:51 +00:00
|
|
|
#[strum(to_string="EUN1", serialize="EUNE")]
|
2021-05-22 04:07:31 +00:00
|
|
|
EUN1 = 17,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Europe, West.
|
|
|
|
///
|
|
|
|
/// `18` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="EUW1", serialize="EUW")]
|
|
|
|
EUW1 = 18,
|
|
|
|
|
|
|
|
/// Japan.
|
2023-01-08 04:07:35 +00:00
|
|
|
///
|
|
|
|
/// `19` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="JP1", serialize="JP")]
|
|
|
|
JP1 = 19,
|
|
|
|
|
|
|
|
/// Korea.
|
2023-01-08 04:07:35 +00:00
|
|
|
///
|
|
|
|
/// `20` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
KR = 20,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Latin America, North.
|
|
|
|
///
|
|
|
|
/// `21` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="LA1", serialize="LAN")]
|
|
|
|
LA1 = 21,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Latin America, South.
|
|
|
|
///
|
|
|
|
/// `22` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="LA2", serialize="LAS")]
|
|
|
|
LA2 = 22,
|
|
|
|
|
|
|
|
/// North America.
|
2023-01-08 04:07:35 +00:00
|
|
|
///
|
|
|
|
/// `23` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="NA1", serialize="NA")]
|
|
|
|
NA1 = 23,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Oceana.
|
|
|
|
///
|
|
|
|
/// `24` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="OC1", serialize="OCE")]
|
|
|
|
OC1 = 24,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Philippines
|
|
|
|
///
|
|
|
|
/// `32` (riotapi-schema ID/repr)
|
2023-01-21 06:03:13 +00:00
|
|
|
#[strum(to_string="PH2", serialize="PH")]
|
2023-01-08 04:07:35 +00:00
|
|
|
PH2 = 32,
|
|
|
|
|
|
|
|
/// Russia
|
|
|
|
///
|
|
|
|
/// `25` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
RU = 25,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Singapore
|
|
|
|
///
|
|
|
|
/// `33` (riotapi-schema ID/repr)
|
2023-01-21 06:03:13 +00:00
|
|
|
#[strum(to_string="SG2", serialize="SG")]
|
2023-01-08 04:07:35 +00:00
|
|
|
SG2 = 33,
|
|
|
|
|
|
|
|
/// Thailand
|
|
|
|
///
|
|
|
|
/// `34` (riotapi-schema ID/repr)
|
2023-01-21 06:03:13 +00:00
|
|
|
#[strum(to_string="TH2", serialize="TH")]
|
2023-01-08 04:07:35 +00:00
|
|
|
TH2 = 34,
|
|
|
|
|
|
|
|
/// Turkey
|
|
|
|
///
|
|
|
|
/// `26` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="TR1", serialize="TR")]
|
|
|
|
TR1 = 26,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Taiwan
|
|
|
|
///
|
|
|
|
/// `35` (riotapi-schema ID/repr)
|
2023-01-21 06:03:13 +00:00
|
|
|
#[strum(to_string="TW2", serialize="TW")]
|
2023-01-08 04:07:35 +00:00
|
|
|
TW2 = 35,
|
|
|
|
|
|
|
|
/// Vietnam
|
|
|
|
///
|
|
|
|
/// `36` (riotapi-schema ID/repr)
|
2023-01-21 06:03:13 +00:00
|
|
|
#[strum(to_string="VN2", serialize="VN")]
|
2023-01-08 04:07:35 +00:00
|
|
|
VN2 = 36,
|
2021-05-22 04:07:31 +00:00
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Public Beta Environment, special beta testing platform. Located in North America.
|
|
|
|
///
|
|
|
|
/// `31` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
#[strum(to_string="PBE1", serialize="PBE")]
|
|
|
|
PBE1 = 31,
|
2023-01-08 04:07:35 +00:00
|
|
|
|
2021-05-22 04:07:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl PlatformRoute {
|
2022-02-09 01:17:47 +00:00
|
|
|
/// Converts this [`PlatformRoute`] into its corresponding
|
2023-01-08 04:07:35 +00:00
|
|
|
/// [`RegionalRoute`] for LoL and TFT match endpoints.
|
|
|
|
/// For example, [`match-v5`](crate::endpoints::MatchV5).
|
2021-05-22 04:07:31 +00:00
|
|
|
pub fn to_regional(self) -> RegionalRoute {
|
|
|
|
match self {
|
2023-01-08 04:07:35 +00:00
|
|
|
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::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,
|
2021-05-22 04:07:31 +00:00
|
|
|
Self::PBE1 => RegionalRoute::AMERICAS,
|
2023-01-08 04:07:35 +00:00
|
|
|
}
|
|
|
|
}
|
2021-05-22 04:07:31 +00:00
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// 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,
|
2021-05-22 04:07:31 +00:00
|
|
|
Self::EUN1 => RegionalRoute::EUROPE,
|
|
|
|
Self::EUW1 => RegionalRoute::EUROPE,
|
2023-01-08 04:07:35 +00:00
|
|
|
Self::JP1 => RegionalRoute::ASIA,
|
|
|
|
Self::KR => RegionalRoute::ASIA,
|
|
|
|
Self::LA1 => RegionalRoute::AMERICAS,
|
|
|
|
Self::LA2 => RegionalRoute::AMERICAS,
|
|
|
|
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,
|
2021-05-22 04:07:31 +00:00
|
|
|
}
|
|
|
|
}
|
2021-05-22 04:59:51 +00:00
|
|
|
|
2023-01-21 06:03:13 +00:00
|
|
|
/// Used in the LoL Tournament API. Specifically
|
|
|
|
/// [`tournament-stub-v4.registerProviderData`](crate::endpoints::TournamentStubV4::register_provider_data)
|
|
|
|
/// and [`tournament-v4.registerProviderData`](crate::endpoints::TournamentV4::register_provider_data).
|
|
|
|
pub fn to_tournament_region(self) -> Option<TournamentRegion> {
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// 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.
|
2021-05-22 04:59:51 +00:00
|
|
|
pub fn as_region_str(self) -> &'static str {
|
|
|
|
match self {
|
2023-01-08 04:07:35 +00:00
|
|
|
Self::BR1 => "BR",
|
2021-05-22 04:59:51 +00:00
|
|
|
Self::EUN1 => "EUNE",
|
|
|
|
Self::EUW1 => "EUW",
|
2023-01-08 04:07:35 +00:00
|
|
|
Self::JP1 => "JP",
|
|
|
|
Self::LA1 => "LAN",
|
|
|
|
Self::LA2 => "LAS",
|
|
|
|
Self::NA1 => "NA",
|
|
|
|
Self::OC1 => "OCE",
|
2023-01-21 06:03:13 +00:00
|
|
|
Self::PH2 => "PH",
|
|
|
|
Self::SG2 => "SG",
|
|
|
|
Self::TH2 => "TH",
|
2023-01-08 04:07:35 +00:00
|
|
|
Self::TR1 => "TR",
|
2023-01-21 06:03:13 +00:00
|
|
|
Self::TW2 => "TW",
|
|
|
|
Self::VN2 => "VN",
|
2021-05-22 04:59:51 +00:00
|
|
|
Self::PBE1 => "PBE",
|
2023-01-21 06:03:13 +00:00
|
|
|
other => other.into(),
|
2021-05-22 04:59:51 +00:00
|
|
|
}
|
|
|
|
}
|
2021-05-22 04:07:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// 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 {
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Asia-Pacific.
|
|
|
|
///
|
|
|
|
/// `64` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
AP = 64,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Brazil.
|
|
|
|
///
|
|
|
|
/// `65` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
BR = 65,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Europe.
|
|
|
|
///
|
|
|
|
/// `66` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
EU = 66,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Korea.
|
|
|
|
///
|
|
|
|
/// `70` (riotapi-schema ID/repr)
|
|
|
|
KR = 70,
|
|
|
|
|
|
|
|
/// Latin America.
|
|
|
|
///
|
|
|
|
/// `68` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
LATAM = 68,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// North America.
|
|
|
|
///
|
|
|
|
/// `69` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
NA = 69,
|
|
|
|
|
2023-01-08 04:07:35 +00:00
|
|
|
/// Special esports platform.
|
|
|
|
///
|
|
|
|
/// `95` (riotapi-schema ID/repr)
|
2021-05-22 04:07:31 +00:00
|
|
|
ESPORTS = 95,
|
|
|
|
|
|
|
|
}
|
2023-01-21 06:03:13 +00:00
|
|
|
|
|
|
|
/// Tournament regions for League of Legends (LoL) used in
|
|
|
|
/// [`tournament-stub-v4.registerProviderData`](crate::endpoints::TournamentStubV4::register_provider_data)
|
|
|
|
/// and [`tournament-v4.registerProviderData`](crate::endpoints::TournamentV4::register_provider_data).
|
|
|
|
#[derive(Debug)]
|
|
|
|
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)]
|
|
|
|
#[derive(IntoPrimitive, TryFromPrimitive)]
|
|
|
|
#[derive(EnumString, EnumIter, Display, IntoStaticStr)]
|
|
|
|
#[derive(serde::Serialize, serde::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,
|
|
|
|
/// Oceana.
|
|
|
|
OCE = 24,
|
|
|
|
/// Turkey
|
|
|
|
TR = 26,
|
|
|
|
/// Public Beta Environment, special beta testing platform. Located in North America.
|
|
|
|
PBE = 31,
|
|
|
|
}
|