Skip to main content

artifacts/models/
skin_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 SkinSchema {
7    /// The code of the skin. This is the skin's unique identifier.
8    #[serde(rename = "code")]
9    pub code: String,
10    /// Display name of the skin.
11    #[serde(rename = "name")]
12    pub name: String,
13    /// Description of the skin and how to obtain it.
14    #[serde(rename = "description")]
15    pub description: String,
16    /// Whether this skin is available to all players by default.
17    #[serde(rename = "default")]
18    pub default: bool,
19    /// Price in gems to purchase this skin. Null if not purchasable.
20    #[serde(rename = "price", skip_serializing_if = "Option::is_none")]
21    pub price: Option<i32>,
22}
23
24impl SkinSchema {
25    pub fn new(code: String, name: String, description: String, default: bool) -> SkinSchema {
26        SkinSchema {
27            code,
28            name,
29            description,
30            default,
31            price: None,
32        }
33    }
34}