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 Services
 *
 * With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Address : The shipping address for the service job.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Address {
    /// The name of the person, business, or institution.
    #[serde(default, rename = "name")]
    pub name: String,
    /// The first line of the address.
    #[serde(default, rename = "addressLine1")]
    pub address_line1: String,
    /// Additional address information, if required.
    #[serde(default, rename = "addressLine2", skip_serializing_if = "Option::is_none")]
    pub address_line2: Option<String>,
    /// Additional 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 postal code. This can contain letters, digits, spaces, and/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", skip_serializing_if = "Option::is_none")]
    pub country_code: Option<String>,
    /// The phone number.
    #[serde(default, rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
}

impl Address {
    /// The shipping address for the service job.
    pub fn new(name: String, address_line1: 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: None,
            phone: None,
        }
    }
}