rustemon/model/pokemon.rs
1//! Pokemon group models
2
3use super::{
4 berries::BerryFlavor,
5 evolution::EvolutionChain,
6 games::{Generation, Pokedex, Version, VersionGroup},
7 items::Item,
8 locations::{LocationArea, PalParkArea},
9 moves::{Move, MoveBattleStyle, MoveDamageClass, MoveLearnMethod},
10 resource::{
11 ApiResource, Description, Effect, FlavorText, GenerationGameIndex, Name, NamedApiResource,
12 VerboseEffect, VersionEncounterDetail, VersionGameIndex,
13 },
14 utility::Language,
15};
16
17/// [Ability official documentation](https://pokeapi.co/docs/v2#ability)
18#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
19#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
20pub struct Ability {
21 /// The identifier for this resource.
22 pub id: i64,
23 /// The name for this resource.
24 pub name: String,
25 /// Whether or not this ability originated in the main series of the video games.
26 pub is_main_series: bool,
27 /// The generation this ability originated in.
28 pub generation: NamedApiResource<Generation>,
29 /// The name of this resource listed in different languages.
30 pub names: Vec<Name>,
31 /// The effect of this ability listed in different languages.
32 pub effect_entries: Vec<VerboseEffect>,
33 /// The list of previous effects this ability has had across version groups.
34 pub effect_changes: Vec<AbilityEffectChange>,
35 /// The flavor text of this ability listed in different languages.
36 pub flavor_text_entries: Vec<AbilityFlavorText>,
37 /// A list of Pokémon that could potentially have this ability.
38 pub pokemon: Vec<AbilityPokemon>,
39}
40
41/// [AbilityEffectChange official documentation](https://pokeapi.co/docs/v2#abilityeffectchange)
42#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
43#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
44pub struct AbilityEffectChange {
45 /// The previous effect of this ability listed in different languages.
46 pub effect_entries: Vec<Effect>,
47 /// The version group in which the previous effect of this ability originated.
48 pub version_group: NamedApiResource<VersionGroup>,
49}
50
51/// [AbilityFlavorText official documentation](https://pokeapi.co/docs/v2#abilityflavortext)
52#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
53#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
54pub struct AbilityFlavorText {
55 /// The localized name for an API resource in a specific language.
56 pub flavor_text: String,
57 /// The language this text resource is in.
58 pub language: NamedApiResource<Language>,
59 /// The version group that uses this flavor text.
60 pub version_group: NamedApiResource<VersionGroup>,
61}
62
63/// [AbilityPokemon official documentation](https://pokeapi.co/docs/v2#abilitypokemon)
64#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
65#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
66pub struct AbilityPokemon {
67 /// Whether or not this a hidden ability for the referenced Pokémon.
68 pub is_hidden: bool,
69 /// Pokémon have 3 ability 'slots' which hold references to possible abilities they could have.
70 /// This is the slot of this ability for the referenced pokemon.
71 pub slot: i64,
72 /// The Pokémon this ability could belong to.
73 pub pokemon: NamedApiResource<Pokemon>,
74}
75
76/// [Characteristic official documentation](https://pokeapi.co/docs/v2#characteristic)
77#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
78#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
79pub struct Characteristic {
80 /// The identifier for this resource.
81 pub id: i64,
82 /// The remainder of the highest stat/IV divided by 5.
83 pub gene_modulo: i64,
84 /// The possible values of the highest stat that would result in a Pokémon
85 /// receiving this characteristic when divided by 5.
86 pub possible_values: Vec<i64>,
87 /// The description of this resource listed in different languages.
88 pub descriptions: Vec<Description>,
89 /// The highest stat referenced by this characteristic.
90 pub highest_stat: NamedApiResource<Stat>,
91}
92
93/// [EggGroup official documentation](https://pokeapi.co/docs/v2#egggroup)
94#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
95#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
96pub struct EggGroup {
97 /// The identifier for this resource.
98 pub id: i64,
99 /// The name for this resource.
100 pub name: String,
101 /// The name of this resource listed in different languages.
102 pub names: Vec<Name>,
103 /// A list of all Pokémon species that are members of this egg group.
104 pub pokemon_species: Vec<NamedApiResource<PokemonSpecies>>,
105}
106
107/// [Gender official documentation](https://pokeapi.co/docs/v2#gender)
108#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
109#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
110pub struct Gender {
111 /// The identifier for this resource.
112 pub id: i64,
113 /// The name for this resource.
114 pub name: String,
115 /// A list of Pokémon species that can be this gender and how likely it is that they will be.
116 pub pokemon_species_details: Vec<PokemonSpeciesGender>,
117 /// A list of Pokémon species that required this gender in order for a Pokémon to evolve into them.
118 pub required_for_evolution: Vec<NamedApiResource<PokemonSpecies>>,
119}
120
121/// [PokemonSpeciesGender official documentation](https://pokeapi.co/docs/v2#pokemonspeciesgender)
122#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
123#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
124pub struct PokemonSpeciesGender {
125 /// The chance of this Pokémon being female, in eighths; or -1 for genderless.
126 pub rate: i64,
127 /// A Pokémon species that can be the referenced gender.
128 pub pokemon_species: NamedApiResource<PokemonSpecies>,
129}
130
131/// [GrowthRate official documentation](https://pokeapi.co/docs/v2#growthrate)
132#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
133#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
134pub struct GrowthRate {
135 /// The identifier for this resource.
136 pub id: i64,
137 /// The name for this resource.
138 pub name: String,
139 /// The formula used to calculate the rate at which the Pokémon species gains level.
140 pub formula: String,
141 /// The descriptions of this characteristic listed in different languages.
142 pub descriptions: Vec<Description>,
143 /// A list of levels and the amount of experienced needed to atain them based on this growth rate.
144 pub levels: Vec<GrowthRateExperienceLevel>,
145 /// A list of Pokémon species that gain levels at this growth rate.
146 pub pokemon_species: Vec<NamedApiResource<PokemonSpecies>>,
147}
148
149/// [GrowthRateExperienceLevel official documentation](https://pokeapi.co/docs/v2#growthrateexperiencelevel)
150#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
151#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
152pub struct GrowthRateExperienceLevel {
153 /// The level gained.
154 pub level: i64,
155 /// The amount of experience required to reach the referenced level.
156 pub experience: i64,
157}
158
159/// [Nature official documentation](https://pokeapi.co/docs/v2#nature)
160#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
161#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
162pub struct Nature {
163 /// The identifier for this resource.
164 pub id: i64,
165 /// The name for this resource.
166 pub name: String,
167 /// The stat decreased by 10% in Pokémon with this nature.
168 pub decreased_stat: Option<NamedApiResource<Stat>>,
169 /// The stat increased by 10% in Pokémon with this nature.
170 pub increased_stat: Option<NamedApiResource<Stat>>,
171 /// The flavor hated by Pokémon with this nature.
172 pub hates_flavor: Option<NamedApiResource<BerryFlavor>>,
173 /// The flavor liked by Pokémon with this nature.
174 pub likes_flavor: Option<NamedApiResource<BerryFlavor>>,
175 /// A list of Pokéathlon stats this nature effects and how much it effects them.
176 pub pokeathlon_stat_changes: Vec<NatureStatChange>,
177 /// A list of battle styles and how likely a Pokémon with this nature is to use them in the Battle Palace or Battle Tent.
178 pub move_battle_style_preferences: Vec<MoveBattleStylePreference>,
179 /// The name of this resource listed in different languages.
180 pub names: Vec<Name>,
181}
182
183/// [NatureStatChange official documentation](https://pokeapi.co/docs/v2#naturestatchange)
184#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
185#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
186pub struct NatureStatChange {
187 /// The amount of change.
188 pub max_change: i64,
189 /// The stat being affected.
190 pub pokeathlon_stat: NamedApiResource<PokeathlonStat>,
191}
192
193/// [MoveBattleStylePreference official documentation](https://pokeapi.co/docs/v2#movebattlestylepreference)
194#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
195#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
196pub struct MoveBattleStylePreference {
197 /// Chance of using the move, in percent, if HP is under one half.
198 pub low_hp_preference: i64,
199 /// Chance of using the move, in percent, if HP is over one half.
200 pub high_hp_preference: i64,
201 /// The move battle style.
202 pub move_battle_style: NamedApiResource<MoveBattleStyle>,
203}
204
205/// [PokeathlonStat official documentation](https://pokeapi.co/docs/v2#pokeathlonstat)
206#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
207#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
208pub struct PokeathlonStat {
209 /// The identifier for this resource.
210 pub id: i64,
211 /// The name for this resource.
212 pub name: String,
213 /// The name of this resource listed in different languages.
214 pub names: Vec<Name>,
215 /// A detail of natures which affect this Pokéathlon stat positively or negatively.
216 pub affecting_natures: NaturePokeathlonStatAffectSets,
217}
218
219/// [NaturePokeathlonStatAffectSets official documentation](https://pokeapi.co/docs/v2#naturepokeathlonstataffectsets)
220#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
221#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
222pub struct NaturePokeathlonStatAffectSets {
223 /// A list of natures and how they change the referenced Pokéathlon stat.
224 pub increase: Vec<NaturePokeathlonStatAffect>,
225 /// A list of natures and how they change the referenced Pokéathlon stat.
226 pub decrease: Vec<NaturePokeathlonStatAffect>,
227}
228
229/// [NaturePokeathlonStatAffect official documentation](https://pokeapi.co/docs/v2#naturepokeathlonstataffect)
230#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
231#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
232pub struct NaturePokeathlonStatAffect {
233 /// The maximum amount of change to the referenced Pokéathlon stat.
234 pub max_change: i64,
235 /// The nature causing the change.
236 pub nature: NamedApiResource<Nature>,
237}
238
239/// [Pokemon official documentation](https://pokeapi.co/docs/v2#pokemon)
240#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
241#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
242pub struct Pokemon {
243 /// The identifier for this resource.
244 pub id: i64,
245 /// The name for this resource.
246 pub name: String,
247 /// The base experience gained for defeating this Pokémon.
248 pub base_experience: Option<i64>,
249 /// The height of this Pokémon in decimetres.
250 pub height: i64,
251 /// Set for exactly one Pokémon used as the default for each species.
252 pub is_default: bool,
253 /// Order for sorting. Almost national order, except families are grouped together.
254 pub order: i64,
255 /// The weight of this Pokémon in hectograms.
256 pub weight: i64,
257 /// A list of abilities this Pokémon could potentially have.
258 pub abilities: Vec<PokemonAbility>,
259 /// A list of forms this Pokémon can take on.
260 pub forms: Vec<NamedApiResource<PokemonForm>>,
261 /// A list of game indices relevent to Pokémon item by generation.
262 pub game_indices: Vec<VersionGameIndex>,
263 /// A list of items this Pokémon may be holding when encountered.
264 pub held_items: Vec<PokemonHeldItem>,
265 /// A link to a list of location areas, as well as encounter details pertaining to specific versions.
266 pub location_area_encounters: String,
267 /// A list of moves along with learn methods and level details pertaining to specific version groups.
268 pub moves: Vec<PokemonMove>,
269 /// A list of details showing abilities this pokémon had in previous generations
270 pub past_abilities: Vec<PokemonAbilityPast>,
271 /// A list of details showing stats this pokémon had in previous generations
272 pub past_stats: Vec<PokemonStatPast>,
273 /// A list of details showing types this pokémon had in previous generations.
274 pub past_types: Vec<PokemonTypePast>,
275 /// A set of sprites used to depict this Pokémon in the game.
276 /// A visual representation of the various sprites can be found at [PokeAPI/sprites](https://github.com/PokeAPI/sprites).
277 pub sprites: PokemonSprites,
278 /// A set of cries used to depict this Pokémon in the game.
279 /// A visual representation of the various cries can be found at [PokeAPI/cries](https://github.com/PokeAPI/cries).
280 pub cries: PokemonCries,
281 /// The species this Pokémon belongs to.
282 pub species: NamedApiResource<PokemonSpecies>,
283 /// A list of base stat values for this Pokémon.
284 pub stats: Vec<PokemonStat>,
285 /// A list of details showing types this Pokémon has.
286 pub types: Vec<PokemonType>,
287}
288
289/// [PokemonAbility official documentation](https://pokeapi.co/docs/v2#pokemonability)
290#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
291#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
292pub struct PokemonAbility {
293 /// Whether or not this is a hidden ability.
294 pub is_hidden: bool,
295 /// The slot this ability occupies in this Pokémon species.
296 pub slot: i64,
297 /// The ability the Pokémon may have.
298 pub ability: Option<NamedApiResource<Ability>>,
299}
300
301/// [PokemonAbilityPast official documentation](https://pokeapi.co/docs/v2#pokemonabilitypast)
302#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
303#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
304pub struct PokemonAbilityPast {
305 /// The last generation in which the referenced pokémon had the listed abilities.
306 pub generation: NamedApiResource<Generation>,
307 /// The abilities the referenced pokémon had up to and including the listed generation.
308 /// If null, the slot was previously empty.
309 pub abilities: Vec<PokemonAbility>,
310}
311
312/// [PokemonType official documentation](https://pokeapi.co/docs/v2#pokemontype)
313#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
314#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
315pub struct PokemonType {
316 /// The order the Pokémon's types are listed in.
317 pub slot: i64,
318 /// The type the referenced Pokémon has.
319 #[serde(rename = "type")]
320 pub type_: NamedApiResource<Type>,
321}
322
323/// [PokemonTypePast official documentation](https://pokeapi.co/docs/v2#pokemontypepast)
324#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
325#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
326pub struct PokemonTypePast {
327 /// The last generation in which the referenced pokémon had the listed types.
328 pub generation: NamedApiResource<Generation>,
329 /// The types the referenced pokémon had up to and including the listed generation.
330 pub types: Vec<PokemonType>,
331}
332
333/// [PokemonHeldItem official documentation](https://pokeapi.co/docs/v2#pokemonhelditem)
334#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
335#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
336pub struct PokemonHeldItem {
337 /// The item the referenced Pokémon holds.
338 pub item: NamedApiResource<Item>,
339 /// The details of the different versions in which the item is held.
340 pub version_details: Vec<PokemonHeldItemVersion>,
341}
342
343/// [PokemonHeldItemVersion official documentation](https://pokeapi.co/docs/v2#pokemonhelditemversion)
344#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
345#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
346pub struct PokemonHeldItemVersion {
347 /// The version in which the item is held.
348 pub version: NamedApiResource<Version>,
349 /// How often the item is held.
350 pub rarity: i64,
351}
352
353/// [PokemonMove official documentation](https://pokeapi.co/docs/v2#pokemonmove)
354#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
355#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
356pub struct PokemonMove {
357 /// The move the Pokémon can learn.
358 #[serde(rename = "move")]
359 pub move_: NamedApiResource<Move>,
360 /// The details of the version in which the Pokémon can learn the move.
361 pub version_group_details: Vec<PokemonMoveVersion>,
362}
363
364/// [PokemonMoveVersion official documentation](https://pokeapi.co/docs/v2#pokemonmoveversion)
365#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
366#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
367pub struct PokemonMoveVersion {
368 /// The method by which the move is learned.
369 pub move_learn_method: NamedApiResource<MoveLearnMethod>,
370 /// The version group in which the move is learned.
371 pub version_group: NamedApiResource<VersionGroup>,
372 /// The minimum level to learn the move.
373 pub level_learned_at: i64,
374}
375
376/// [PokemonStat official documentation](https://pokeapi.co/docs/v2#pokemonstat)
377#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
378#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
379pub struct PokemonStat {
380 /// The stat the Pokémon has.
381 pub stat: NamedApiResource<Stat>,
382 /// The effort points (EV) the Pokémon has in the stat.
383 pub effort: i64,
384 /// The base value of the stat.
385 pub base_stat: i64,
386}
387
388/// [PokemonStatPast official documentation](https://pokeapi.co/docs/v2#pokemonstatpast)
389#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
390#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
391pub struct PokemonStatPast {
392 /// The last generation in which the referenced pokémon had the listed stats.
393 pub generation: NamedApiResource<Generation>,
394 /// The stat the Pokémon had up to and including the listed generation.
395 pub stats: Vec<PokemonStat>,
396}
397
398/// [PokemonSprites official documentation](https://pokeapi.co/docs/v2#pokemonsprites)
399#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
400#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
401pub struct PokemonSprites {
402 /// The default depiction of this Pokémon from the front in battle.
403 pub front_default: Option<String>,
404 /// The shiny depiction of this Pokémon from the front in battle.
405 pub front_shiny: Option<String>,
406 /// The female depiction of this Pokémon from the front in battle.
407 pub front_female: Option<String>,
408 /// The shiny female depiction of this Pokémon from the front in battle.
409 pub front_shiny_female: Option<String>,
410 /// The default depiction of this Pokémon from the back in battle.
411 pub back_default: Option<String>,
412 /// The shiny depiction of this Pokémon from the back in battle.
413 pub back_shiny: Option<String>,
414 /// The female depiction of this Pokémon from the back in battle.
415 pub back_female: Option<String>,
416 /// The shiny female depiction of this Pokémon from the back in battle.
417 pub back_shiny_female: Option<String>,
418 /// Other sprites.
419 pub other: OtherSprites,
420 /// Sprites per version.
421 pub versions: VersionsSprites,
422}
423
424/// References sprites that doesn't come from game.
425#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
426#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
427pub struct OtherSprites {
428 /// Dream world sprites of this Pokémon.
429 pub dream_world: DreamWorldSprites,
430 /// Home sprites of this Pokémon.
431 pub home: HomeSprites,
432 /// The official artwork of this Pokémon.
433 #[serde(rename = "official-artwork")]
434 pub official_artwork: OfficialArtworkSprites,
435}
436
437/// References the dream world sprites of a Pokémon.
438#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
439#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
440pub struct DreamWorldSprites {
441 /// The default despiction of this Pokémon from dream world.
442 pub front_default: Option<String>,
443 /// The female despiction of this Pokémon from dream world.
444 pub front_female: Option<String>,
445}
446
447/// References the home sprites of a Pokémon.
448#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
449#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
450pub struct HomeSprites {
451 /// The default despiction of this Pokémon from dream world.
452 pub front_default: Option<String>,
453 /// The female despiction of this Pokémon from dream world.
454 pub front_female: Option<String>,
455 /// The shiny front sprite of a Pokémon.
456 pub front_shiny: Option<String>,
457 /// The shiny female front sprite of a Pokémon.
458 pub front_shiny_female: Option<String>,
459}
460
461/// References the official artwork of a Pokémon.
462#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
463#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
464pub struct OfficialArtworkSprites {
465 /// The default despiction of this Pokémon form the official artwork.
466 pub front_default: Option<String>,
467}
468
469/// Sprites of a Pokémon, per generation.
470#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
471#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
472pub struct VersionsSprites {
473 /// Sprites for the first generation.
474 #[serde(rename = "generation-i")]
475 pub generation_i: GenerationISprites,
476 /// Sprites for the second generation.
477 #[serde(rename = "generation-ii")]
478 pub generation_ii: GenerationIISprites,
479 /// Sprites for the third generation.
480 #[serde(rename = "generation-iii")]
481 pub generation_iii: GenerationIIISprites,
482 /// Sprites for the fourth generation.
483 #[serde(rename = "generation-iv")]
484 pub generation_iv: GenerationIVSprites,
485 /// Sprites for the fifth generation.
486 #[serde(rename = "generation-v")]
487 pub generation_v: GenerationVSprites,
488 /// Sprites for the sixth generation.
489 #[serde(rename = "generation-vi")]
490 pub generation_vi: GenerationVISprites,
491 /// Sprites for the seventh generation.
492 #[serde(rename = "generation-vii")]
493 pub generation_vii: GenerationVIISprites,
494 /// Sprites for the eighth generation.
495 #[serde(rename = "generation-viii")]
496 pub generation_viii: GenerationVIIISprites,
497}
498
499/// Sprites for the first generation.
500#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
501#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
502pub struct GenerationISprites {
503 /// Sprites for Pokémon Red & Pokémon Blue.
504 #[serde(rename = "red-blue")]
505 pub red_blue: RedBlueSprites,
506 /// Sprites for Pokémon Yellow.
507 pub yellow: YellowSprites,
508}
509
510/// Sprites for Pokémon Red & Pokémon Blue.
511#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
512#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
513pub struct RedBlueSprites {
514 /// The default back sprite of a Pokémon.
515 pub back_default: Option<String>,
516 /// The default back sprite of a Pokémon, in gray.
517 pub back_gray: Option<String>,
518 /// The default back sprite of a Pokémon, transparent.
519 pub back_transparent: Option<String>,
520 /// The default front sprite of a Pokémon.
521 pub front_default: Option<String>,
522 /// The default front sprite of a Pokémon, in gray.
523 pub front_gray: Option<String>,
524 /// The default front sprite of a Pokémon, transparent.
525 pub front_transparent: Option<String>,
526}
527
528/// Sprites for Pokémon Yellow.
529#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
530#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
531pub struct YellowSprites {
532 /// The default back sprite of a Pokémon.
533 pub back_default: Option<String>,
534 /// The default back sprite of a Pokémon, in gray.
535 pub back_gray: Option<String>,
536 /// The default back sprite of a Pokémon, transparent.
537 pub back_transparent: Option<String>,
538 /// The default front sprite of a Pokémon.
539 pub front_default: Option<String>,
540 /// The default front sprite of a Pokémon, in gray.
541 pub front_gray: Option<String>,
542 /// The default front sprite of a Pokémon, transparent.
543 pub front_transparent: Option<String>,
544}
545
546/// Sprites for the second generation.
547#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
548#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
549pub struct GenerationIISprites {
550 /// Sprites for Pokémon Crystal.
551 pub crystal: CrystalSprites,
552 /// Sprites for Pokémon Gold.
553 pub gold: GoldSprites,
554 /// Sprites for Pokémon Silver.
555 pub silver: SilverSprites,
556}
557
558/// Sprites for Pokémon Crystal.
559#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
560#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
561pub struct CrystalSprites {
562 /// The default back sprite of a Pokémon.
563 pub back_default: Option<String>,
564 /// The shiny back sprite of a Pokémon.
565 pub back_shiny: Option<String>,
566 /// The default back sprite of a Pokémon, transparent.
567 pub back_transparent: Option<String>,
568 /// The shiny back sprite of a Pokémon, transparent.
569 pub back_shiny_transparent: Option<String>,
570 /// The default front sprite of a Pokémon.
571 pub front_default: Option<String>,
572 /// The shiny front sprite of a Pokémon.
573 pub front_shiny: Option<String>,
574 /// The default front sprite of a Pokémon, transparent.
575 pub front_transparent: Option<String>,
576 /// The shiny front sprite of a Pokémon, transparent.
577 pub front_shiny_transparent: Option<String>,
578}
579
580/// Sprites for Pokémon Gold.
581#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
582#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
583pub struct GoldSprites {
584 /// The default back sprite of a Pokémon.
585 pub back_default: Option<String>,
586 /// The shiny back sprite of a Pokémon.
587 pub back_shiny: Option<String>,
588 /// The default front sprite of a Pokémon.
589 pub front_default: Option<String>,
590 /// The shiny front sprite of a Pokémon.
591 pub front_shiny: Option<String>,
592 /// The default front sprite of a Pokémon, transparent.
593 pub front_transparent: Option<String>,
594}
595
596/// Sprites for Pokémon Silver.
597#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
598#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
599pub struct SilverSprites {
600 /// The default back sprite of a Pokémon.
601 pub back_default: Option<String>,
602 /// The shiny back sprite of a Pokémon.
603 pub back_shiny: Option<String>,
604 /// The default front sprite of a Pokémon.
605 pub front_default: Option<String>,
606 /// The shiny front sprite of a Pokémon.
607 pub front_shiny: Option<String>,
608 /// The default front sprite of a Pokémon, transparent.
609 pub front_transparent: Option<String>,
610}
611
612/// Sprites for the third generation.
613#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
614#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
615pub struct GenerationIIISprites {
616 /// Sprites for Pokémon Emerald.
617 pub emerald: EmeraldSprites,
618 /// Sprites for Pokémon `FireRed` & Pokémon `LeafGreen`.
619 #[serde(rename = "firered-leafgreen")]
620 pub firered_leafgreen: FireredLeafgreenSprites,
621 /// Sprites for Pokémon Ruby & Pokémon Sapphire.
622 #[serde(rename = "ruby-sapphire")]
623 pub ruby_sapphire: RubySapphireSprites,
624}
625
626/// Sprites for Pokémon Emerald.
627#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
628#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
629pub struct EmeraldSprites {
630 /// The default front sprite of a Pokémon.
631 pub front_default: Option<String>,
632 /// The shiny front sprite of a Pokémon.
633 pub front_shiny: Option<String>,
634}
635
636/// Sprites for Pokémon `FireRed` & Pokémon `LeafGreen`.
637#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
638#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
639pub struct FireredLeafgreenSprites {
640 /// The default back sprite of a Pokémon.
641 pub back_default: Option<String>,
642 /// The shiny back sprite of a Pokémon.
643 pub back_shiny: Option<String>,
644 /// The default front sprite of a Pokémon.
645 pub front_default: Option<String>,
646 /// The shiny front sprite of a Pokémon.
647 pub front_shiny: Option<String>,
648}
649
650/// Sprites for Pokémon Ruby & Pokémon Sapphire.
651#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
652#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
653pub struct RubySapphireSprites {
654 /// The default back sprite of a Pokémon.
655 pub back_default: Option<String>,
656 /// The shiny back sprite of a Pokémon.
657 pub back_shiny: Option<String>,
658 /// The default front sprite of a Pokémon.
659 pub front_default: Option<String>,
660 /// The shiny front sprite of a Pokémon.
661 pub front_shiny: Option<String>,
662}
663
664/// Sprites for the fourth generation.
665#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
666#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
667pub struct GenerationIVSprites {
668 /// Sprites for Pokémon Diamond & Pokémon Pearl.
669 #[serde(rename = "diamond-pearl")]
670 pub diamond_pearl: DiamondPearlSprites,
671 /// Sprites for Pokémon Platinum.
672 pub platinum: PlatinumSprites,
673 /// Sprites for Pokémon `HeartGold` & Pokémon `SoulSilver`.
674 #[serde(rename = "heartgold-soulsilver")]
675 pub heartgold_soulsilver: HeartgoldSoulsilverSprites,
676}
677
678/// Sprites for Pokémon Diamond & Pokémon Pearl.
679#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
680#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
681pub struct DiamondPearlSprites {
682 /// The default back sprite of a Pokémon.
683 pub back_default: Option<String>,
684 /// The default female back sprite of a Pokémon.
685 pub back_female: Option<String>,
686 /// The shiny back sprite of a Pokémon.
687 pub back_shiny: Option<String>,
688 /// The shiny female back sprite of a Pokémon.
689 pub back_shiny_female: Option<String>,
690 /// The default front sprite of a Pokémon.
691 pub front_default: Option<String>,
692 /// The default female front sprite of a Pokémon.
693 pub front_female: Option<String>,
694 /// The shiny front sprite of a Pokémon.
695 pub front_shiny: Option<String>,
696 /// The shiny female front sprite of a Pokémon.
697 pub front_shiny_female: Option<String>,
698}
699
700/// Sprites for Pokémon Platinum.
701#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
702#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
703pub struct PlatinumSprites {
704 /// The default back sprite of a Pokémon.
705 pub back_default: Option<String>,
706 /// The default female back sprite of a Pokémon.
707 pub back_female: Option<String>,
708 /// The shiny back sprite of a Pokémon.
709 pub back_shiny: Option<String>,
710 /// The shiny female back sprite of a Pokémon.
711 pub back_shiny_female: Option<String>,
712 /// The default front sprite of a Pokémon.
713 pub front_default: Option<String>,
714 /// The default female front sprite of a Pokémon.
715 pub front_female: Option<String>,
716 /// The shiny front sprite of a Pokémon.
717 pub front_shiny: Option<String>,
718 /// The shiny female front sprite of a Pokémon.
719 pub front_shiny_female: Option<String>,
720}
721
722/// Sprites for Pokémon `HeartGold` & Pokémon `SoulSilver`.
723#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
724#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
725pub struct HeartgoldSoulsilverSprites {
726 /// The default back sprite of a Pokémon.
727 pub back_default: Option<String>,
728 /// The default female back sprite of a Pokémon.
729 pub back_female: Option<String>,
730 /// The shiny back sprite of a Pokémon.
731 pub back_shiny: Option<String>,
732 /// The shiny female back sprite of a Pokémon.
733 pub back_shiny_female: Option<String>,
734 /// The default front sprite of a Pokémon.
735 pub front_default: Option<String>,
736 /// The default female front sprite of a Pokémon.
737 pub front_female: Option<String>,
738 /// The shiny front sprite of a Pokémon.
739 pub front_shiny: Option<String>,
740 /// The shiny female front sprite of a Pokémon.
741 pub front_shiny_female: Option<String>,
742}
743
744/// Sprites for the fifth generation.
745#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
746#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
747pub struct GenerationVSprites {
748 /// Sprites for Pokémon Black & Pokémon White.
749 #[serde(rename = "black-white")]
750 pub black_white: BlackWhiteSprites,
751}
752
753/// Sprites for Pokémon Black & Pokémon White.
754#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
755#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
756pub struct BlackWhiteSprites {
757 /// The animated sprites for a Pokémon.
758 pub animated: BlackWhiteAnimatedSprites,
759 /// The default back sprite of a Pokémon.
760 pub back_default: Option<String>,
761 /// The default female back sprite of a Pokémon.
762 pub back_female: Option<String>,
763 /// The shiny back sprite of a Pokémon.
764 pub back_shiny: Option<String>,
765 /// The shiny female back sprite of a Pokémon.
766 pub back_shiny_female: Option<String>,
767 /// The default front sprite of a Pokémon.
768 pub front_default: Option<String>,
769 /// The default female front sprite of a Pokémon.
770 pub front_female: Option<String>,
771 /// The shiny front sprite of a Pokémon.
772 pub front_shiny: Option<String>,
773 /// The shiny female front sprite of a Pokémon.
774 pub front_shiny_female: Option<String>,
775}
776
777/// The animated sprites for a Pokémon.
778#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
779#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
780pub struct BlackWhiteAnimatedSprites {
781 /// The default back sprite of a Pokémon.
782 pub back_default: Option<String>,
783 /// The default female back sprite of a Pokémon.
784 pub back_female: Option<String>,
785 /// The shiny back sprite of a Pokémon.
786 pub back_shiny: Option<String>,
787 /// The shiny female back sprite of a Pokémon.
788 pub back_shiny_female: Option<String>,
789 /// The default front sprite of a Pokémon.
790 pub front_default: Option<String>,
791 /// The default female front sprite of a Pokémon.
792 pub front_female: Option<String>,
793 /// The shiny front sprite of a Pokémon.
794 pub front_shiny: Option<String>,
795 /// The shiny female front sprite of a Pokémon.
796 pub front_shiny_female: Option<String>,
797}
798
799/// Sprites for the sixth generation.
800#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
801#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
802pub struct GenerationVISprites {
803 /// Sprites for Pokémon `OmegaRuby` & Pokémon `AlphaSapphire`.
804 #[serde(rename = "omegaruby-alphasapphire")]
805 pub omegaruby_alphasapphire: OmegarubyAlphasapphireSprites,
806 /// Sprites for Pokémon X & Pokémon Y.
807 #[serde(rename = "x-y")]
808 pub x_y: XYSprites,
809}
810
811/// Sprites for Pokémon `OmegaRuby` & Pokémon `AlphaSapphire`.
812#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
813#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
814pub struct OmegarubyAlphasapphireSprites {
815 /// The default front sprite of a Pokémon.
816 pub front_default: Option<String>,
817 /// The default female front sprite of a Pokémon.
818 pub front_female: Option<String>,
819 /// The shiny front sprite of a Pokémon.
820 pub front_shiny: Option<String>,
821 /// The shiny female front sprite of a Pokémon.
822 pub front_shiny_female: Option<String>,
823}
824
825/// Sprites for Pokémon X & Pokémon Y.
826#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
827#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
828pub struct XYSprites {
829 /// The default front sprite of a Pokémon.
830 pub front_default: Option<String>,
831 /// The default female front sprite of a Pokémon.
832 pub front_female: Option<String>,
833 /// The shiny front sprite of a Pokémon.
834 pub front_shiny: Option<String>,
835 /// The shiny female front sprite of a Pokémon.
836 pub front_shiny_female: Option<String>,
837}
838
839/// Sprites for the seventh generation.
840#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
841#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
842pub struct GenerationVIISprites {
843 /// The icons sprites of a Pokémon.
844 pub icons: IconsSprites,
845 /// Sprites for Pokémon `UltraSun` & Pokémon `UltraMoon`.
846 #[serde(rename = "ultra-sun-ultra-moon")]
847 pub ultrasun_ultramoon: UltrasunUltramoonSprites,
848}
849
850/// The icons sprites of a Pokémon.
851#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
852#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
853pub struct IconsSprites {
854 /// The default front sprite of a Pokémon.
855 pub front_default: Option<String>,
856 /// The default female front sprite of a Pokémon.
857 pub front_female: Option<String>,
858}
859
860/// Sprites for Pokémon `UltraSun` & Pokémon `UltraMoon`.
861#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
862#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
863pub struct UltrasunUltramoonSprites {
864 /// The default front sprite of a Pokémon.
865 pub front_default: Option<String>,
866 /// The default female front sprite of a Pokémon.
867 pub front_female: Option<String>,
868 /// The shiny front sprite of a Pokémon.
869 pub front_shiny: Option<String>,
870 /// The shiny female front sprite of a Pokémon.
871 pub front_shiny_female: Option<String>,
872}
873
874/// Sprites for the eighth generation.
875#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
876#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
877pub struct GenerationVIIISprites {
878 /// The icons sprites of a Pokémon.
879 pub icons: IconsSprites,
880}
881
882/// [PokemonCries official documentation](https://pokeapi.co/docs/v2#pokemoncries)
883#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
884#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
885pub struct PokemonCries {
886 /// The latest depiction of this Pokémon's cry.
887 pub latest: Option<String>,
888 /// The legacy depiction of this Pokémon's cry.
889 pub legacy: Option<String>,
890}
891
892/// [LocationAreaEncounter official documentation](https://pokeapi.co/docs/v2#locationareaencounter)
893#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
894#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
895pub struct LocationAreaEncounter {
896 /// The location area the referenced Pokémon can be encountered in.
897 pub location_area: NamedApiResource<LocationArea>,
898 /// A list of versions and encounters with the referenced Pokémon that might happen.
899 pub version_details: Vec<VersionEncounterDetail>,
900}
901
902/// [PokemonColor official documentation](https://pokeapi.co/docs/v2#pokemoncolor)
903#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
904#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
905pub struct PokemonColor {
906 /// The identifier for this resource.
907 pub id: i64,
908 /// The name for this resource.
909 pub name: String,
910 /// The name of this resource listed in different languages.
911 pub names: Vec<Name>,
912 /// A list of the Pokémon species that have this color.
913 pub pokemon_species: Vec<NamedApiResource<PokemonSpecies>>,
914}
915
916/// [PokemonForm official documentation](https://pokeapi.co/docs/v2#pokemonform)
917#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
918#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
919pub struct PokemonForm {
920 /// The identifier for this resource.
921 pub id: i64,
922 /// The name for this resource.
923 pub name: String,
924 /// The order in which forms should be sorted within all forms. Multiple forms may have equal order,
925 /// in which case they should fall back on sorting by name.
926 pub order: i64,
927 /// The order in which forms should be sorted within a species' forms.
928 pub form_order: i64,
929 /// True for exactly one form used as the default for each Pokémon.
930 pub is_default: bool,
931 /// Whether or not this form can only happen during battle.
932 pub is_battle_only: bool,
933 /// Whether or not this form requires mega evolution.
934 pub is_mega: bool,
935 /// The name of this form.
936 pub form_name: String,
937 /// The Pokémon that can take on this form.
938 pub pokemon: NamedApiResource<Pokemon>,
939 /// A list of details showing types this Pokémon form has.
940 pub types: Vec<PokemonFormType>,
941 /// A set of sprites used to depict this Pokémon form in the game.
942 pub sprites: PokemonFormSprites,
943 /// The version group this Pokémon form was introduced in.
944 pub version_group: NamedApiResource<VersionGroup>,
945 /// The form specific full name of this Pokémon form, or empty if the form does not have a specific name.
946 pub names: Vec<Name>,
947 /// The form specific form name of this Pokémon form, or empty if the form does not have a specific name.
948 pub form_names: Vec<Name>,
949}
950
951/// [PokemonFormType official documentation](https://pokeapi.co/docs/v2#pokemonformtype)
952#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
953#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
954pub struct PokemonFormType {
955 /// The order the Pokémon's types are listed in.
956 pub slot: i64,
957 /// The type the referenced Form has.
958 #[serde(rename = "type")]
959 pub type_: NamedApiResource<Type>,
960}
961
962/// [PokemonFormSprites official documentation](https://pokeapi.co/docs/v2#pokemonformsprites)
963#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
964#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
965pub struct PokemonFormSprites {
966 /// The default back sprite of a Pokémon.
967 pub back_default: Option<String>,
968 /// The default female back sprite of a Pokémon.
969 pub back_female: Option<String>,
970 /// The shiny back sprite of a Pokémon.
971 pub back_shiny: Option<String>,
972 /// The shiny female back sprite of a Pokémon.
973 pub back_shiny_female: Option<String>,
974 /// The default front sprite of a Pokémon.
975 pub front_default: Option<String>,
976 /// The default female front sprite of a Pokémon.
977 pub front_female: Option<String>,
978 /// The shiny front sprite of a Pokémon.
979 pub front_shiny: Option<String>,
980 /// The shiny female front sprite of a Pokémon.
981 pub front_shiny_female: Option<String>,
982}
983
984/// [PokemonHabitat official documentation](https://pokeapi.co/docs/v2#pokemonhabitat)
985#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
986#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
987pub struct PokemonHabitat {
988 /// The identifier for this resource.
989 pub id: i64,
990 /// The name for this resource.
991 pub name: String,
992 /// The name of this resource listed in different languages.
993 pub names: Vec<Name>,
994 /// A list of the Pokémon species that can be found in this habitat.
995 pub pokemon_species: Vec<NamedApiResource<PokemonSpecies>>,
996}
997
998/// [PokemonShape official documentation](https://pokeapi.co/docs/v2#pokemonshape)
999#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1000#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1001pub struct PokemonShape {
1002 /// The identifier for this resource.
1003 pub id: i64,
1004 /// The name for this resource.
1005 pub name: String,
1006 /// The "scientific" name of this Pokémon shape listed in different languages.
1007 pub awesome_names: Vec<AwesomeName>,
1008 /// The name of this resource listed in different languages.
1009 pub names: Vec<Name>,
1010 /// A list of the Pokémon species that have this shape.
1011 pub pokemon_species: Vec<NamedApiResource<PokemonSpecies>>,
1012}
1013
1014/// [AwesomeName official documentation](https://pokeapi.co/docs/v2#awesomename)
1015#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1016#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1017pub struct AwesomeName {
1018 /// The localized "scientific" name for an API resource in a specific language.
1019 pub awesome_name: String,
1020 /// The language this "scientific" name is in.
1021 pub language: NamedApiResource<Language>,
1022}
1023
1024/// [PokemonSpecies official documentation](https://pokeapi.co/docs/v2#pokemonspecies)
1025#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1026#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1027pub struct PokemonSpecies {
1028 /// The identifier for this resource.
1029 pub id: i64,
1030 /// The name for this resource.
1031 pub name: String,
1032 /// The order in which species should be sorted. Based on National Dex order,
1033 /// except families are grouped together and sorted by stage.
1034 pub order: i64,
1035 /// The chance of this Pokémon being female, in eighths; or -1 for genderless.
1036 pub gender_rate: i64,
1037 /// The base capture rate; up to 255. The higher the number, the easier the catch.
1038 pub capture_rate: i64,
1039 /// The happiness when caught by a normal Pokéball; up to 255. The higher the number, the happier the Pokémon.
1040 pub base_happiness: Option<i64>,
1041 /// Whether or not this is a baby Pokémon.
1042 pub is_baby: bool,
1043 /// Whether or not this is a legendary Pokémon.
1044 pub is_legendary: bool,
1045 /// Whether or not this is a mythical Pokémon.
1046 pub is_mythical: bool,
1047 /// Initial hatch counter: one must walk 255 × (`hatch_counter` + 1) steps before this Pokémon's egg hatches,
1048 /// unless utilizing bonuses like Flame Body's.
1049 pub hatch_counter: Option<i64>,
1050 /// Whether or not this Pokémon has visual gender differences.
1051 pub has_gender_differences: bool,
1052 /// Whether or not this Pokémon has multiple forms and can switch between them.
1053 pub forms_switchable: bool,
1054 /// The rate at which this Pokémon species gains levels.
1055 pub growth_rate: NamedApiResource<GrowthRate>,
1056 /// A list of Pokedexes and the indexes reserved within them for this Pokémon species.
1057 pub pokedex_numbers: Vec<PokemonSpeciesDexEntry>,
1058 /// A list of egg groups this Pokémon species is a member of.
1059 pub egg_groups: Vec<NamedApiResource<EggGroup>>,
1060 /// The color of this Pokémon for Pokédex search.
1061 pub color: NamedApiResource<PokemonColor>,
1062 /// The shape of this Pokémon for Pokédex search.
1063 pub shape: Option<NamedApiResource<PokemonShape>>,
1064 /// The Pokémon species that evolves into this `Pokemon_species`.
1065 pub evolves_from_species: Option<NamedApiResource<PokemonSpecies>>,
1066 /// The evolution chain this Pokémon species is a member of.
1067 pub evolution_chain: Option<ApiResource<EvolutionChain>>,
1068 /// The habitat this Pokémon species can be encountered in.
1069 pub habitat: Option<NamedApiResource<PokemonHabitat>>,
1070 /// The generation this Pokémon species was introduced in.
1071 pub generation: NamedApiResource<Generation>,
1072 /// The name of this resource listed in different languages.
1073 pub names: Vec<Name>,
1074 /// A list of encounters that can be had with this Pokémon species in pal park.
1075 pub pal_park_encounters: Vec<PalParkEncounterArea>,
1076 /// A list of flavor text entries for this Pokémon species.
1077 pub flavor_text_entries: Vec<FlavorText>,
1078 /// Descriptions of different forms Pokémon take on within the Pokémon species.
1079 pub form_descriptions: Vec<Description>,
1080 /// The genus of this Pokémon species listed in multiple languages.
1081 pub genera: Vec<Genus>,
1082 /// A list of the Pokémon that exist within this Pokémon species.
1083 pub varieties: Vec<PokemonSpeciesVariety>,
1084}
1085
1086/// [Genus official documentation](https://pokeapi.co/docs/v2#genus)
1087#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1088#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1089pub struct Genus {
1090 /// The localized genus for the referenced Pokémon species.
1091 pub genus: String,
1092 /// The language this genus is in.
1093 pub language: NamedApiResource<Language>,
1094}
1095
1096/// [PokemonSpeciesDexEntry official documentation](https://pokeapi.co/docs/v2#pokemonspeciesdexentry)
1097#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1098#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1099pub struct PokemonSpeciesDexEntry {
1100 /// The index number within the Pokédex.
1101 pub entry_number: i64,
1102 /// The Pokédex the referenced Pokémon species can be found in.
1103 pub pokedex: NamedApiResource<Pokedex>,
1104}
1105
1106/// [PalParkEncounterArea official documentation](https://pokeapi.co/docs/v2#palparkencounterarea)
1107#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1108#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1109pub struct PalParkEncounterArea {
1110 /// The base score given to the player when the referenced Pokémon is caught during a pal park run.
1111 pub base_score: i64,
1112 /// The base rate for encountering the referenced Pokémon in this pal park area.
1113 pub rate: i64,
1114 /// The pal park area where this encounter happens.
1115 pub area: NamedApiResource<PalParkArea>,
1116}
1117
1118/// [PokemonSpeciesVariety official documentation](https://pokeapi.co/docs/v2#pokemonspeciesvariety)
1119#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1120#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1121pub struct PokemonSpeciesVariety {
1122 /// Whether this variety is the default variety.
1123 pub is_default: bool,
1124 /// The Pokémon variety.
1125 pub pokemon: NamedApiResource<Pokemon>,
1126}
1127
1128/// [Stat official documentation](https://pokeapi.co/docs/v2#stat)
1129#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1130#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1131pub struct Stat {
1132 /// The identifier for this resource.
1133 pub id: i64,
1134 /// The name for this resource.
1135 pub name: String,
1136 /// ID the games use for this stat.
1137 pub game_index: i64,
1138 /// Whether this stat only exists within a battle.
1139 pub is_battle_only: bool,
1140 /// A detail of moves which affect this stat positively or negatively.
1141 pub affecting_moves: MoveStatAffectSets,
1142 /// A detail of natures which affect this stat positively or negatively.
1143 pub affecting_natures: NatureStatAffectSets,
1144 /// A list of characteristics that are set on a Pokémon when its highest base stat is this stat.
1145 pub characteristics: Vec<ApiResource<Characteristic>>,
1146 /// The class of damage this stat is directly related to.
1147 pub move_damage_class: Option<NamedApiResource<MoveDamageClass>>,
1148 /// The name of this resource listed in different languages.
1149 pub names: Vec<Name>,
1150}
1151
1152/// [MoveStatAffectSets official documentation](https://pokeapi.co/docs/v2#movestataffectsets)
1153#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1154#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1155pub struct MoveStatAffectSets {
1156 /// A list of moves and how they change the referenced stat.
1157 pub increase: Vec<MoveStatAffect>,
1158 /// A list of moves and how they change the referenced stat.
1159 pub decrease: Vec<MoveStatAffect>,
1160}
1161
1162/// [MoveStatAffect official documentation](https://pokeapi.co/docs/v2#movestataffect)
1163#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1164#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1165pub struct MoveStatAffect {
1166 /// The maximum amount of change to the referenced stat.
1167 pub change: i64,
1168 /// The move causing the change.
1169 #[serde(rename = "move")]
1170 pub move_: NamedApiResource<Move>,
1171}
1172
1173/// [NatureStatAffectSets official documentation](https://pokeapi.co/docs/v2#naturestataffectsets)
1174#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1175#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1176pub struct NatureStatAffectSets {
1177 /// A list of natures and how they change the referenced stat.
1178 pub increase: Vec<NamedApiResource<Nature>>,
1179 /// A list of nature sand how they change the referenced stat.
1180 pub decrease: Vec<NamedApiResource<Nature>>,
1181}
1182
1183/// [Type official documentation](https://pokeapi.co/docs/v2#type)
1184#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1185#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1186pub struct Type {
1187 /// The identifier for this resource.
1188 pub id: i64,
1189 /// The name for this resource.
1190 pub name: String,
1191 /// A detail of how effective this type is toward others and vice versa.
1192 pub damage_relations: TypeRelations,
1193 /// A list of details of how effective this type was toward others and vice versa in previous generations.
1194 pub past_damage_relations: Vec<TypeRelationsPast>,
1195 /// A list of game indices relevent to this item by generation.
1196 pub game_indices: Vec<GenerationGameIndex>,
1197 /// The generation this type was introduced in.
1198 pub generation: NamedApiResource<Generation>,
1199 /// The class of damage inflicted by this type.
1200 pub move_damage_class: Option<NamedApiResource<MoveDamageClass>>,
1201 /// The name of this resource listed in different languages.
1202 pub names: Vec<Name>,
1203 /// A list of details of Pokémon that have this type.
1204 pub pokemon: Vec<TypePokemon>,
1205 /// A list of moves that have this type.
1206 pub moves: Vec<NamedApiResource<Move>>,
1207}
1208
1209/// [TypePokemon official documentation](https://pokeapi.co/docs/v2#typepokemon)
1210#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1211#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1212pub struct TypePokemon {
1213 /// The order the Pokémon's types are listed in.
1214 pub slot: i64,
1215 /// The Pokémon that has the referenced type.
1216 pub pokemon: NamedApiResource<Pokemon>,
1217}
1218
1219/// [TypeRelations official documentation](https://pokeapi.co/docs/v2#typerelations)
1220#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1221#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1222pub struct TypeRelations {
1223 /// A list of types this type has no effect on.
1224 pub no_damage_to: Vec<NamedApiResource<Type>>,
1225 /// A list of types this type is not very effect against.
1226 pub half_damage_to: Vec<NamedApiResource<Type>>,
1227 /// A list of types this type is very effect against.
1228 pub double_damage_to: Vec<NamedApiResource<Type>>,
1229 /// A list of types that have no effect on this type.
1230 pub no_damage_from: Vec<NamedApiResource<Type>>,
1231 /// A list of types that are not very effective against this type.
1232 pub half_damage_from: Vec<NamedApiResource<Type>>,
1233 /// A list of types that are very effective against this type.
1234 pub double_damage_from: Vec<NamedApiResource<Type>>,
1235}
1236
1237/// [TypeRelationsPast official documentation](https://pokeapi.co/docs/v2#typerelationspast)
1238#[derive(Debug, Clone, PartialEq, Eq, serde::Deserialize)]
1239#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
1240pub struct TypeRelationsPast {
1241 /// The last generation in which the referenced type had the listed damage relations.
1242 pub generation: NamedApiResource<Generation>,
1243 /// The damage relations the referenced type had up to and including the listed generation.
1244 pub damage_relations: TypeRelations,
1245}