amazon_spapi/models/services/
address.rs

1/*
2 * Selling Partner API for Services
3 *
4 * With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Address : The shipping address for the service job.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Address {
17    /// The name of the person, business, or institution.
18    #[serde(rename = "name")]
19    pub name: String,
20    /// The first line of the address.
21    #[serde(rename = "addressLine1")]
22    pub address_line1: String,
23    /// Additional address information, if required.
24    #[serde(rename = "addressLine2", skip_serializing_if = "Option::is_none")]
25    pub address_line2: Option<String>,
26    /// Additional address information, if required.
27    #[serde(rename = "addressLine3", skip_serializing_if = "Option::is_none")]
28    pub address_line3: Option<String>,
29    /// The city.
30    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
31    pub city: Option<String>,
32    /// The county.
33    #[serde(rename = "county", skip_serializing_if = "Option::is_none")]
34    pub county: Option<String>,
35    /// The district.
36    #[serde(rename = "district", skip_serializing_if = "Option::is_none")]
37    pub district: Option<String>,
38    /// The state or region.
39    #[serde(rename = "stateOrRegion", skip_serializing_if = "Option::is_none")]
40    pub state_or_region: Option<String>,
41    /// The postal code. This can contain letters, digits, spaces, and/or punctuation.
42    #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
43    pub postal_code: Option<String>,
44    /// The two digit country code, in ISO 3166-1 alpha-2 format.
45    #[serde(rename = "countryCode", skip_serializing_if = "Option::is_none")]
46    pub country_code: Option<String>,
47    /// The phone number.
48    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
49    pub phone: Option<String>,
50}
51
52impl Address {
53    /// The shipping address for the service job.
54    pub fn new(name: String, address_line1: String) -> Address {
55        Address {
56            name,
57            address_line1,
58            address_line2: None,
59            address_line3: None,
60            city: None,
61            county: None,
62            district: None,
63            state_or_region: None,
64            postal_code: None,
65            country_code: None,
66            phone: None,
67        }
68    }
69}
70