// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: actor.rpg.stats
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;

#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::actor_rpg::stats;
/// The six ability scores (1-30 per SRD)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Abilities<'a> {
    ///Charisma
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cha: Option<i64>,
    ///Constitution
    #[serde(skip_serializing_if = "Option::is_none")]
    pub con: Option<i64>,
    ///Dexterity
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dex: Option<i64>,
    ///Intelligence
    #[serde(skip_serializing_if = "Option::is_none")]
    pub int: Option<i64>,
    ///Strength
    #[serde(skip_serializing_if = "Option::is_none")]
    pub str: Option<i64>,
    ///Wisdom
    #[serde(skip_serializing_if = "Option::is_none")]
    pub wis: Option<i64>,
}

/// An attack action

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Attack<'a> {
    ///Attack bonus (e.g., +5)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub bonus: Option<CowStr<'a>>,
    ///Damage dice (e.g., 1d8)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub damage: Option<CowStr<'a>>,
    ///Damage bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub damage_bonus: Option<i64>,
    ///Damage type
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub damage_type: Option<CowStr<'a>>,
    ///Attack name
    #[serde(borrow)]
    pub name: CowStr<'a>,
}

/// Currency

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Coinage<'a> {
    ///Copper pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cp: Option<i64>,
    ///Electrum pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ep: Option<i64>,
    ///Gold pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gp: Option<i64>,
    ///Platinum pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pp: Option<i64>,
    ///Silver pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sp: Option<i64>,
}

/// Combat and defensive stats

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Combat<'a> {
    ///Armor Class
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ac: Option<i64>,
    ///Hit dice (e.g., 5d10)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub hit_dice: Option<CowStr<'a>>,
    ///Hit dice expended
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hit_dice_used: Option<i64>,
    ///Initiative modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub initiative: Option<i64>,
    ///Speed in feet
    #[serde(skip_serializing_if = "Option::is_none")]
    pub speed: Option<i64>,
}

/// Status conditions and effects

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Conditions<'a> {
    ///Death saving throw progress
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub death_saves: Option<stats::DeathSaves<'a>>,
    ///Exhaustion level (0-6)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub exhaustion: Option<i64>,
    ///Has inspiration
    #[serde(skip_serializing_if = "Option::is_none")]
    pub inspiration: Option<bool>,
}

/// A custom stat

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct CustomStat<'a> {
    ///Category (optional)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub category: Option<CowStr<'a>>,
    ///Maximum (optional)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max: Option<i64>,
    ///Minimum (optional)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub min: Option<i64>,
    ///Stat name
    #[serde(borrow)]
    pub name: CowStr<'a>,
    ///Value
    pub value: i64,
}

/// User-defined custom stat system

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct CustomStats<'a> {
    ///Custom stat entries
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub stats: Option<Vec<stats::CustomStat<'a>>>,
    ///System name
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub system_name: Option<CowStr<'a>>,
    ///Version
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub system_version: Option<CowStr<'a>>,
}

/// DCC ability scores (3-18 standard, can be modified by corruption/spellburn)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccAbilities<'a> {
    ///Agility
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agi: Option<i64>,
    ///Agility base (before spellburn)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agi_base: Option<i64>,
    ///Intelligence
    #[serde(skip_serializing_if = "Option::is_none")]
    pub int: Option<i64>,
    ///Luck (can be permanently burned)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub luk: Option<i64>,
    ///Personality
    #[serde(skip_serializing_if = "Option::is_none")]
    pub per: Option<i64>,
    ///Stamina
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sta: Option<i64>,
    ///Stamina base (before spellburn)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sta_base: Option<i64>,
    ///Strength
    #[serde(skip_serializing_if = "Option::is_none")]
    pub str: Option<i64>,
    ///Strength base (before spellburn)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub str_base: Option<i64>,
}

/// A weapon attack (includes deed die for warriors)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccAttack<'a> {
    ///Attack modifier (e.g., +2, d16+2 for deed die)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub attack_mod: Option<CowStr<'a>>,
    ///Damage dice (e.g., 1d8+2, 1d6+d3)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub damage: Option<CowStr<'a>>,
    ///Damage bonus (e.g., +2, +d3 for deed die)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub damage_bonus: Option<CowStr<'a>>,
    ///Weapon name
    #[serde(borrow)]
    pub name: CowStr<'a>,
    ///Special properties (backstab, trained weapon, etc.)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub notes: Option<CowStr<'a>>,
    ///Range (melee or distance)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub range: Option<CowStr<'a>>,
    ///Attack type (melee, ranged, etc.)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub r#type: Option<CowStr<'a>>,
}

/// Cleric spellcasting features

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccCleric<'a> {
    ///Deity or supernatural patron
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub deity: Option<CowStr<'a>>,
    ///Current disapproval range (starts at 1, accumulates)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disapproval_range: Option<i64>,
    ///Deity-specific disapproval table if any
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub disapproval_table: Option<CowStr<'a>>,
    ///Holy symbol description
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub holy_symbol: Option<CowStr<'a>>,
    ///Known cleric spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub known_spells: Option<Vec<stats::DccClericSpell<'a>>>,
    ///Lay on hands die (e.g., d14, d16)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub lay_on_hands_die: Option<CowStr<'a>>,
    ///Highest spell level accessible
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_spell_level: Option<i64>,
    ///Spell check modifier (PER mod + level)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub spell_check_mod: Option<i64>,
    ///Turn unholy die (e.g., d14, d16)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub turn_unholy_die: Option<CowStr<'a>>,
    ///Serves a Chaotic deity (unholy instead of holy)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub unholy: Option<bool>,
}

/// A cleric spell

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct DccClericSpell<'a> {
    ///Spell level
    pub level: i64,
    ///Spell name
    #[serde(borrow)]
    pub name: CowStr<'a>,
    ///Additional spell notes
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub notes: Option<CowStr<'a>>,
    ///Casting may cause additional disapproval
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sinful: Option<bool>,
}

/// DCC uses cp, sp, gp (10cp = 1sp, 10sp = 1gp)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccCoinage<'a> {
    ///Copper pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cp: Option<i64>,
    ///Gold pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gp: Option<i64>,
    ///Silver pieces
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sp: Option<i64>,
}

/// Combat statistics

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccCombat<'a> {
    ///Armor Class (10 + armor + AGI mod + shield)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ac: Option<i64>,
    ///Primary action die (e.g., d20, d20+d14)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub action_die: Option<CowStr<'a>>,
    ///Base attack modifier (level-based for non-warriors)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub attack_mod: Option<i64>,
    ///Critical hit die (e.g., d8, d12, d14)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub crit_die: Option<CowStr<'a>>,
    ///Critical hit table (I, II, III, IV, V)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub crit_table: Option<CowStr<'a>>,
    ///Fumble die (typically d4 for 0-level, varies by armor)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub fumble_die: Option<CowStr<'a>>,
    ///Initiative modifier (AGI mod)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub initiative: Option<i64>,
    ///Speed in feet (typically 30, Dwarves 20)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub speed: Option<i64>,
}

/// A corruption effect from failed spell checks

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccCorruption<'a> {
    ///Description of the corruption
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub effect: Option<CowStr<'a>>,
    ///Whether this corruption is permanent
    #[serde(skip_serializing_if = "Option::is_none")]
    pub permanent: Option<bool>,
    ///What spell caused this corruption
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub source: Option<CowStr<'a>>,
    ///Corruption severity (minor, major, greater)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub r#type: Option<CowStr<'a>>,
}

/// Equipment and inventory

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccEquipment<'a> {
    ///Armor worn (affects fumble die)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub armor: Option<CowStr<'a>>,
    ///Armor check penalty (affects skills)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub armor_check_penalty: Option<i64>,
    ///Other equipment
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub gear: Option<CowStr<'a>>,
    ///Shield (if any)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub shield: Option<CowStr<'a>>,
    ///Trade goods from occupation
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub trade_goods: Option<CowStr<'a>>,
    ///Valuables and treasure
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub treasure: Option<CowStr<'a>>,
    ///Weapons carried
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub weapons: Option<CowStr<'a>>,
}

/// Halfling class features

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccHalfling<'a> {
    ///Can spend luck to aid nearby allies
    #[serde(skip_serializing_if = "Option::is_none")]
    pub good_luck_charm: Option<bool>,
    ///Infravision range in feet (30)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub infravision: Option<i64>,
    ///Total luck points spent helping allies
    #[serde(skip_serializing_if = "Option::is_none")]
    pub luck_spent_on_allies: Option<i64>,
    ///Weapon type luck modifier applies to
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub lucky_weapon: Option<CowStr<'a>>,
    ///Bonus to sneak/hide when in natural environment
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sneak_and_hide: Option<i64>,
    ///Can dual-wield without penalty
    #[serde(skip_serializing_if = "Option::is_none")]
    pub two_weapon_fighting: Option<bool>,
}

/// Hit points (0-level characters use 1d4 + STA mod)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccHp<'a> {
    ///Current HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub current: Option<i64>,
    ///Maximum HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max: Option<i64>,
}

