1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Serialize_repr};

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Corruption {
    pub added: u64,
    pub resisted: u64,
    pub total: u64,
    #[serde(rename = "cloakRank")]
    pub cloak_ranks: Option<u8>,
    pub spells: Option<Vec<Spell>>,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Spell {
    pub id: u64,
    pub name: String,
    pub icon: String,
    pub school: u64,
    pub rank: Option<String>,
}

#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Items {
    pub head: Item,
    pub neck: Item,
    pub shoulder: Item,
    pub back: Item,
    pub chest: Item,
    pub waist: Item,
    pub shirt: Item,
    pub wrist: Item,
    pub hands: Item,
    pub legs: Item,
    pub feet: Item,
    pub finger1: Item,
    pub finger2: Item,
    pub trinket1: Item,
    pub trinket2: Item,
    pub mainhand: Item,
    pub offhand: Item,
}
#[derive(Deserialize_repr, Serialize_repr, Copy, Clone, Debug)]
#[repr(u8)]
pub enum Quality {
    Poor = 0,
    Common = 1,
    Uncommon = 2,
    Rare = 3,
    Epic = 4,
    Legendary = 5,
    Artifact = 6,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AzeritePower {
    pub id: u64,
    pub spell: Spell,
    pub tier: u64,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub enum EssenceName {
    #[serde(rename = "Blood of the Enemy")]
    BloodOfTheEnemy,
    #[serde(rename = "Vision of Perfection")]
    VisionOfPerfection,
    #[serde(rename = "Memory of Lucid Dreams")]
    MemoryOfLucidDreams,
    #[serde(rename = "Breath of the Dying")]
    BreathOfTheDying,
    #[serde(rename = "Formless Void")]
    FormlessVoid,
    #[serde(rename = "Strength of the Warden")]
    StrengthOfTheWarden,
    #[serde(rename = "Touch of the Everlasting")]
    TouchOfTheEverlasting,
    #[serde(rename = "Spark of Inspiration")]
    SparkOfInspiration,
    #[serde(rename = "Unwavering Ward")]
    UnwaveringWard,
    #[serde(rename = "Spirit of Preservation")]
    SpiritOfPreservation,
    #[serde(rename = "The Crucible of Flame")]
    TheCrucibleOfFlame,
    #[serde(rename = "Worldvein Resonance")]
    WorldveinResonance,
    #[serde(rename = "Ripple in Space")]
    RippleInSpace,
    #[serde(rename = "Conflict and Strife")]
    ConflictAndStrife,
    #[serde(rename = "Aegis of the Deep")]
    AegisOfTheDeep,
    #[serde(rename = "Nullification Dynamo")]
    NullificationDynamo,
    #[serde(rename = "Sphere of Suppression")]
    SphereOfSuppression,
    #[serde(rename = "Azeroth's Undying Gift")]
    AzerothsUndyingGift,
    #[serde(rename = "Anima of Life and Death")]
    AnimaOfLifeAndDeath,
    #[serde(rename = "The Ever-Rising Tide")]
    TheEverRisingTide,
    #[serde(rename = "The Well of Existence")]
    TheWellOfExistence,
    #[serde(rename = "Artifice of Time")]
    ArtificeOfTime,
    #[serde(rename = "Life-Binder's Invocation")]
    LifeBindersInvocation,
    #[serde(rename = "Vitality Conduit")]
    VitalityConduit,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Essence {
    pub id: u64,
    pub name: EssenceName,
    pub description: String,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct EssencePower {
    pub id: u64,
    pub essence: Essence,
    #[serde(rename = "tierId")]
    pub tier_id: u64,
    #[serde(rename = "majorPowerSpell")]
    pub major_power_spell: Spell,
    #[serde(rename = "minorPowerSpell")]
    pub minor_power_spell: Spell,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct EssenceSlot {
    pub slot: u8,
    pub id: u64,
    pub rank: u8,
    pub power: EssencePower,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct HeartOfAzeroth {
    pub essences: Vec<EssenceSlot>,
    pub level: u64,
    pub progress: f64,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Item {
    pub item_id: u64,
    pub item_level: u64,
    pub item_quality: Quality,
    pub icon: String,
    pub is_legion_legendary: bool,
    pub is_azerite_armor: bool,
    pub azerite_powers: Vec<AzeritePower>,
    pub corruption: Corruption,
    pub gems: Vec<u64>,
    pub bonuses: Vec<u64>,
    pub heart_of_azeroth: Option<HeartOfAzeroth>,
}
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Gear {
    pub item_level_equipped: u64,
    pub item_level_total: u64,
    pub artifact_traits: f32,
    pub corruption: Corruption,
    pub items: Items,
}