warframe/worldstate/models/
steel_path.rs

1use warframe_macros::model;
2
3/// An Item in Teshin's Shop
4#[model]
5pub struct SteelPathShopItem {
6    /// The i18n Name of the Item
7    pub name: String,
8
9    /// The amount of Steel Essence this Item costs
10    pub cost: i32,
11}
12
13/// Data about steel path offerings
14#[model(endpoint = "/steelPath", return_style = Object, timed)]
15pub struct SteelPath {
16    /// The current weekly offer
17    #[serde(rename = "currentReward")]
18    pub current_offer: SteelPathShopItem,
19
20    /// The Rotation of Items Teshin offers
21    pub rotation: Vec<SteelPathShopItem>,
22
23    /// Items that are always available
24    pub evergreens: Vec<SteelPathShopItem>,
25}
26
27#[cfg(test)]
28mod test_steel_path {
29    use rstest::rstest;
30    use serde_json::from_str;
31
32    use super::SteelPath;
33    use crate::worldstate::Queryable;
34
35    type R = <SteelPath as Queryable>::Return;
36
37    #[rstest]
38    fn test(
39        #[files("src/worldstate/models/fixtures/steel_path.json")]
40        #[mode = str]
41        steel_path_en: &str,
42    ) {
43        from_str::<R>(steel_path_en).unwrap();
44    }
45}