/// DCC character identity and progression

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccIdentity<'a> {
    ///Alignment (Lawful, Neutral, Chaotic)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub alignment: Option<CowStr<'a>>,
    ///Class (Warrior, Wizard, Cleric, Thief, Elf, Dwarf, Halfling)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub class: Option<CowStr<'a>>,
    ///Character level (0 for funnel characters)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub level: Option<i64>,
    ///0-level occupation (e.g., Blacksmith, Farmer)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub occupation: Option<CowStr<'a>>,
    ///Level title (e.g., Squire, Cutpurse, Acolyte)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub title: Option<CowStr<'a>>,
    ///Experience points
    #[serde(skip_serializing_if = "Option::is_none")]
    pub xp: Option<i64>,
}

/// Birth augur and luck mechanics

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccLuck<'a> {
    ///Birth augur name (e.g., Harsh Winter, The Bull, Fortunate Date)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub birth_augur: Option<CowStr<'a>>,
    ///What the luck modifier applies to
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub birth_augur_effect: Option<CowStr<'a>>,
    ///Weapon type that luck applies to (Dwarves/Halflings)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub lucky_weapon: Option<CowStr<'a>>,
    ///Starting luck score (for tracking burned luck)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub starting_luck: Option<i64>,
}

/// DCC saving throws (3 saves, not 6)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccSaves<'a> {
    ///Fortitude save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub fort: Option<i64>,
    ///Reflex save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#ref: Option<i64>,
    ///Willpower save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub will: Option<i64>,
}

/// Current spellburn (temporary ability score sacrifice)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccSpellburn<'a> {
    ///Agility points currently burned
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agi_burned: Option<i64>,
    ///Points recovered per day
    #[serde(skip_serializing_if = "Option::is_none")]
    pub recovery_rate: Option<i64>,
    ///Stamina points currently burned
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sta_burned: Option<i64>,
    ///Strength points currently burned
    #[serde(skip_serializing_if = "Option::is_none")]
    pub str_burned: Option<i64>,
}

/// Dungeon Crawl Classics RPG character sheet. Supports 0-level funnel characters through 10th level.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccStats<'a> {
    ///The six ability scores (STR, AGI, STA, INT, PER, LUK)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub abilities: Option<stats::DccAbilities<'a>>,
    ///Notes about special abilities, class features, and racial traits
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub abilities_notes: Option<CowStr<'a>>,
    ///Weapon attacks
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub attacks: Option<Vec<stats::DccAttack<'a>>>,
    ///Cleric spellcasting (disapproval, turn unholy, lay on hands)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cleric: Option<stats::DccCleric<'a>>,
    ///Currency (cp, sp, gp)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub coinage: Option<stats::DccCoinage<'a>>,
    ///Combat stats (AC, speed, action die, initiative, crit die/table)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub combat: Option<stats::DccCombat<'a>>,
    ///Gear, treasure, and trade goods
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub equipment: Option<stats::DccEquipment<'a>>,
    ///Halfling luck-sharing and dual wielding
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub halfling: Option<stats::DccHalfling<'a>>,
    ///Hit points
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub hp: Option<stats::DccHp<'a>>,
    ///Character identity (occupation, class, level, alignment)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub identity: Option<stats::DccIdentity<'a>>,
    ///Languages known
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub languages: Option<CowStr<'a>>,
    ///Birth augur and luck tracking
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub luck: Option<stats::DccLuck<'a>>,
    ///Character notes, backstory, and special abilities
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub notes: Option<CowStr<'a>>,
    ///Saving throws (Reflex, Fortitude, Willpower)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub saves: Option<stats::DccSaves<'a>>,
    ///Thief skills and abilities
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub thief: Option<stats::DccThief<'a>>,
    ///Warrior/Dwarf class features (deed die, mighty deeds)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub warrior: Option<stats::DccWarrior<'a>>,
    ///Wizard/Elf spellcasting (spellburn, corruption, mercurial magic)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub wizard: Option<stats::DccWizard<'a>>,
}

/// Thief class features and skills

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccThief<'a> {
    ///Alignment (affects some skill targets)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub alignment: Option<CowStr<'a>>,
    ///Backstab damage die level (+1, +2, etc.)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub backstab: Option<i64>,
    ///Weapon type that luck applies to (one type only)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub lucky_weapon: Option<CowStr<'a>>,
    ///Thief skill modifiers
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub skills: Option<stats::DccThiefSkills<'a>>,
}

/// Thief skill bonuses (roll d20 + skill vs target)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccThiefSkills<'a> {
    ///Backstab attack bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub backstab: Option<i64>,
    ///Cast spell from scroll bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cast_spell_from_scroll: Option<i64>,
    ///Climb sheer surfaces bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub climb_sheer_surfaces: Option<i64>,
    ///Disable trap bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disable_trap: Option<i64>,
    ///Disguise self bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub disguise_self: Option<i64>,
    ///Find trap bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub find_trap: Option<i64>,
    ///Forge document bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub forge_document: Option<i64>,
    ///Handle poison bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub handle_poison: Option<i64>,
    ///Hide in shadows bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hide_in_shadows: Option<i64>,
    ///Pick lock bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pick_lock: Option<i64>,
    ///Pick pocket bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pick_pocket: Option<i64>,
    ///Read languages bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub read_languages: Option<i64>,
    ///Sneak silently bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sneak_silently: Option<i64>,
}

/// Warrior and Dwarf class features

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccWarrior<'a> {
    ///Current deed die (d3, d4, d5, d6, d7, d8, d10+d3, etc.)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub deed_die: Option<CowStr<'a>>,
    ///Infravision range in feet (Dwarves: 60)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub infravision: Option<i64>,
    ///Weapon type luck modifier applies to
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub lucky_weapon: Option<CowStr<'a>>,
    ///Signature mighty deeds of arms
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub mighty_deeds: Option<Vec<CowStr<'a>>>,
    ///Can use shield bash (Dwarves)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub shield_bash: Option<bool>,
    ///Can smell gold/gems (Dwarves)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub smell_gold: Option<bool>,
    ///Underground detection bonus (Dwarves: equal to level)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub underground_skills: Option<i64>,
}

/// Wizard and Elf spellcasting features

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DccWizard<'a> {
    ///Corruption effects suffered (structured)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub corruption: Option<Vec<stats::DccCorruption<'a>>>,
    ///Corruption effects as free-form text
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub corruption_text: Option<CowStr<'a>>,
    ///Known spells with mercurial magic effects
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub known_spells: Option<Vec<stats::DccWizardSpell<'a>>>,
    ///Highest spell level accessible
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_spell_level: Option<i64>,
    ///Supernatural patron (if any)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub patron: Option<CowStr<'a>>,
    ///Patron bond description and effects
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub patron_bond: Option<CowStr<'a>>,
    ///Spell check modifier (INT mod + level)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub spell_check_mod: Option<i64>,
    ///Current spellburn status
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub spellburn: Option<stats::DccSpellburn<'a>>,
}

/// A wizard spell with mercurial magic effect

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct DccWizardSpell<'a> {
    ///Spell level
    pub level: i64,
    ///Spell is currently lost (must be re-learned)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub lost: Option<bool>,
    ///Unique mercurial magic effect (d100 roll result)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub mercurial_magic: Option<CowStr<'a>>,
    ///The d100 roll for mercurial magic
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mercurial_roll: Option<i64>,
    ///Spell name
    #[serde(borrow)]
    pub name: CowStr<'a>,
    ///Additional spell notes
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub notes: Option<CowStr<'a>>,
}

/// Death saving throw successes and failures

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeathSaves<'a> {
    ///Failures (0-3)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub failures: Option<i64>,
    ///Successes (0-3)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub successes: Option<i64>,
}

/// D&D 5e character sheet. All sub-objects are optional.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DndStats<'a> {
    ///The six ability scores (STR, DEX, CON, INT, WIS, CHA)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub abilities: Option<stats::Abilities<'a>>,
    ///Attack actions
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub attacks: Option<Vec<stats::Attack<'a>>>,
    ///Currency (cp, sp, ep, gp, pp)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub coinage: Option<stats::Coinage<'a>>,
    ///Combat stats (AC, speed, initiative, hit dice)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub combat: Option<stats::Combat<'a>>,
    ///Status conditions (inspiration, exhaustion, death saves)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub conditions: Option<stats::Conditions<'a>>,
    ///Gear and inventory
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub equipment: Option<stats::Equipment<'a>>,
    ///Class features, racial traits, and feats
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub features: Option<CowStr<'a>>,
    ///Hit points (current, max, temp)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub hp: Option<stats::Hp<'a>>,
    ///Character identity (race, class, level, background)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub identity: Option<stats::Identity<'a>>,
    ///Languages known
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub languages: Option<CowStr<'a>>,
    ///Passive scores (Perception, Investigation, Insight)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub passives: Option<stats::Passives<'a>>,
    ///Traits, ideals, bonds, flaws, backstory
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub personality: Option<stats::Personality<'a>>,
    ///Armor, weapon, and tool proficiencies
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub proficiencies: Option<CowStr<'a>>,
    ///Saving throw modifiers
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub saves: Option<stats::Saves<'a>>,
    ///Skill modifiers
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub skills: Option<stats::Skills<'a>>,
    ///Spellcasting details (for casters)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub spellcasting: Option<stats::Spellcasting<'a>>,
}

