artifacts/models/
character_rest_data_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 CharacterRestDataSchema {
7    /// Cooldown details
8    #[serde(rename = "cooldown")]
9    pub cooldown: Box<models::CooldownSchema>,
10    /// The amount of HP restored.
11    #[serde(rename = "hp_restored")]
12    pub hp_restored: i32,
13    /// Character details.
14    #[serde(rename = "character")]
15    pub character: Box<models::CharacterSchema>,
16}
17
18impl CharacterRestDataSchema {
19    pub fn new(
20        cooldown: models::CooldownSchema,
21        hp_restored: i32,
22        character: models::CharacterSchema,
23    ) -> CharacterRestDataSchema {
24        CharacterRestDataSchema {
25            cooldown: Box::new(cooldown),
26            hp_restored,
27            character: Box::new(character),
28        }
29    }
30}
31
32impl crate::traits::GetCooldown for CharacterRestDataSchema {
33    fn get_cooldown(&self) -> &crate::models::CooldownSchema {
34        &self.cooldown
35    }
36}
37
38impl crate::traits::GetCharacter for CharacterRestDataSchema {
39    fn get_character(&self) -> &crate::models::CharacterSchema {
40        &self.character
41    }
42}