some_random_api/structs/
pokemon.rs1use serde::Deserialize;
2
3#[derive(Debug, Deserialize)]
4pub struct PokemonAbility {
5 pub id: u64,
6 pub name: String,
7 pub generation: u64,
8 pub effects: String,
9 pub description: String,
10 pub pokemons: Vec<PokemonAbilityPokemon>,
11 pub descriptions: Vec<PokemonAbilityDescription>,
12}
13
14#[derive(Debug, Deserialize)]
15pub struct PokemonAbilityPokemon {
16 pub pokemon: String,
17 pub hidden: bool,
18}
19
20#[derive(Debug, Deserialize)]
21pub struct PokemonAbilityDescription {
22 pub version: String,
23}
24
25#[derive(Debug, Deserialize)]
26pub struct PokemonItem {
27 pub id: u64,
28 pub name: String,
29 pub effects: String,
30 pub cost: u64,
31 pub attributes: Vec<String>,
32 pub category: String,
33 pub sprite: String,
34 pub descriptions: Vec<PokemonDescription>,
35}
36
37#[derive(Debug, Deserialize)]
38pub struct PokemonMove {
39 pub id: u64,
40 pub name: String,
41 pub generation: u64,
42 pub effects: String,
43
44 #[serde(rename = "type")]
45 pub move_type: String,
46
47 pub category: String,
48 pub contest: String,
49 pub pp: u64,
50 pub power: u64,
51 pub accuracy: u64,
52 pub priority: u64,
53 pub pokemon: Vec<String>,
54 pub descriptions: Vec<PokemonDescription>,
55}
56
57#[derive(Debug, Deserialize)]
58pub struct PokemonDescription {
59 pub description: String,
60 pub version: String,
61}
62
63#[derive(Debug, Deserialize)]
64pub struct Pokedex {
65 pub name: String,
66 pub id: String,
67
68 #[serde(rename = "type")]
69 pub pokemon_type: Vec<String>,
70
71 pub species: Vec<String>,
72 pub abilities: Vec<String>,
73 pub height: String,
74 pub weight: String,
75 pub base_experience: String,
76 pub gender: Vec<String>,
77 pub egg_groups: Vec<String>,
78 pub stats: PokedexStats,
79 pub family: PokedexFamily,
80 pub sprites: PokedexSprites,
81 pub description: String,
82 pub generation: String,
83}
84
85#[derive(Debug, Deserialize)]
86pub struct PokedexStats {
87 pub hp: String,
88 pub attack: String,
89 pub defense: String,
90 pub sp_atk: String,
91 pub sp_def: String,
92 pub speed: String,
93 pub total: String,
94}
95
96#[derive(Debug, Deserialize)]
97#[serde(rename_all = "camelCase")]
98pub struct PokedexFamily {
99 pub evolution_stage: u64,
100 pub evolution_line: Vec<String>,
101}
102
103#[derive(Debug, Deserialize)]
104pub struct PokedexSprites {
105 pub normal: String,
106 pub animated: String,
107}