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
/*
 * Selling Partner API for Retail Procurement Shipments
 *
 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Address : Address of the party.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Address {
    /// The name of the person, business or institution at that address.
    #[serde(default, rename = "name")]
    pub name: String,
    /// First line of the address.
    #[serde(default, rename = "addressLine1")]
    pub address_line1: String,
    /// Additional street address information, if required.
    #[serde(default, rename = "addressLine2", skip_serializing_if = "Option::is_none")]
    pub address_line2: Option<String>,
    /// Additional street address information, if required.
    #[serde(default, rename = "addressLine3", skip_serializing_if = "Option::is_none")]
    pub address_line3: Option<String>,
    /// The city where the person, business or institution is located.
    #[serde(default, rename = "city", skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// The county where person, business or institution is located.
    #[serde(default, rename = "county", skip_serializing_if = "Option::is_none")]
    pub county: Option<String>,
    /// The district where person, business or institution is located.
    #[serde(default, rename = "district", skip_serializing_if = "Option::is_none")]
    pub district: Option<String>,
    /// The state or region where person, business or institution is located.
    #[serde(default, rename = "stateOrRegion", skip_serializing_if = "Option::is_none")]
    pub state_or_region: Option<String>,
    /// The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
    #[serde(default, rename = "postalCode", skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
    /// The two digit country code in ISO 3166-1 alpha-2 format.
    #[serde(default, rename = "countryCode")]
    pub country_code: String,
    /// The phone number of the person, business or institution located at that address.
    #[serde(default, rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
}

impl Address {
    /// Address of the party.
    pub fn new(name: String, address_line1: String, country_code: String) -> Address {
        Address {
            name,
            address_line1,
            address_line2: None,
            address_line3: None,
            city: None,
            county: None,
            district: None,
            state_or_region: None,
            postal_code: None,
            country_code,
            phone: None,
        }
    }
}