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
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Restriction {
#[serde(default, rename = "marketplaceId")]
pub marketplace_id: String,
#[serde(default, rename = "conditionType", skip_serializing_if = "Option::is_none")]
pub condition_type: Option<ConditionType>,
#[serde(default, rename = "reasons", skip_serializing_if = "Option::is_none")]
pub reasons: Option<Vec<crate::models::Reason>>,
}
impl Restriction {
pub fn new(marketplace_id: String) -> Restriction {
Restriction {
marketplace_id,
condition_type: None,
reasons: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ConditionType {
#[serde(rename = "new_new")]
NewNew,
#[serde(rename = "new_open_box")]
NewOpenBox,
#[serde(rename = "new_oem")]
NewOem,
#[serde(rename = "refurbished_refurbished")]
RefurbishedRefurbished,
#[serde(rename = "used_like_new")]
UsedLikeNew,
#[serde(rename = "used_very_good")]
UsedVeryGood,
#[serde(rename = "used_good")]
UsedGood,
#[serde(rename = "used_acceptable")]
UsedAcceptable,
#[serde(rename = "collectible_like_new")]
CollectibleLikeNew,
#[serde(rename = "collectible_very_good")]
CollectibleVeryGood,
#[serde(rename = "collectible_good")]
CollectibleGood,
#[serde(rename = "collectible_acceptable")]
CollectibleAcceptable,
#[serde(rename = "club_club")]
ClubClub,
}
impl Default for ConditionType {
fn default() -> ConditionType {
Self::NewNew
}
}