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
87
88
89
90
91
92
93
/*
 * Selling Partner API for Orders
 *
 * The Selling Partner API for Orders helps you programmatically retrieve order information. These APIs let you develop fast, flexible, custom applications in areas like order synchronization, order research, and demand-based decision support tools.
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Address : The shipping address for the order.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Address {
    /// The name.
    #[serde(default, rename = "Name")]
    pub name: String,
    /// The street address.
    #[serde(default, rename = "AddressLine1", skip_serializing_if = "Option::is_none")]
    pub address_line1: Option<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 
    #[serde(default, rename = "City", skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// The county.
    #[serde(default, rename = "County", skip_serializing_if = "Option::is_none")]
    pub county: Option<String>,
    /// The district.
    #[serde(default, rename = "District", skip_serializing_if = "Option::is_none")]
    pub district: Option<String>,
    /// The state or region.
    #[serde(default, rename = "StateOrRegion", skip_serializing_if = "Option::is_none")]
    pub state_or_region: Option<String>,
    /// The municipality.
    #[serde(default, rename = "Municipality", skip_serializing_if = "Option::is_none")]
    pub municipality: Option<String>,
    /// The postal code.
    #[serde(default, rename = "PostalCode", skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
    /// The country code. A two-character country code, in ISO 3166-1 alpha-2 format.
    #[serde(default, rename = "CountryCode", skip_serializing_if = "Option::is_none")]
    pub country_code: Option<String>,
    /// The phone number. Not returned for Fulfillment by Amazon (FBA) orders.
    #[serde(default, rename = "Phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
    /// The address type of the shipping address.
    #[serde(default, rename = "AddressType", skip_serializing_if = "Option::is_none")]
    pub address_type: Option<AddressType>,
}

impl Address {
    /// The shipping address for the order.
    pub fn new(name: String) -> Address {
        Address {
            name,
            address_line1: None,
            address_line2: None,
            address_line3: None,
            city: None,
            county: None,
            district: None,
            state_or_region: None,
            municipality: None,
            postal_code: None,
            country_code: None,
            phone: None,
            address_type: None,
        }
    }
}

/// The address type of the shipping address.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum AddressType {
    #[serde(rename = "Residential")]
    Residential,
    #[serde(rename = "Commercial")]
    Commercial,
}

impl Default for AddressType {
    fn default() -> AddressType {
        Self::Residential
    }
}