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
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Address {
#[serde(default, rename = "Name")]
pub name: String,
#[serde(default, rename = "AddressLine1")]
pub address_line1: String,
#[serde(default, rename = "AddressLine2", skip_serializing_if = "Option::is_none")]
pub address_line2: Option<String>,
#[serde(default, rename = "AddressLine3", skip_serializing_if = "Option::is_none")]
pub address_line3: Option<String>,
#[serde(default, rename = "DistrictOrCounty", skip_serializing_if = "Option::is_none")]
pub district_or_county: Option<String>,
#[serde(default, rename = "Email")]
pub email: String,
#[serde(default, rename = "City")]
pub city: String,
#[serde(default, rename = "StateOrProvinceCode", skip_serializing_if = "Option::is_none")]
pub state_or_province_code: Option<String>,
#[serde(default, rename = "PostalCode")]
pub postal_code: String,
#[serde(default, rename = "CountryCode")]
pub country_code: String,
#[serde(default, rename = "Phone")]
pub phone: String,
}
impl Address {
pub fn new(name: String, address_line1: String, email: String, city: String, postal_code: String, country_code: String, phone: String) -> Address {
Address {
name,
address_line1,
address_line2: None,
address_line3: None,
district_or_county: None,
email,
city,
state_or_province_code: None,
postal_code,
country_code,
phone,
}
}
}