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
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Contact {
#[serde(rename = "user_id", skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
#[serde(rename = "contact_type", skip_serializing_if = "Option::is_none")]
pub contact_type: Option<ContactType>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
#[serde(rename = "customer_id", skip_serializing_if = "Option::is_none")]
pub customer_id: Option<String>,
}
impl Contact {
pub fn new() -> Contact {
Contact {
user_id: None,
contact_type: None,
name: None,
email: None,
phone: None,
customer_id: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ContactType {
#[serde(rename = "primary")]
Primary,
#[serde(rename = "billing")]
Billing,
#[serde(rename = "technical")]
Technical,
#[serde(rename = "security")]
Security,
#[serde(rename = "emergency")]
Emergency,
#[serde(rename = "general compliance")]
GeneralCompliance,
}
impl Default for ContactType {
fn default() -> ContactType {
Self::Primary
}
}