/// Gear and inventory

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Equipment<'a> {
    ///Armor
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub armor: Option<CowStr<'a>>,
    ///Other equipment
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub gear: Option<CowStr<'a>>,
    ///Valuables and treasure
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub treasure: Option<CowStr<'a>>,
    ///Weapons
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub weapons: Option<CowStr<'a>>,
}

/// Hit point tracking

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Hp<'a> {
    ///Current HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub current: Option<i64>,
    ///Maximum HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max: Option<i64>,
    ///Temporary HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub temp: Option<i64>,
}

/// Character identity and progression

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Identity<'a> {
    ///Alignment (e.g., Lawful Good)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub alignment: Option<CowStr<'a>>,
    ///Background (e.g., Soldier, Sage)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub background: Option<CowStr<'a>>,
    ///Class and subclass (e.g., Fighter (Champion))
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub class: Option<CowStr<'a>>,
    ///Character level
    #[serde(skip_serializing_if = "Option::is_none")]
    pub level: Option<i64>,
    ///Proficiency bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub proficiency: Option<i64>,
    ///Race (e.g., Human, Elf, Dwarf)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub race: Option<CowStr<'a>>,
    ///Experience points
    #[serde(skip_serializing_if = "Option::is_none")]
    pub xp: Option<i64>,
}

/// A user's RPG character statistics. One record per user (rkey: self).

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Stats<'a> {
    ///Timestamp when this record was created
    pub created_at: Datetime,
    ///User-defined custom stat system
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub custom: Option<stats::CustomStats<'a>>,
    ///Dungeon Crawl Classics RPG character sheet
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub dcc: Option<stats::DccStats<'a>>,
    ///Dungeons & Dragons 5th Edition character sheet
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub dnd: Option<stats::DndStats<'a>>,
    ///Reverie House philosophical alignment
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub reverie: Option<stats::ReverieStats<'a>>,
    ///RPG Maker MZ engine character parameters
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub rmmz: Option<stats::RmmzStats<'a>>,
    ///Timestamp when this record was last modified
    #[serde(skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<Datetime>,
}

/// Typed wrapper for GetRecord response with this collection's record type.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct StatsGetRecordOutput<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cid: Option<Cid<'a>>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(borrow)]
    pub value: Stats<'a>,
}

/// Passive scores (10 + skill modifier)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Passives<'a> {
    ///Passive Insight
    #[serde(skip_serializing_if = "Option::is_none")]
    pub insight: Option<i64>,
    ///Passive Investigation
    #[serde(skip_serializing_if = "Option::is_none")]
    pub investigation: Option<i64>,
    ///Passive Perception
    #[serde(skip_serializing_if = "Option::is_none")]
    pub perception: Option<i64>,
}

/// Personality and backstory

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Personality<'a> {
    ///Backstory
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub backstory: Option<CowStr<'a>>,
    ///Bonds
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub bonds: Option<CowStr<'a>>,
    ///Flaws
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub flaws: Option<CowStr<'a>>,
    ///Ideals
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub ideals: Option<CowStr<'a>>,
    ///Personality traits
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub traits: Option<CowStr<'a>>,
}

/// Reverie House philosophical alignment

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ReverieStats<'a> {
    ///Authority (0-100)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub authority: Option<i64>,
    ///Entropy (0-100)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub entropy: Option<i64>,
    ///Liberty (0-100)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub liberty: Option<i64>,
    ///Oblivion (0-100)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub oblivion: Option<i64>,
    ///Philosophical octant
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub octant: Option<ReverieStatsOctant<'a>>,
    ///Receptive (0-100)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub receptive: Option<i64>,
    ///Skeptic (0-100)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub skeptic: Option<i64>,
}

/// Philosophical octant

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReverieStatsOctant<'a> {
    Adaptive,
    Chaotic,
    Prepared,
    Intended,
    Contented,
    Assertive,
    Ordered,
    Guarded,
    Equilibrium,
    Singling,
    Confused,
    Other(CowStr<'a>),
}

impl<'a> ReverieStatsOctant<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Adaptive => "adaptive",
            Self::Chaotic => "chaotic",
            Self::Prepared => "prepared",
            Self::Intended => "intended",
            Self::Contented => "contented",
            Self::Assertive => "assertive",
            Self::Ordered => "ordered",
            Self::Guarded => "guarded",
            Self::Equilibrium => "equilibrium",
            Self::Singling => "singling",
            Self::Confused => "confused",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ReverieStatsOctant<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "adaptive" => Self::Adaptive,
            "chaotic" => Self::Chaotic,
            "prepared" => Self::Prepared,
            "intended" => Self::Intended,
            "contented" => Self::Contented,
            "assertive" => Self::Assertive,
            "ordered" => Self::Ordered,
            "guarded" => Self::Guarded,
            "equilibrium" => Self::Equilibrium,
            "singling" => Self::Singling,
            "confused" => Self::Confused,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ReverieStatsOctant<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "adaptive" => Self::Adaptive,
            "chaotic" => Self::Chaotic,
            "prepared" => Self::Prepared,
            "intended" => Self::Intended,
            "contented" => Self::Contented,
            "assertive" => Self::Assertive,
            "ordered" => Self::Ordered,
            "guarded" => Self::Guarded,
            "equilibrium" => Self::Equilibrium,
            "singling" => Self::Singling,
            "confused" => Self::Confused,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ReverieStatsOctant<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ReverieStatsOctant<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ReverieStatsOctant<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ReverieStatsOctant<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ReverieStatsOctant<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ReverieStatsOctant<'_> {
    type Output = ReverieStatsOctant<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            ReverieStatsOctant::Adaptive => ReverieStatsOctant::Adaptive,
            ReverieStatsOctant::Chaotic => ReverieStatsOctant::Chaotic,
            ReverieStatsOctant::Prepared => ReverieStatsOctant::Prepared,
            ReverieStatsOctant::Intended => ReverieStatsOctant::Intended,
            ReverieStatsOctant::Contented => ReverieStatsOctant::Contented,
            ReverieStatsOctant::Assertive => ReverieStatsOctant::Assertive,
            ReverieStatsOctant::Ordered => ReverieStatsOctant::Ordered,
            ReverieStatsOctant::Guarded => ReverieStatsOctant::Guarded,
            ReverieStatsOctant::Equilibrium => ReverieStatsOctant::Equilibrium,
            ReverieStatsOctant::Singling => ReverieStatsOctant::Singling,
            ReverieStatsOctant::Confused => ReverieStatsOctant::Confused,
            ReverieStatsOctant::Other(v) => ReverieStatsOctant::Other(v.into_static()),
        }
    }
}

/// RPG Maker MZ character parameters

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct RmmzStats<'a> {
    ///Agility
    #[serde(skip_serializing_if = "Option::is_none")]
    pub agi: Option<i64>,
    ///Attack
    #[serde(skip_serializing_if = "Option::is_none")]
    pub atk: Option<i64>,
    ///Class
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub class: Option<CowStr<'a>>,
    ///Critical %
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cri: Option<i64>,
    ///Defense
    #[serde(skip_serializing_if = "Option::is_none")]
    pub def: Option<i64>,
    ///Evasion %
    #[serde(skip_serializing_if = "Option::is_none")]
    pub eva: Option<i64>,
    ///Hit Rate %
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hit: Option<i64>,
    ///Current HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub hp: Option<i64>,
    ///Level
    #[serde(skip_serializing_if = "Option::is_none")]
    pub level: Option<i64>,
    ///Luck
    #[serde(skip_serializing_if = "Option::is_none")]
    pub luk: Option<i64>,
    ///Magic Attack
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mat: Option<i64>,
    ///Max HP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_hp: Option<i64>,
    ///Max MP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_mp: Option<i64>,
    ///Max TP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub max_tp: Option<i64>,
    ///Magic Defense
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mdf: Option<i64>,
    ///Current MP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mp: Option<i64>,
    ///Current TP
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tp: Option<i64>,
    ///Experience
    #[serde(skip_serializing_if = "Option::is_none")]
    pub xp: Option<i64>,
}

/// Saving throw modifiers (actual values, not proficiency flags)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Saves<'a> {
    ///Charisma save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cha: Option<i64>,
    ///Constitution save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub con: Option<i64>,
    ///Dexterity save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dex: Option<i64>,
    ///Intelligence save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub int: Option<i64>,
    ///Strength save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub str: Option<i64>,
    ///Wisdom save modifier
    #[serde(skip_serializing_if = "Option::is_none")]
    pub wis: Option<i64>,
}

