artifacts/models/
badge_condition_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 BadgeConditionSchema {
7    /// Code of the condition.
8    #[serde(rename = "code")]
9    pub code: String,
10    /// Quantity of the condition (if any).
11    #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")]
12    pub quantity: Option<i32>,
13}
14
15impl BadgeConditionSchema {
16    pub fn new(code: String) -> BadgeConditionSchema {
17        BadgeConditionSchema {
18            code,
19            quantity: None,
20        }
21    }
22}