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
//! Berries group models
use super::{
contests::ContestType,
items::Item,
pokemon::Type,
resource::{Name, NamedApiResource},
};
/// [Berry official documentation](https:///pokeapi.co/docs/v2#berry)
#[derive(Default, Debug, Clone, PartialEq, serde::Deserialize)]
pub struct Berry {
/// The identifier for this resource.
pub id: Option<i64>,
/// The name for this resource.
pub name: Option<String>,
/// Time it takes the tree to grow one stage, in hours.
/// Berry trees go through four of these growth stages before they can be picked.
pub growth_time: Option<i64>,
/// The maximum number of these berries that can grow on one tree in Generation IV.
pub max_harvest: Option<i64>,
/// The power of the move "Natural Gift" when used with this Berry.
pub natural_gift_power: Option<i64>,
/// The size of this Berry, in millimeters.
pub size: Option<i64>,
/// The smoothness of this Berry, used in making Pokéblocks or Poffins.
pub smoothness: Option<i64>,
/// The speed at which this Berry dries out the soil as it grows.
/// A higher rate means the soil dries more quickly.
pub soil_dryness: Option<i64>,
/// The firmness of this berry, used in making Pokéblocks or Poffins.
pub firmness: Option<NamedApiResource<BerryFirmness>>,
/// A list of references to each flavor a berry can have and the potency
/// of each of those flavors in regard to this berry.
pub flavors: Option<Vec<BerryFlavorMap>>,
/// Berries are actually items. This is a reference to the item specific data for this berry.
pub item: Option<NamedApiResource<Item>>,
/// The type inherited by "Natural Gift" when used with this Berry.
pub natural_gift_type: Option<NamedApiResource<Type>>,
}
/// [BerryFlavorMap official documentation](https:///pokeapi.co/docs/v2#berryflavormap)
#[derive(Default, Debug, Clone, PartialEq, serde::Deserialize)]
pub struct BerryFlavorMap {
/// How powerful the referenced flavor is for this berry.
pub potency: Option<i64>,
/// The referenced berry flavor.
pub flavor: Option<NamedApiResource<BerryFlavor>>,
}
/// [BerryFirmness official documentation](https:///pokeapi.co/docs/v2#berryfirmness)
#[derive(Default, Debug, Clone, PartialEq, serde::Deserialize)]
pub struct BerryFirmness {
/// The identifier for this resource.
pub id: Option<i64>,
/// The name for this resource.
pub name: Option<String>,
/// A list of the berries with this firmness.
pub berries: Option<Vec<NamedApiResource<Berry>>>,
/// The name of this resource listed in different languages.
pub names: Option<Vec<Name>>,
}
/// [BerryFlavor official documentation](https:///pokeapi.co/docs/v2#berryflavor)
#[derive(Default, Debug, Clone, PartialEq, serde::Deserialize)]
pub struct BerryFlavor {
/// The identifier for this resource.
pub id: Option<i64>,
/// The name for this resource.
pub name: Option<String>,
/// A list of the berries with this flavor.
pub berries: Option<Vec<FlavorBerryMap>>,
/// The contest type that correlates with this berry flavor.
pub contest_type: Option<NamedApiResource<ContestType>>,
/// The name of this resource listed in different languages.
pub names: Option<Vec<Name>>,
}
/// [FlavorBerryMap official documentation](https:///pokeapi.co/docs/v2#flavorberrymap)
#[derive(Default, Debug, Clone, PartialEq, serde::Deserialize)]
pub struct FlavorBerryMap {
/// How powerful the referenced flavor is for this berry.
pub potency: Option<i64>,
/// The berry with the referenced flavor.
pub berry: Option<NamedApiResource<Berry>>,
}