artifacts/models/
cooldown_schema.rs1use 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 #[serde(rename = "total_seconds")]
9 pub total_seconds: i32,
10 #[serde(rename = "remaining_seconds")]
12 pub remaining_seconds: i32,
13 #[serde(rename = "started_at")]
15 pub started_at: String,
16 #[serde(rename = "expiration")]
18 pub expiration: String,
19 #[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}