space_traders/models/
cooldown.rs

1//! Generated by: <https://openapi-generator.tech>
2//!
3//! Version of specification: `2.0.0`
4
5use serde::{Deserialize, Serialize};
6
7/// A cooldown is a period of time in which a ship cannot perform certain actions.
8#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
9pub struct Cooldown {
10    /// The symbol of the ship that is on cooldown
11    #[serde(rename = "shipSymbol")]
12    pub ship_symbol: String,
13    /// The total duration of the cooldown in seconds
14    #[serde(rename = "totalSeconds")]
15    pub total_seconds: u32,
16    /// The remaining duration of the cooldown in seconds
17    #[serde(rename = "remainingSeconds")]
18    pub remaining_seconds: u32,
19    /// The date and time when the cooldown expires in ISO 8601 format
20    #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
21    pub expiration: Option<String>,
22}
23
24impl Cooldown {
25    /// Create value with optional fields set to `None`.
26    #[allow(clippy::too_many_arguments)]
27    pub fn new(ship_symbol: String, total_seconds: u32, remaining_seconds: u32) -> Cooldown {
28        Cooldown {
29            ship_symbol,
30            total_seconds,
31            remaining_seconds,
32            expiration: None,
33        }
34    }
35}