artifacts/models/
effect_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 EffectSchema {
7    /// Name of the effect.
8    #[serde(rename = "name")]
9    pub name: String,
10    /// The code of the effect. This is the effect's unique identifier (ID).
11    #[serde(rename = "code")]
12    pub code: String,
13    /// Description of the effect. This is a brief description of the effect.
14    #[serde(rename = "description")]
15    pub description: String,
16    /// Type of the effect.
17    #[serde(rename = "type")]
18    pub r#type: models::EffectType,
19    /// Subtype of the effect.
20    #[serde(rename = "subtype")]
21    pub subtype: models::EffectSubtype,
22}
23
24impl EffectSchema {
25    pub fn new(
26        name: String,
27        code: String,
28        description: String,
29        r#type: models::EffectType,
30        subtype: models::EffectSubtype,
31    ) -> EffectSchema {
32        EffectSchema {
33            name,
34            code,
35            description,
36            r#type,
37            subtype,
38        }
39    }
40}