artifacts/models/
active_event_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 ActiveEventSchema {
7    /// Name of the event.
8    #[serde(rename = "name")]
9    pub name: String,
10    /// Code of the event.
11    #[serde(rename = "code")]
12    pub code: String,
13    /// Map of the event.
14    #[serde(rename = "map")]
15    pub map: Box<models::MapSchema>,
16    /// Previous map skin.
17    #[serde(rename = "previous_map")]
18    pub previous_map: Box<models::MapSchema>,
19    /// Duration in minutes.
20    #[serde(rename = "duration")]
21    pub duration: i32,
22    /// Expiration datetime.
23    #[serde(rename = "expiration")]
24    pub expiration: String,
25    /// Start datetime.
26    #[serde(rename = "created_at")]
27    pub created_at: String,
28}
29
30impl ActiveEventSchema {
31    pub fn new(
32        name: String,
33        code: String,
34        map: models::MapSchema,
35        previous_map: models::MapSchema,
36        duration: i32,
37        expiration: String,
38        created_at: String,
39    ) -> ActiveEventSchema {
40        ActiveEventSchema {
41            name,
42            code,
43            map: Box::new(map),
44            previous_map: Box::new(previous_map),
45            duration,
46            expiration,
47            created_at,
48        }
49    }
50}