11use num_enum:: { IntoPrimitive , TryFromPrimitive } ;
22use strum_macros:: { Display , EnumIter , EnumString , IntoStaticStr } ;
33///Regional routes, used in tournament services, Legends of Runeterra (LoR), and some other endpoints.
4- #[ allow( clippy:: upper_case_acronyms) ]
54#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
65#[ derive( IntoPrimitive , TryFromPrimitive ) ]
76#[ derive( EnumString , EnumIter , Display , IntoStaticStr ) ]
@@ -46,7 +45,6 @@ pub enum RegionalRoute {
4645 ESPORTSEU = 12 ,
4746}
4847///Platform routes for League of Legends (LoL), Teamfight Tactics (TFT), and Legends of Runeterra (LoR).
49- #[ allow( clippy:: upper_case_acronyms) ]
5048#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
5149#[ derive( IntoPrimitive , TryFromPrimitive ) ]
5250#[ derive( EnumString , EnumIter , Display , IntoStaticStr ) ]
@@ -152,49 +150,49 @@ impl PlatformRoute {
152150 /// [`match-v5`](crate::endpoints::MatchV5).
153151 pub fn to_regional ( self ) -> RegionalRoute {
154152 match self {
153+ Self :: BR1 => RegionalRoute :: AMERICAS ,
154+ Self :: PH2 => RegionalRoute :: SEA ,
155155 Self :: NA1 => RegionalRoute :: AMERICAS ,
156+ Self :: EUW1 => RegionalRoute :: EUROPE ,
157+ Self :: JP1 => RegionalRoute :: ASIA ,
156158 Self :: VN2 => RegionalRoute :: SEA ,
159+ Self :: LA2 => RegionalRoute :: AMERICAS ,
157160 Self :: LA1 => RegionalRoute :: AMERICAS ,
158- Self :: ME1 => RegionalRoute :: EUROPE ,
159161 Self :: RU => RegionalRoute :: EUROPE ,
160162 Self :: OC1 => RegionalRoute :: SEA ,
161- Self :: LA2 => RegionalRoute :: AMERICAS ,
162- Self :: EUW1 => RegionalRoute :: EUROPE ,
163- Self :: JP1 => RegionalRoute :: ASIA ,
164163 Self :: KR => RegionalRoute :: ASIA ,
165- Self :: PH2 => RegionalRoute :: SEA ,
166- Self :: SG2 => RegionalRoute :: SEA ,
167- Self :: TW2 => RegionalRoute :: SEA ,
168164 Self :: PBE1 => RegionalRoute :: AMERICAS ,
169- Self :: BR1 => RegionalRoute :: AMERICAS ,
165+ Self :: ME1 => RegionalRoute :: EUROPE ,
170166 Self :: TR1 => RegionalRoute :: EUROPE ,
171167 Self :: TH2 => RegionalRoute :: SEA ,
172168 Self :: EUN1 => RegionalRoute :: EUROPE ,
169+ Self :: TW2 => RegionalRoute :: SEA ,
170+ Self :: SG2 => RegionalRoute :: SEA ,
173171 }
174172 }
175173 /// Converts this [`PlatformRoute`] into its corresponding
176174 /// [`RegionalRoute`] for LoR endpoints such as
177175 /// [`lor-match-v1`](crate::endpoints::LorMatchV1).
178176 pub fn to_regional_lor ( self ) -> RegionalRoute {
179177 match self {
178+ Self :: BR1 => RegionalRoute :: AMERICAS ,
179+ Self :: PH2 => RegionalRoute :: SEA ,
180180 Self :: NA1 => RegionalRoute :: AMERICAS ,
181+ Self :: EUW1 => RegionalRoute :: EUROPE ,
182+ Self :: JP1 => RegionalRoute :: ASIA ,
181183 Self :: VN2 => RegionalRoute :: SEA ,
184+ Self :: LA2 => RegionalRoute :: AMERICAS ,
182185 Self :: LA1 => RegionalRoute :: AMERICAS ,
183- Self :: ME1 => RegionalRoute :: EUROPE ,
184186 Self :: RU => RegionalRoute :: SEA ,
185187 Self :: OC1 => RegionalRoute :: SEA ,
186- Self :: LA2 => RegionalRoute :: AMERICAS ,
187- Self :: EUW1 => RegionalRoute :: EUROPE ,
188- Self :: JP1 => RegionalRoute :: ASIA ,
189188 Self :: KR => RegionalRoute :: ASIA ,
190- Self :: PH2 => RegionalRoute :: SEA ,
191- Self :: SG2 => RegionalRoute :: SEA ,
192- Self :: TW2 => RegionalRoute :: SEA ,
193189 Self :: PBE1 => RegionalRoute :: AMERICAS ,
194- Self :: BR1 => RegionalRoute :: AMERICAS ,
190+ Self :: ME1 => RegionalRoute :: EUROPE ,
195191 Self :: TR1 => RegionalRoute :: SEA ,
196192 Self :: TH2 => RegionalRoute :: SEA ,
197193 Self :: EUN1 => RegionalRoute :: EUROPE ,
194+ Self :: TW2 => RegionalRoute :: SEA ,
195+ Self :: SG2 => RegionalRoute :: SEA ,
198196 }
199197 }
200198 /// Used in the LoL Tournament API. Specifically
@@ -204,24 +202,24 @@ impl PlatformRoute {
204202 /// Returns `None` if the corresponding tournament region is unknown: <https://github.com/MingweiSamuel/riotapi-schema/issues/58>.
205203 pub fn to_tournament_region ( self ) -> Option < TournamentRegion > {
206204 match self {
205+ Self :: BR1 => Some ( TournamentRegion :: BR ) ,
206+ Self :: PH2 => None ,
207207 Self :: NA1 => Some ( TournamentRegion :: NA ) ,
208+ Self :: EUW1 => Some ( TournamentRegion :: EUW ) ,
209+ Self :: JP1 => Some ( TournamentRegion :: JP ) ,
208210 Self :: VN2 => None ,
211+ Self :: LA2 => Some ( TournamentRegion :: LAS ) ,
209212 Self :: LA1 => Some ( TournamentRegion :: LAN ) ,
210- Self :: ME1 => None ,
211213 Self :: RU => None ,
212214 Self :: OC1 => Some ( TournamentRegion :: OCE ) ,
213- Self :: LA2 => Some ( TournamentRegion :: LAS ) ,
214- Self :: EUW1 => Some ( TournamentRegion :: EUW ) ,
215- Self :: JP1 => Some ( TournamentRegion :: JP ) ,
216215 Self :: KR => None ,
217- Self :: PH2 => None ,
218- Self :: SG2 => None ,
219- Self :: TW2 => None ,
220216 Self :: PBE1 => Some ( TournamentRegion :: PBE ) ,
221- Self :: BR1 => Some ( TournamentRegion :: BR ) ,
217+ Self :: ME1 => None ,
222218 Self :: TR1 => Some ( TournamentRegion :: TR ) ,
223219 Self :: TH2 => None ,
224220 Self :: EUN1 => Some ( TournamentRegion :: EUNE ) ,
221+ Self :: TW2 => None ,
222+ Self :: SG2 => None ,
225223 }
226224 }
227225 /// Get the slightly more human-friendly alternate name for this `PlatformRoute`. Specifically
@@ -233,29 +231,28 @@ impl PlatformRoute {
233231 /// back into `PlatformRoute`s.
234232 pub fn as_region_str ( self ) -> & ' static str {
235233 match self {
234+ Self :: BR1 => "BR" ,
235+ Self :: PH2 => "PH" ,
236236 Self :: NA1 => "NA" ,
237+ Self :: EUW1 => "EUW" ,
238+ Self :: JP1 => "JP" ,
237239 Self :: VN2 => "VN" ,
240+ Self :: LA2 => "LAS" ,
238241 Self :: LA1 => "LAN" ,
239- Self :: ME1 => "MENA" ,
240242 Self :: RU => "RU" ,
241243 Self :: OC1 => "OCE" ,
242- Self :: LA2 => "LAS" ,
243- Self :: EUW1 => "EUW" ,
244- Self :: JP1 => "JP" ,
245244 Self :: KR => "KR" ,
246- Self :: PH2 => "PH" ,
247- Self :: SG2 => "SG" ,
248- Self :: TW2 => "TW" ,
249245 Self :: PBE1 => "PBE" ,
250- Self :: BR1 => "BR " ,
246+ Self :: ME1 => "MENA " ,
251247 Self :: TR1 => "TR" ,
252248 Self :: TH2 => "TH" ,
253249 Self :: EUN1 => "EUNE" ,
250+ Self :: TW2 => "TW" ,
251+ Self :: SG2 => "SG" ,
254252 }
255253 }
256254}
257255///Platform routes for Valorant.
258- #[ allow( clippy:: upper_case_acronyms) ]
259256#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
260257#[ derive( IntoPrimitive , TryFromPrimitive ) ]
261258#[ derive( EnumString , EnumIter , Display , IntoStaticStr ) ]
@@ -301,7 +298,6 @@ pub enum ValPlatformRoute {
301298/// Tournament regions for League of Legends (LoL) used in
302299/// [`tournament-stub-v4.registerProviderData`](crate::endpoints::TournamentStubV4::register_provider_data)
303300/// and [`tournament-v4.registerProviderData`](crate::endpoints::TournamentV4::register_provider_data).
304- #[ allow( clippy:: upper_case_acronyms) ]
305301#[ derive( Debug , Clone , Copy , PartialEq , Eq , Hash , PartialOrd , Ord ) ]
306302#[ derive( IntoPrimitive , TryFromPrimitive ) ]
307303#[ derive( EnumString , EnumIter , Display , IntoStaticStr ) ]
0 commit comments