/// Skill modifiers (actual values, not proficiency flags)

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Skills<'a> {
    ///Acrobatics (DEX)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub acrobatics: Option<i64>,
    ///Animal Handling (WIS)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub animal_handling: Option<i64>,
    ///Arcana (INT)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub arcana: Option<i64>,
    ///Athletics (STR)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub athletics: Option<i64>,
    ///Deception (CHA)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub deception: Option<i64>,
    ///History (INT)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub history: Option<i64>,
    ///Insight (WIS)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub insight: Option<i64>,
    ///Intimidation (CHA)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub intimidation: Option<i64>,
    ///Investigation (INT)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub investigation: Option<i64>,
    ///Medicine (WIS)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub medicine: Option<i64>,
    ///Nature (INT)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub nature: Option<i64>,
    ///Perception (WIS)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub perception: Option<i64>,
    ///Performance (CHA)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub performance: Option<i64>,
    ///Persuasion (CHA)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub persuasion: Option<i64>,
    ///Religion (INT)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub religion: Option<i64>,
    ///Sleight of Hand (DEX)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sleight_of_hand: Option<i64>,
    ///Stealth (DEX)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub stealth: Option<i64>,
    ///Survival (WIS)
    #[serde(skip_serializing_if = "Option::is_none")]
    pub survival: Option<i64>,
}

/// Spells organized by level

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct SpellList<'a> {
    ///Cantrips (at-will)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cantrips: Option<Vec<CowStr<'a>>>,
    ///1st-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l1: Option<Vec<CowStr<'a>>>,
    ///2nd-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l2: Option<Vec<CowStr<'a>>>,
    ///3rd-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l3: Option<Vec<CowStr<'a>>>,
    ///4th-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l4: Option<Vec<CowStr<'a>>>,
    ///5th-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l5: Option<Vec<CowStr<'a>>>,
    ///6th-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l6: Option<Vec<CowStr<'a>>>,
    ///7th-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l7: Option<Vec<CowStr<'a>>>,
    ///8th-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l8: Option<Vec<CowStr<'a>>>,
    ///9th-level spells
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub l9: Option<Vec<CowStr<'a>>>,
}

/// Spellcasting details

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Spellcasting<'a> {
    ///Spellcasting ability (INT, WIS, CHA)
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub ability: Option<CowStr<'a>>,
    ///Spell attack bonus
    #[serde(skip_serializing_if = "Option::is_none")]
    pub attack: Option<i64>,
    ///Spell save DC
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dc: Option<i64>,
    ///Spell slots by level
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub slots: Option<Vec<stats::Spellslot<'a>>>,
    ///Known/prepared spells by level
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub spells: Option<stats::SpellList<'a>>,
}

/// Spell slot entry

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Spellslot<'a> {
    ///Spell level
    pub level: i64,
    ///Total slots
    pub total: i64,
    ///Slots used
    #[serde(skip_serializing_if = "Option::is_none")]
    pub used: Option<i64>,
}

impl<'a> Stats<'a> {
    pub fn uri(
        uri: impl Into<CowStr<'a>>,
    ) -> Result<RecordUri<'a, StatsRecord>, UriError> {
        RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
    }
}

