warframe/worldstate/models/
alert.rs

1use warframe_macros::model;
2
3use super::{
4    mission::Mission,
5    reward_type::RewardType,
6};
7
8/// An alert in Warframe
9#[model(endpoint = "/alerts", return_style = Array)]
10pub struct Alert {
11    /// ID of this event
12    pub id: String,
13
14    /// The mission associated with the alert
15    pub mission: Mission,
16
17    /// The reward type of the alert
18    pub reward_types: Vec<RewardType>,
19}
20
21#[cfg(test)]
22mod test_alert {
23    use rstest::rstest;
24    use serde_json::from_str;
25
26    use super::Alert;
27    use crate::worldstate::Queryable;
28
29    type R = <Alert as Queryable>::Return;
30
31    #[rstest]
32    fn test(
33        #[files("src/worldstate/models/fixtures/alert.json")]
34        #[mode = str]
35        alert_en: &str,
36    ) {
37        from_str::<R>(alert_en).unwrap();
38    }
39}