artifacts/models/
cooldown_schema.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct CooldownSchema {
7    /// The total seconds of the cooldown.
8    #[serde(rename = "total_seconds")]
9    pub total_seconds: i32,
10    /// The remaining seconds of the cooldown.
11    #[serde(rename = "remaining_seconds")]
12    pub remaining_seconds: i32,
13    /// The start of the cooldown.
14    #[serde(rename = "started_at")]
15    pub started_at: String,
16    /// The expiration of the cooldown.
17    #[serde(rename = "expiration")]
18    pub expiration: String,
19    /// The reason of the cooldown.
20    #[serde(rename = "reason")]
21    pub reason: models::ActionType,
22}
23
24impl CooldownSchema {
25    pub fn new(
26        total_seconds: i32,
27        remaining_seconds: i32,
28        started_at: String,
29        expiration: String,
30        reason: models::ActionType,
31    ) -> CooldownSchema {
32        CooldownSchema {
33            total_seconds,
34            remaining_seconds,
35            started_at,
36            expiration,
37            reason,
38        }
39    }
40}