warframe_client/models/
invasion.rs

1/*
2 * WarframeStat.us API
3 *
4 * Simple API for data from the game Warframe. [Parser Docs](https://wfcd.github.io/warframe-worldstate-parser/) [Items Types](https://github.com/WFCD/warframe-items/blob/master/index.d.ts) 
5 *
6 * The version of the OpenAPI document: 2.0.8
7 * Contact: tobiah@protonmail.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Invasion {
16    /// unique identifier for this object/event/thing
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// ISO-8601 formatted timestamp for when the event began
20    #[serde(rename = "activation", skip_serializing_if = "Option::is_none")]
21    pub activation: Option<String>,
22    /// A timestamp in ISO 8601 format (YYYY-MM-DDTHH:MM:SSZ) representing a specific point in time. This format is commonly used in APIs to ensure consistent date and time representation. The timestamp is in UTC (Coordinated Universal Time) and does not include any timezone offset. It is used to represent events, deadlines, or any time-related information in a standardized way. Example: \"2023-10-01T12:00:00Z\" represents October 1, 2023, at 12:00 PM UTC. 
23    #[serde(rename = "expiry", skip_serializing_if = "Option::is_none")]
24    pub expiry: Option<String>,
25    #[serde(rename = "attacker", skip_serializing_if = "Option::is_none")]
26    pub attacker: Option<Box<models::InvasionAllOfAttacker>>,
27    #[serde(rename = "attackerReward", skip_serializing_if = "Option::is_none")]
28    pub attacker_reward: Option<Box<models::InvasionAllOfAttackerReward>>,
29    #[serde(rename = "attackingFaction")]
30    pub attacking_faction: String,
31    /// Whether this invasion is \"over\"
32    #[serde(rename = "completed")]
33    pub completed: bool,
34    /// percentage complete as a float value
35    #[serde(rename = "completion")]
36    pub completion: f64,
37    /// How many fights have happened.
38    #[serde(rename = "count")]
39    pub count: f32,
40    #[serde(rename = "defender", skip_serializing_if = "Option::is_none")]
41    pub defender: Option<Box<models::InvasionAllOfDefender>>,
42    #[serde(rename = "defenderReward", skip_serializing_if = "Option::is_none")]
43    pub defender_reward: Option<Box<models::InvasionAllOfDefenderReward>>,
44    #[serde(rename = "defendingFaction")]
45    pub defending_faction: String,
46    /// description of invasion
47    #[serde(rename = "desc")]
48    pub desc: String,
49    /// time string showing approximate time to the end of the invasion
50    #[serde(rename = "eta", skip_serializing_if = "Option::is_none")]
51    pub eta: Option<String>,
52    /// localized Node name
53    #[serde(rename = "node")]
54    pub node: String,
55    /// i18n key for matching node (always english translation)
56    #[serde(rename = "nodeKey", skip_serializing_if = "Option::is_none")]
57    pub node_key: Option<String>,
58    /// How many runs of this mission are needed to qualify for the reward
59    #[serde(rename = "requiredRuns")]
60    pub required_runs: f64,
61    #[serde(rename = "rewardTypes", skip_serializing_if = "Option::is_none")]
62    pub reward_types: Option<Vec<models::RewardType>>,
63    #[serde(rename = "startString", skip_serializing_if = "Option::is_none")]
64    pub start_string: Option<String>,
65    #[serde(rename = "vsInfestation")]
66    pub vs_infestation: bool,
67}
68
69impl Invasion {
70    pub fn new(attacking_faction: String, completed: bool, completion: f64, count: f32, defending_faction: String, desc: String, node: String, required_runs: f64, vs_infestation: bool) -> Invasion {
71        Invasion {
72            id: None,
73            activation: None,
74            expiry: None,
75            attacker: None,
76            attacker_reward: None,
77            attacking_faction,
78            completed,
79            completion,
80            count,
81            defender: None,
82            defender_reward: None,
83            defending_faction,
84            desc,
85            eta: None,
86            node,
87            node_key: None,
88            required_runs,
89            reward_types: None,
90            start_string: None,
91            vs_infestation,
92        }
93    }
94}
95