impl<'a> LexiconSchema for Abilities<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "abilities"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.cha {
            if *value > 30i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("cha"),
                    max: 30i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.cha {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("cha"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.con {
            if *value > 30i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("con"),
                    max: 30i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.con {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("con"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.dex {
            if *value > 30i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("dex"),
                    max: 30i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.dex {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("dex"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.int {
            if *value > 30i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("int"),
                    max: 30i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.int {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("int"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str {
            if *value > 30i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("str"),
                    max: 30i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("str"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.wis {
            if *value > 30i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("wis"),
                    max: 30i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.wis {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("wis"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Attack<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "attack"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.bonus {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("bonus"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.damage {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("damage"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.damage_type {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("damage_type"),
                    max: 30usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Coinage<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "coinage"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.cp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("cp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.ep {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("ep"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.gp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("gp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.pp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("pp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("sp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Combat<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "combat"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.ac {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("ac"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.hit_dice {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("hit_dice"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.hit_dice_used {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("hit_dice_used"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.speed {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("speed"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Conditions<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "conditions"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.exhaustion {
            if *value > 6i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("exhaustion"),
                    max: 6i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.exhaustion {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("exhaustion"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for CustomStat<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "customStat"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.category {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 50usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("category"),
                    max: 50usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 50usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 50usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for CustomStats<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "customStats"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.system_name {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("system_name"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.system_version {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 50usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("system_version"),
                    max: 50usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccAbilities<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccAbilities"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.agi {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("agi"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.agi {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("agi"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.agi_base {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("agi_base"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.agi_base {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("agi_base"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.int {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("int"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.int {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("int"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.luk {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("luk"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.luk {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("luk"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.per {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("per"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.per {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("per"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sta {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("sta"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sta {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("sta"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sta_base {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("sta_base"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sta_base {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("sta_base"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("str"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("str"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str_base {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("str_base"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str_base {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("str_base"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccAttack<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccAttack"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.attack_mod {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("attack_mod"),
                    max: 30usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.damage {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("damage"),
                    max: 30usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.damage_bonus {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("damage_bonus"),
                    max: 30usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        {
            let value = &self.name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.notes {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 200usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("notes"),
                    max: 200usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.range {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("range"),
                    max: 30usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.r#type {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("type"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccCleric<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccCleric"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.deity {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("deity"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.disapproval_range {
            if *value > 20i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("disapproval_range"),
                    max: 20i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.disapproval_range {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("disapproval_range"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.disapproval_table {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("disapproval_table"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.holy_symbol {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("holy_symbol"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.known_spells {
            #[allow(unused_comparisons)]
            if value.len() > 50usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("known_spells"),
                    max: 50usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.lay_on_hands_die {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("lay_on_hands_die"),
                    max: 10usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.max_spell_level {
            if *value > 5i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("max_spell_level"),
                    max: 5i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max_spell_level {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max_spell_level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.turn_unholy_die {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("turn_unholy_die"),
                    max: 10usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccClericSpell<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccClericSpell"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.level;
            if *value > 5i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("level"),
                    max: 5i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.level;
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.notes {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("notes"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccCoinage<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccCoinage"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.cp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("cp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.gp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("gp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("sp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccCombat<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccCombat"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.ac {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("ac"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.action_die {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("action_die"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.crit_die {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("crit_die"),
                    max: 10usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.crit_table {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("crit_table"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.fumble_die {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("fumble_die"),
                    max: 10usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.speed {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("speed"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccCorruption<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccCorruption"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.effect {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("effect"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.source {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("source"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.r#type {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("type"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccEquipment<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccEquipment"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.armor {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 200usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("armor"),
                    max: 200usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.armor_check_penalty {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("armor_check_penalty"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.gear {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("gear"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.shield {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("shield"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.trade_goods {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("trade_goods"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.treasure {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("treasure"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.weapons {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("weapons"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccHalfling<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccHalfling"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.infravision {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("infravision"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.luck_spent_on_allies {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("luck_spent_on_allies"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.lucky_weapon {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("lucky_weapon"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccHp<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccHp"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.current {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("current"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccIdentity<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccIdentity"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.alignment {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("alignment"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.class {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("class"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.level {
            if *value > 10i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("level"),
                    max: 10i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.level {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("level"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.occupation {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("occupation"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.title {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("title"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.xp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("xp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccLuck<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccLuck"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.birth_augur {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("birth_augur"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.birth_augur_effect {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 200usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("birth_augur_effect"),
                    max: 200usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.lucky_weapon {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("lucky_weapon"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.starting_luck {
            if *value > 24i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("starting_luck"),
                    max: 24i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.starting_luck {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("starting_luck"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccSaves<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccSaves"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for DccSpellburn<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccSpellburn"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.agi_burned {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("agi_burned"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.recovery_rate {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("recovery_rate"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.sta_burned {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("sta_burned"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.str_burned {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("str_burned"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccStats<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccStats"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.abilities_notes {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("abilities_notes"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.attacks {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("attacks"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.languages {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("languages"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.notes {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 5000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("notes"),
                    max: 5000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccThief<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccThief"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.alignment {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("alignment"),
                    max: 20usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.backstab {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("backstab"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.lucky_weapon {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("lucky_weapon"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccThiefSkills<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccThiefSkills"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for DccWarrior<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccWarrior"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.deed_die {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 10usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("deed_die"),
                    max: 10usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.infravision {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("infravision"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.lucky_weapon {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("lucky_weapon"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.mighty_deeds {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("mighty_deeds"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.underground_skills {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("underground_skills"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccWizard<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccWizard"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.corruption {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("corruption"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.corruption_text {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("corruption_text"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.known_spells {
            #[allow(unused_comparisons)]
            if value.len() > 50usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("known_spells"),
                    max: 50usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.max_spell_level {
            if *value > 5i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("max_spell_level"),
                    max: 5i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max_spell_level {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max_spell_level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.patron {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("patron"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.patron_bond {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("patron_bond"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DccWizardSpell<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dccWizardSpell"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.level;
            if *value > 5i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("level"),
                    max: 5i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.level;
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.mercurial_magic {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("mercurial_magic"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.mercurial_roll {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("mercurial_roll"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.mercurial_roll {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("mercurial_roll"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.name;
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("name"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.notes {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("notes"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DeathSaves<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "deathSaves"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.failures {
            if *value > 3i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("failures"),
                    max: 3i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.failures {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("failures"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.successes {
            if *value > 3i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("successes"),
                    max: 3i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.successes {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("successes"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for DndStats<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "dndStats"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.attacks {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("attacks"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.features {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 5000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("features"),
                    max: 5000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.languages {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("languages"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.proficiencies {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("proficiencies"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Equipment<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "equipment"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.armor {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 200usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("armor"),
                    max: 200usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.gear {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 2000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("gear"),
                    max: 2000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.treasure {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("treasure"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.weapons {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("weapons"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Hp<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "hp"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.current {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("current"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.temp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("temp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Identity<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "identity"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.alignment {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 50usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("alignment"),
                    max: 50usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.background {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("background"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.class {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("class"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.level {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.proficiency {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("proficiency"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.race {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("race"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.xp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("xp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

/// Marker type for deserializing records from this collection.

#[derive(Debug, Serialize, Deserialize)]
pub struct StatsRecord;
impl XrpcResp for StatsRecord {
    const NSID: &'static str = "actor.rpg.stats";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = StatsGetRecordOutput<'de>;
    type Err<'de> = RecordError<'de>;
}

impl From<StatsGetRecordOutput<'_>> for Stats<'_> {
    fn from(output: StatsGetRecordOutput<'_>) -> Self {
        use jacquard_common::IntoStatic;
        output.value.into_static()
    }
}

impl Collection for Stats<'_> {
    const NSID: &'static str = "actor.rpg.stats";
    type Record = StatsRecord;
}

impl Collection for StatsRecord {
    const NSID: &'static str = "actor.rpg.stats";
    type Record = StatsRecord;
}

impl<'a> LexiconSchema for Stats<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "main"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for Passives<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "passives"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for Personality<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "personality"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.backstory {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 5000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("backstory"),
                    max: 5000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.bonds {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("bonds"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.flaws {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("flaws"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.ideals {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 500usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("ideals"),
                    max: 500usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.traits {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 1000usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("traits"),
                    max: 1000usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for ReverieStats<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "reverieStats"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.authority {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("authority"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.authority {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("authority"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.entropy {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("entropy"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.entropy {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("entropy"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.liberty {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("liberty"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.liberty {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("liberty"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.oblivion {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("oblivion"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.oblivion {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("oblivion"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.receptive {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("receptive"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.receptive {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("receptive"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.skeptic {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("skeptic"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.skeptic {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("skeptic"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for RmmzStats<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "rmmzStats"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.agi {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("agi"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.atk {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("atk"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.class {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 100usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("class"),
                    max: 100usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.cri {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("cri"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.cri {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("cri"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.def {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("def"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.eva {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("eva"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.eva {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("eva"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.hit {
            if *value > 100i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("hit"),
                    max: 100i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.hit {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("hit"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.hp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("hp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.level {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.luk {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("luk"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.mat {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("mat"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max_hp {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max_hp"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max_mp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max_mp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.max_tp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("max_tp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.mdf {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("mdf"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.mp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("mp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.tp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("tp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.xp {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("xp"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Saves<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "saves"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for Skills<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "skills"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        Ok(())
    }
}

impl<'a> LexiconSchema for SpellList<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "spellList"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.cantrips {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("cantrips"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l1 {
            #[allow(unused_comparisons)]
            if value.len() > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l1"),
                    max: 30usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l2 {
            #[allow(unused_comparisons)]
            if value.len() > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l2"),
                    max: 30usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l3 {
            #[allow(unused_comparisons)]
            if value.len() > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l3"),
                    max: 30usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l4 {
            #[allow(unused_comparisons)]
            if value.len() > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l4"),
                    max: 30usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l5 {
            #[allow(unused_comparisons)]
            if value.len() > 30usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l5"),
                    max: 30usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l6 {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l6"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l7 {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l7"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l8 {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l8"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        if let Some(ref value) = self.l9 {
            #[allow(unused_comparisons)]
            if value.len() > 20usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("l9"),
                    max: 20usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Spellcasting<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "spellcasting"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        if let Some(ref value) = self.ability {
            #[allow(unused_comparisons)]
            if <str>::len(value.as_ref()) > 3usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("ability"),
                    max: 3usize,
                    actual: <str>::len(value.as_ref()),
                });
            }
        }
        if let Some(ref value) = self.dc {
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("dc"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.slots {
            #[allow(unused_comparisons)]
            if value.len() > 9usize {
                return Err(ConstraintError::MaxLength {
                    path: ValidationPath::from_field("slots"),
                    max: 9usize,
                    actual: value.len(),
                });
            }
        }
        Ok(())
    }
}

impl<'a> LexiconSchema for Spellslot<'a> {
    fn nsid() -> &'static str {
        "actor.rpg.stats"
    }
    fn def_name() -> &'static str {
        "spellslot"
    }
    fn lexicon_doc() -> LexiconDoc<'static> {
        lexicon_doc_actor_rpg_stats()
    }
    fn validate(&self) -> Result<(), ConstraintError> {
        {
            let value = &self.level;
            if *value > 9i64 {
                return Err(ConstraintError::Maximum {
                    path: ValidationPath::from_field("level"),
                    max: 9i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.level;
            if *value < 1i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("level"),
                    min: 1i64,
                    actual: *value,
                });
            }
        }
        {
            let value = &self.total;
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("total"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        if let Some(ref value) = self.used {
            if *value < 0i64 {
                return Err(ConstraintError::Minimum {
                    path: ValidationPath::from_field("used"),
                    min: 0i64,
                    actual: *value,
                });
            }
        }
        Ok(())
    }
}

fn lexicon_doc_actor_rpg_stats() -> LexiconDoc<'static> {
    #[allow(unused_imports)]
    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
    use jacquard_lexicon::lexicon::*;
    use alloc::collections::BTreeMap;
    LexiconDoc {
        lexicon: Lexicon::Lexicon1,
        id: CowStr::new_static("actor.rpg.stats"),
        defs: {
            let mut map = BTreeMap::new();
            map.insert(
                SmolStr::new_static("abilities"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("The six ability scores (1-30 per SRD)"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cha"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(30i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("con"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(30i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("dex"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(30i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("int"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(30i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("str"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(30i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("wis"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(30i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("attack"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("An attack action")),
                    required: Some(vec![SmolStr::new_static("name")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("bonus"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Attack bonus (e.g., +5)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("damage"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Damage dice (e.g., 1d8)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("damageBonus"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("damageType"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Damage type")),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Attack name")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("coinage"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Currency")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("ep"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("gp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("combat"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Combat and defensive stats")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("ac"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hitDice"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Hit dice (e.g., 5d10)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hitDiceUsed"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("initiative"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("speed"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("conditions"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Status conditions and effects"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("deathSaves"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#deathSaves"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("exhaustion"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(6i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("inspiration"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("customStat"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("A custom stat")),
                    required: Some(
                        vec![SmolStr::new_static("name"), SmolStr::new_static("value")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("category"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Category (optional)"),
                                ),
                                max_length: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("max"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("min"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Stat name")),
                                max_length: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("value"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("customStats"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("User-defined custom stat system"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("stats"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Custom stat entries"),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#customStat"),
                                    ..Default::default()
                                }),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("systemName"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("System name")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("systemVersion"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Version")),
                                max_length: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccAbilities"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "DCC ability scores (3-18 standard, can be modified by corruption/spellburn)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("agi"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("agiBase"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("int"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luk"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("per"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sta"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("staBase"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("str"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("strBase"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccAttack"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A weapon attack (includes deed die for warriors)",
                        ),
                    ),
                    required: Some(vec![SmolStr::new_static("name")]),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("attackMod"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Attack modifier (e.g., +2, d16+2 for deed die)",
                                    ),
                                ),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("damage"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Damage dice (e.g., 1d8+2, 1d6+d3)"),
                                ),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("damageBonus"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Damage bonus (e.g., +2, +d3 for deed die)",
                                    ),
                                ),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Weapon name")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("notes"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Special properties (backstab, trained weapon, etc.)",
                                    ),
                                ),
                                max_length: Some(200usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("range"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Range (melee or distance)"),
                                ),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("type"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Attack type (melee, ranged, etc.)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccCleric"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Cleric spellcasting features"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("deity"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Deity or supernatural patron"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("disapprovalRange"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(20i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("disapprovalTable"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Deity-specific disapproval table if any",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("holySymbol"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Holy symbol description"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("knownSpells"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Known cleric spells"),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#dccClericSpell"),
                                    ..Default::default()
                                }),
                                max_length: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("layOnHandsDie"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Lay on hands die (e.g., d14, d16)"),
                                ),
                                max_length: Some(10usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("maxSpellLevel"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(5i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("spellCheckMod"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("turnUnholyDie"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Turn unholy die (e.g., d14, d16)"),
                                ),
                                max_length: Some(10usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("unholy"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccClericSpell"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("A cleric spell")),
                    required: Some(
                        vec![SmolStr::new_static("name"), SmolStr::new_static("level")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("level"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(5i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Spell name")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("notes"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Additional spell notes"),
                                ),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sinful"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccCoinage"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "DCC uses cp, sp, gp (10cp = 1sp, 10sp = 1gp)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("gp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccCombat"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Combat statistics")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("ac"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("actionDie"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Primary action die (e.g., d20, d20+d14)",
                                    ),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("attackMod"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("critDie"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Critical hit die (e.g., d8, d12, d14)"),
                                ),
                                max_length: Some(10usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("critTable"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Critical hit table (I, II, III, IV, V)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("fumbleDie"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Fumble die (typically d4 for 0-level, varies by armor)",
                                    ),
                                ),
                                max_length: Some(10usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("initiative"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("speed"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccCorruption"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "A corruption effect from failed spell checks",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("effect"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Description of the corruption"),
                                ),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("permanent"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("source"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("What spell caused this corruption"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("type"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Corruption severity (minor, major, greater)",
                                    ),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccEquipment"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Equipment and inventory")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("armor"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Armor worn (affects fumble die)"),
                                ),
                                max_length: Some(200usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("armorCheckPenalty"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("gear"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Other equipment")),
                                max_length: Some(2000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("shield"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Shield (if any)")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("tradeGoods"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Trade goods from occupation"),
                                ),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("treasure"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Valuables and treasure"),
                                ),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("weapons"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Weapons carried")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccHalfling"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Halfling class features")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("goodLuckCharm"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("infravision"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luckSpentOnAllies"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luckyWeapon"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Weapon type luck modifier applies to"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sneakAndHide"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("twoWeaponFighting"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccHp"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Hit points (0-level characters use 1d4 + STA mod)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("current"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("max"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccIdentity"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("DCC character identity and progression"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("alignment"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Alignment (Lawful, Neutral, Chaotic)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("class"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Class (Warrior, Wizard, Cleric, Thief, Elf, Dwarf, Halfling)",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("level"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(10i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("occupation"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "0-level occupation (e.g., Blacksmith, Farmer)",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("title"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Level title (e.g., Squire, Cutpurse, Acolyte)",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("xp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccLuck"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Birth augur and luck mechanics"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("birthAugur"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Birth augur name (e.g., Harsh Winter, The Bull, Fortunate Date)",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("birthAugurEffect"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("What the luck modifier applies to"),
                                ),
                                max_length: Some(200usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luckyWeapon"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Weapon type that luck applies to (Dwarves/Halflings)",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("startingLuck"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(24i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccSaves"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("DCC saving throws (3 saves, not 6)"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("fort"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("ref"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("will"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccSpellburn"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Current spellburn (temporary ability score sacrifice)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("agiBurned"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("recoveryRate"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("staBurned"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("strBurned"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccStats"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Dungeon Crawl Classics RPG character sheet. Supports 0-level funnel characters through 10th level.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("abilities"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccAbilities"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("abilitiesNotes"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Notes about special abilities, class features, and racial traits",
                                    ),
                                ),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("attacks"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("Weapon attacks")),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#dccAttack"),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("cleric"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccCleric"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("coinage"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccCoinage"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("combat"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccCombat"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("equipment"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccEquipment"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("halfling"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccHalfling"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hp"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccHp"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("identity"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccIdentity"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("languages"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Languages known")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luck"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccLuck"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("notes"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Character notes, backstory, and special abilities",
                                    ),
                                ),
                                max_length: Some(5000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("saves"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccSaves"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("thief"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccThief"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("warrior"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccWarrior"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("wizard"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccWizard"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccThief"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Thief class features and skills"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("alignment"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Alignment (affects some skill targets)"),
                                ),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("backstab"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luckyWeapon"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Weapon type that luck applies to (one type only)",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("skills"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccThiefSkills"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccThiefSkills"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Thief skill bonuses (roll d20 + skill vs target)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("backstab"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("castSpellFromScroll"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("climbSheerSurfaces"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("disableTrap"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("disguiseSelf"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("findTrap"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("forgeDocument"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("handlePoison"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hideInShadows"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pickLock"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("pickPocket"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("readLanguages"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sneakSilently"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccWarrior"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Warrior and Dwarf class features"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("deedDie"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Current deed die (d3, d4, d5, d6, d7, d8, d10+d3, etc.)",
                                    ),
                                ),
                                max_length: Some(10usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("infravision"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luckyWeapon"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Weapon type luck modifier applies to"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mightyDeeds"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Signature mighty deeds of arms"),
                                ),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(200usize),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("shieldBash"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("smellGold"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("undergroundSkills"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccWizard"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Wizard and Elf spellcasting features"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("corruption"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "Corruption effects suffered (structured)",
                                    ),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#dccCorruption"),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("corruptionText"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Corruption effects as free-form text"),
                                ),
                                max_length: Some(2000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("knownSpells"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static(
                                        "Known spells with mercurial magic effects",
                                    ),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#dccWizardSpell"),
                                    ..Default::default()
                                }),
                                max_length: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("maxSpellLevel"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(5i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("patron"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Supernatural patron (if any)"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("patronBond"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Patron bond description and effects"),
                                ),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("spellCheckMod"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("spellburn"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#dccSpellburn"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dccWizardSpell"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("A wizard spell with mercurial magic effect"),
                    ),
                    required: Some(
                        vec![SmolStr::new_static("name"), SmolStr::new_static("level")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("level"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(5i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("lost"),
                            LexObjectProperty::Boolean(LexBoolean {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mercurialMagic"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Unique mercurial magic effect (d100 roll result)",
                                    ),
                                ),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mercurialRoll"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("name"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Spell name")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("notes"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Additional spell notes"),
                                ),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("deathSaves"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Death saving throw successes and failures"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("failures"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(3i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("successes"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(3i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("dndStats"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "D&D 5e character sheet. All sub-objects are optional.",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("abilities"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#abilities"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("attacks"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("Attack actions")),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#attack"),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("coinage"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#coinage"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("combat"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#combat"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("conditions"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#conditions"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("equipment"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#equipment"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("features"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Class features, racial traits, and feats",
                                    ),
                                ),
                                max_length: Some(5000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hp"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#hp"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("identity"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#identity"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("languages"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Languages known")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("passives"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#passives"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("personality"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#personality"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("proficiencies"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Armor, weapon, and tool proficiencies"),
                                ),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("saves"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#saves"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("skills"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#skills"),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("spellcasting"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#spellcasting"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("equipment"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Gear and inventory")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("armor"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Armor")),
                                max_length: Some(200usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("gear"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Other equipment")),
                                max_length: Some(2000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("treasure"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Valuables and treasure"),
                                ),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("weapons"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Weapons")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("hp"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Hit point tracking")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("current"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("max"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("temp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("identity"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Character identity and progression"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("alignment"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Alignment (e.g., Lawful Good)"),
                                ),
                                max_length: Some(50usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("background"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Background (e.g., Soldier, Sage)"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("class"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static(
                                        "Class and subclass (e.g., Fighter (Champion))",
                                    ),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("level"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("proficiency"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("race"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Race (e.g., Human, Elf, Dwarf)"),
                                ),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("xp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("main"),
                LexUserType::Record(LexRecord {
                    description: Some(
                        CowStr::new_static(
                            "A user's RPG character statistics. One record per user (rkey: self).",
                        ),
                    ),
                    key: Some(CowStr::new_static("literal:self")),
                    record: LexRecordRecord::Object(LexObject {
                        required: Some(vec![SmolStr::new_static("createdAt")]),
                        properties: {
                            #[allow(unused_mut)]
                            let mut map = BTreeMap::new();
                            map.insert(
                                SmolStr::new_static("createdAt"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static("Timestamp when this record was created"),
                                    ),
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("custom"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static("#customStats"),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("dcc"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static("#dccStats"),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("dnd"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static("#dndStats"),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("reverie"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static("#reverieStats"),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("rmmz"),
                                LexObjectProperty::Ref(LexRef {
                                    r#ref: CowStr::new_static("#rmmzStats"),
                                    ..Default::default()
                                }),
                            );
                            map.insert(
                                SmolStr::new_static("updatedAt"),
                                LexObjectProperty::String(LexString {
                                    description: Some(
                                        CowStr::new_static(
                                            "Timestamp when this record was last modified",
                                        ),
                                    ),
                                    format: Some(LexStringFormat::Datetime),
                                    ..Default::default()
                                }),
                            );
                            map
                        },
                        ..Default::default()
                    }),
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("passives"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Passive scores (10 + skill modifier)"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("insight"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("investigation"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("perception"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("personality"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Personality and backstory")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("backstory"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Backstory")),
                                max_length: Some(5000usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("bonds"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Bonds")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("flaws"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Flaws")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("ideals"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Ideals")),
                                max_length: Some(500usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("traits"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Personality traits")),
                                max_length: Some(1000usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("reverieStats"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("Reverie House philosophical alignment"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("authority"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("entropy"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("liberty"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("oblivion"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("octant"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Philosophical octant"),
                                ),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("receptive"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("skeptic"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("rmmzStats"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static("RPG Maker MZ character parameters"),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("agi"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("atk"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("class"),
                            LexObjectProperty::String(LexString {
                                description: Some(CowStr::new_static("Class")),
                                max_length: Some(100usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("cri"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("def"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("eva"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hit"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                maximum: Some(100i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("hp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("level"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("luk"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mat"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("maxHp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("maxMp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("maxTp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mdf"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("mp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("tp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("xp"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("saves"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Saving throw modifiers (actual values, not proficiency flags)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cha"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("con"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("dex"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("int"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("str"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("wis"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("skills"),
                LexUserType::Object(LexObject {
                    description: Some(
                        CowStr::new_static(
                            "Skill modifiers (actual values, not proficiency flags)",
                        ),
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("acrobatics"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("animalHandling"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("arcana"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("athletics"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("deception"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("history"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("insight"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("intimidation"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("investigation"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("medicine"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("nature"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("perception"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("performance"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("persuasion"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("religion"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("sleightOfHand"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("stealth"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("survival"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("spellList"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Spells organized by level")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("cantrips"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("Cantrips (at-will)")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l1"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("1st-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l2"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("2nd-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l3"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("3rd-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l4"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("4th-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l5"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("5th-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(30usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l6"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("6th-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l7"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("7th-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l8"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("8th-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("l9"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(CowStr::new_static("9th-level spells")),
                                items: LexArrayItem::String(LexString {
                                    max_length: Some(100usize),
                                    ..Default::default()
                                }),
                                max_length: Some(20usize),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("spellcasting"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Spellcasting details")),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("ability"),
                            LexObjectProperty::String(LexString {
                                description: Some(
                                    CowStr::new_static("Spellcasting ability (INT, WIS, CHA)"),
                                ),
                                max_length: Some(3usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("attack"),
                            LexObjectProperty::Integer(LexInteger {
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("dc"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("slots"),
                            LexObjectProperty::Array(LexArray {
                                description: Some(
                                    CowStr::new_static("Spell slots by level"),
                                ),
                                items: LexArrayItem::Ref(LexRef {
                                    r#ref: CowStr::new_static("#spellslot"),
                                    ..Default::default()
                                }),
                                max_length: Some(9usize),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("spells"),
                            LexObjectProperty::Ref(LexRef {
                                r#ref: CowStr::new_static("#spellList"),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map.insert(
                SmolStr::new_static("spellslot"),
                LexUserType::Object(LexObject {
                    description: Some(CowStr::new_static("Spell slot entry")),
                    required: Some(
                        vec![SmolStr::new_static("level"), SmolStr::new_static("total")],
                    ),
                    properties: {
                        #[allow(unused_mut)]
                        let mut map = BTreeMap::new();
                        map.insert(
                            SmolStr::new_static("level"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(1i64),
                                maximum: Some(9i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("total"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map.insert(
                            SmolStr::new_static("used"),
                            LexObjectProperty::Integer(LexInteger {
                                minimum: Some(0i64),
                                ..Default::default()
                            }),
                        );
                        map
                    },
                    ..Default::default()
                }),
            );
            map
        },
        ..Default::default()
    }
}

pub mod custom_stat_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Name;
        type Value;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Name = Unset;
        type Value = Unset;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetName<S> {}
    impl<S: State> State for SetName<S> {
        type Name = Set<members::name>;
        type Value = S::Value;
    }
    ///State transition - sets the `value` field to Set
    pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetValue<S> {}
    impl<S: State> State for SetValue<S> {
        type Name = S::Name;
        type Value = Set<members::value>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `value` field
        pub struct value(());
    }
}

/// Builder for constructing an instance of this type
pub struct CustomStatBuilder<'a, S: custom_stat_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<i64>,
        Option<i64>,
        Option<CowStr<'a>>,
        Option<i64>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> CustomStat<'a> {
    /// Create a new builder for this type
    pub fn new() -> CustomStatBuilder<'a, custom_stat_state::Empty> {
        CustomStatBuilder::new()
    }
}

impl<'a> CustomStatBuilder<'a, custom_stat_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        CustomStatBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: custom_stat_state::State> CustomStatBuilder<'a, S> {
    /// Set the `category` field (optional)
    pub fn category(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `category` field to an Option value (optional)
    pub fn maybe_category(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S: custom_stat_state::State> CustomStatBuilder<'a, S> {
    /// Set the `max` field (optional)
    pub fn max(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `max` field to an Option value (optional)
    pub fn maybe_max(mut self, value: Option<i64>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: custom_stat_state::State> CustomStatBuilder<'a, S> {
    /// Set the `min` field (optional)
    pub fn min(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `min` field to an Option value (optional)
    pub fn maybe_min(mut self, value: Option<i64>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S> CustomStatBuilder<'a, S>
where
    S: custom_stat_state::State,
    S::Name: custom_stat_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> CustomStatBuilder<'a, custom_stat_state::SetName<S>> {
        self._fields.3 = Option::Some(value.into());
        CustomStatBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> CustomStatBuilder<'a, S>
where
    S: custom_stat_state::State,
    S::Value: custom_stat_state::IsUnset,
{
    /// Set the `value` field (required)
    pub fn value(
        mut self,
        value: impl Into<i64>,
    ) -> CustomStatBuilder<'a, custom_stat_state::SetValue<S>> {
        self._fields.4 = Option::Some(value.into());
        CustomStatBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> CustomStatBuilder<'a, S>
where
    S: custom_stat_state::State,
    S::Name: custom_stat_state::IsSet,
    S::Value: custom_stat_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> CustomStat<'a> {
        CustomStat {
            category: self._fields.0,
            max: self._fields.1,
            min: self._fields.2,
            name: self._fields.3.unwrap(),
            value: self._fields.4.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> CustomStat<'a> {
        CustomStat {
            category: self._fields.0,
            max: self._fields.1,
            min: self._fields.2,
            name: self._fields.3.unwrap(),
            value: self._fields.4.unwrap(),
            extra_data: Some(extra_data),
        }
    }
}

pub mod dcc_cleric_spell_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Name;
        type Level;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Name = Unset;
        type Level = Unset;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetName<S> {}
    impl<S: State> State for SetName<S> {
        type Name = Set<members::name>;
        type Level = S::Level;
    }
    ///State transition - sets the `level` field to Set
    pub struct SetLevel<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLevel<S> {}
    impl<S: State> State for SetLevel<S> {
        type Name = S::Name;
        type Level = Set<members::level>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `level` field
        pub struct level(());
    }
}

/// Builder for constructing an instance of this type
pub struct DccClericSpellBuilder<'a, S: dcc_cleric_spell_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<i64>, Option<CowStr<'a>>, Option<CowStr<'a>>, Option<bool>),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> DccClericSpell<'a> {
    /// Create a new builder for this type
    pub fn new() -> DccClericSpellBuilder<'a, dcc_cleric_spell_state::Empty> {
        DccClericSpellBuilder::new()
    }
}

impl<'a> DccClericSpellBuilder<'a, dcc_cleric_spell_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        DccClericSpellBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> DccClericSpellBuilder<'a, S>
where
    S: dcc_cleric_spell_state::State,
    S::Level: dcc_cleric_spell_state::IsUnset,
{
    /// Set the `level` field (required)
    pub fn level(
        mut self,
        value: impl Into<i64>,
    ) -> DccClericSpellBuilder<'a, dcc_cleric_spell_state::SetLevel<S>> {
        self._fields.0 = Option::Some(value.into());
        DccClericSpellBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> DccClericSpellBuilder<'a, S>
where
    S: dcc_cleric_spell_state::State,
    S::Name: dcc_cleric_spell_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> DccClericSpellBuilder<'a, dcc_cleric_spell_state::SetName<S>> {
        self._fields.1 = Option::Some(value.into());
        DccClericSpellBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: dcc_cleric_spell_state::State> DccClericSpellBuilder<'a, S> {
    /// Set the `notes` field (optional)
    pub fn notes(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `notes` field to an Option value (optional)
    pub fn maybe_notes(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: dcc_cleric_spell_state::State> DccClericSpellBuilder<'a, S> {
    /// Set the `sinful` field (optional)
    pub fn sinful(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `sinful` field to an Option value (optional)
    pub fn maybe_sinful(mut self, value: Option<bool>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S> DccClericSpellBuilder<'a, S>
where
    S: dcc_cleric_spell_state::State,
    S::Name: dcc_cleric_spell_state::IsSet,
    S::Level: dcc_cleric_spell_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> DccClericSpell<'a> {
        DccClericSpell {
            level: self._fields.0.unwrap(),
            name: self._fields.1.unwrap(),
            notes: self._fields.2,
            sinful: self._fields.3,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> DccClericSpell<'a> {
        DccClericSpell {
            level: self._fields.0.unwrap(),
            name: self._fields.1.unwrap(),
            notes: self._fields.2,
            sinful: self._fields.3,
            extra_data: Some(extra_data),
        }
    }
}

pub mod dcc_wizard_spell_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Name;
        type Level;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Name = Unset;
        type Level = Unset;
    }
    ///State transition - sets the `name` field to Set
    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetName<S> {}
    impl<S: State> State for SetName<S> {
        type Name = Set<members::name>;
        type Level = S::Level;
    }
    ///State transition - sets the `level` field to Set
    pub struct SetLevel<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLevel<S> {}
    impl<S: State> State for SetLevel<S> {
        type Name = S::Name;
        type Level = Set<members::level>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `name` field
        pub struct name(());
        ///Marker type for the `level` field
        pub struct level(());
    }
}

/// Builder for constructing an instance of this type
pub struct DccWizardSpellBuilder<'a, S: dcc_wizard_spell_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<i64>,
        Option<bool>,
        Option<CowStr<'a>>,
        Option<i64>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> DccWizardSpell<'a> {
    /// Create a new builder for this type
    pub fn new() -> DccWizardSpellBuilder<'a, dcc_wizard_spell_state::Empty> {
        DccWizardSpellBuilder::new()
    }
}

impl<'a> DccWizardSpellBuilder<'a, dcc_wizard_spell_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        DccWizardSpellBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> DccWizardSpellBuilder<'a, S>
where
    S: dcc_wizard_spell_state::State,
    S::Level: dcc_wizard_spell_state::IsUnset,
{
    /// Set the `level` field (required)
    pub fn level(
        mut self,
        value: impl Into<i64>,
    ) -> DccWizardSpellBuilder<'a, dcc_wizard_spell_state::SetLevel<S>> {
        self._fields.0 = Option::Some(value.into());
        DccWizardSpellBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: dcc_wizard_spell_state::State> DccWizardSpellBuilder<'a, S> {
    /// Set the `lost` field (optional)
    pub fn lost(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `lost` field to an Option value (optional)
    pub fn maybe_lost(mut self, value: Option<bool>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: dcc_wizard_spell_state::State> DccWizardSpellBuilder<'a, S> {
    /// Set the `mercurialMagic` field (optional)
    pub fn mercurial_magic(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `mercurialMagic` field to an Option value (optional)
    pub fn maybe_mercurial_magic(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: dcc_wizard_spell_state::State> DccWizardSpellBuilder<'a, S> {
    /// Set the `mercurialRoll` field (optional)
    pub fn mercurial_roll(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `mercurialRoll` field to an Option value (optional)
    pub fn maybe_mercurial_roll(mut self, value: Option<i64>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S> DccWizardSpellBuilder<'a, S>
where
    S: dcc_wizard_spell_state::State,
    S::Name: dcc_wizard_spell_state::IsUnset,
{
    /// Set the `name` field (required)
    pub fn name(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> DccWizardSpellBuilder<'a, dcc_wizard_spell_state::SetName<S>> {
        self._fields.4 = Option::Some(value.into());
        DccWizardSpellBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: dcc_wizard_spell_state::State> DccWizardSpellBuilder<'a, S> {
    /// Set the `notes` field (optional)
    pub fn notes(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `notes` field to an Option value (optional)
    pub fn maybe_notes(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S> DccWizardSpellBuilder<'a, S>
where
    S: dcc_wizard_spell_state::State,
    S::Name: dcc_wizard_spell_state::IsSet,
    S::Level: dcc_wizard_spell_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> DccWizardSpell<'a> {
        DccWizardSpell {
            level: self._fields.0.unwrap(),
            lost: self._fields.1,
            mercurial_magic: self._fields.2,
            mercurial_roll: self._fields.3,
            name: self._fields.4.unwrap(),
            notes: self._fields.5,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> DccWizardSpell<'a> {
        DccWizardSpell {
            level: self._fields.0.unwrap(),
            lost: self._fields.1,
            mercurial_magic: self._fields.2,
            mercurial_roll: self._fields.3,
            name: self._fields.4.unwrap(),
            notes: self._fields.5,
            extra_data: Some(extra_data),
        }
    }
}

pub mod stats_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type CreatedAt;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type CreatedAt = Unset;
    }
    ///State transition - sets the `created_at` field to Set
    pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
    impl<S: State> State for SetCreatedAt<S> {
        type CreatedAt = Set<members::created_at>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `created_at` field
        pub struct created_at(());
    }
}

/// Builder for constructing an instance of this type
pub struct StatsBuilder<'a, S: stats_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Datetime>,
        Option<stats::CustomStats<'a>>,
        Option<stats::DccStats<'a>>,
        Option<stats::DndStats<'a>>,
        Option<stats::ReverieStats<'a>>,
        Option<stats::RmmzStats<'a>>,
        Option<Datetime>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> Stats<'a> {
    /// Create a new builder for this type
    pub fn new() -> StatsBuilder<'a, stats_state::Empty> {
        StatsBuilder::new()
    }
}

impl<'a> StatsBuilder<'a, stats_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        StatsBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> StatsBuilder<'a, S>
where
    S: stats_state::State,
    S::CreatedAt: stats_state::IsUnset,
{
    /// Set the `createdAt` field (required)
    pub fn created_at(
        mut self,
        value: impl Into<Datetime>,
    ) -> StatsBuilder<'a, stats_state::SetCreatedAt<S>> {
        self._fields.0 = Option::Some(value.into());
        StatsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: stats_state::State> StatsBuilder<'a, S> {
    /// Set the `custom` field (optional)
    pub fn custom(mut self, value: impl Into<Option<stats::CustomStats<'a>>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `custom` field to an Option value (optional)
    pub fn maybe_custom(mut self, value: Option<stats::CustomStats<'a>>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: stats_state::State> StatsBuilder<'a, S> {
    /// Set the `dcc` field (optional)
    pub fn dcc(mut self, value: impl Into<Option<stats::DccStats<'a>>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `dcc` field to an Option value (optional)
    pub fn maybe_dcc(mut self, value: Option<stats::DccStats<'a>>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: stats_state::State> StatsBuilder<'a, S> {
    /// Set the `dnd` field (optional)
    pub fn dnd(mut self, value: impl Into<Option<stats::DndStats<'a>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `dnd` field to an Option value (optional)
    pub fn maybe_dnd(mut self, value: Option<stats::DndStats<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S: stats_state::State> StatsBuilder<'a, S> {
    /// Set the `reverie` field (optional)
    pub fn reverie(mut self, value: impl Into<Option<stats::ReverieStats<'a>>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `reverie` field to an Option value (optional)
    pub fn maybe_reverie(mut self, value: Option<stats::ReverieStats<'a>>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S: stats_state::State> StatsBuilder<'a, S> {
    /// Set the `rmmz` field (optional)
    pub fn rmmz(mut self, value: impl Into<Option<stats::RmmzStats<'a>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `rmmz` field to an Option value (optional)
    pub fn maybe_rmmz(mut self, value: Option<stats::RmmzStats<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S: stats_state::State> StatsBuilder<'a, S> {
    /// Set the `updatedAt` field (optional)
    pub fn updated_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `updatedAt` field to an Option value (optional)
    pub fn maybe_updated_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S> StatsBuilder<'a, S>
where
    S: stats_state::State,
    S::CreatedAt: stats_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Stats<'a> {
        Stats {
            created_at: self._fields.0.unwrap(),
            custom: self._fields.1,
            dcc: self._fields.2,
            dnd: self._fields.3,
            reverie: self._fields.4,
            rmmz: self._fields.5,
            updated_at: self._fields.6,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> Stats<'a> {
        Stats {
            created_at: self._fields.0.unwrap(),
            custom: self._fields.1,
            dcc: self._fields.2,
            dnd: self._fields.3,
            reverie: self._fields.4,
            rmmz: self._fields.5,
            updated_at: self._fields.6,
            extra_data: Some(extra_data),
        }
    }
}

pub mod spellslot_state {

    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
    #[allow(unused)]
    use ::core::marker::PhantomData;
    mod sealed {
        pub trait Sealed {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Level;
        type Total;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Level = Unset;
        type Total = Unset;
    }
    ///State transition - sets the `level` field to Set
    pub struct SetLevel<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLevel<S> {}
    impl<S: State> State for SetLevel<S> {
        type Level = Set<members::level>;
        type Total = S::Total;
    }
    ///State transition - sets the `total` field to Set
    pub struct SetTotal<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetTotal<S> {}
    impl<S: State> State for SetTotal<S> {
        type Level = S::Level;
        type Total = Set<members::total>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `level` field
        pub struct level(());
        ///Marker type for the `total` field
        pub struct total(());
    }
}

/// Builder for constructing an instance of this type
pub struct SpellslotBuilder<'a, S: spellslot_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<i64>, Option<i64>, Option<i64>),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> Spellslot<'a> {
    /// Create a new builder for this type
    pub fn new() -> SpellslotBuilder<'a, spellslot_state::Empty> {
        SpellslotBuilder::new()
    }
}

impl<'a> SpellslotBuilder<'a, spellslot_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        SpellslotBuilder {
            _state: PhantomData,
            _fields: (None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SpellslotBuilder<'a, S>
where
    S: spellslot_state::State,
    S::Level: spellslot_state::IsUnset,
{
    /// Set the `level` field (required)
    pub fn level(
        mut self,
        value: impl Into<i64>,
    ) -> SpellslotBuilder<'a, spellslot_state::SetLevel<S>> {
        self._fields.0 = Option::Some(value.into());
        SpellslotBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SpellslotBuilder<'a, S>
where
    S: spellslot_state::State,
    S::Total: spellslot_state::IsUnset,
{
    /// Set the `total` field (required)
    pub fn total(
        mut self,
        value: impl Into<i64>,
    ) -> SpellslotBuilder<'a, spellslot_state::SetTotal<S>> {
        self._fields.1 = Option::Some(value.into());
        SpellslotBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: spellslot_state::State> SpellslotBuilder<'a, S> {
    /// Set the `used` field (optional)
    pub fn used(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `used` field to an Option value (optional)
    pub fn maybe_used(mut self, value: Option<i64>) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S> SpellslotBuilder<'a, S>
where
    S: spellslot_state::State,
    S::Level: spellslot_state::IsSet,
    S::Total: spellslot_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Spellslot<'a> {
        Spellslot {
            level: self._fields.0.unwrap(),
            total: self._fields.1.unwrap(),
            used: self._fields.2,
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> Spellslot<'a> {
        Spellslot {
            level: self._fields.0.unwrap(),
            total: self._fields.1.unwrap(),
            used: self._fields.2,
            extra_data: Some(extra_data),
        }
    }
}