amazon_spapi/models/awd_2024_05_09/
address.rs

1/*
2 * The Selling Partner API for Amazon Warehousing and Distribution
3 *
4 * The Selling Partner API for Amazon Warehousing and Distribution (AWD) provides programmatic access to information about AWD shipments and inventory.
5 *
6 * The version of the OpenAPI document: 2024-05-09
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Address : Shipping address that represents the origin or destination location.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Address {
17    /// First line of the address text.
18    #[serde(rename = "addressLine1")]
19    pub address_line1: String,
20    /// Optional second line of the address text.
21    #[serde(rename = "addressLine2", skip_serializing_if = "Option::is_none")]
22    pub address_line2: Option<String>,
23    /// Optional third line of the address text.
24    #[serde(rename = "addressLine3", skip_serializing_if = "Option::is_none")]
25    pub address_line3: Option<String>,
26    /// Optional city where this address is located.
27    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
28    pub city: Option<String>,
29    /// Two-digit, ISO 3166-1 alpha-2 formatted country code where this address is located.
30    #[serde(rename = "countryCode")]
31    pub country_code: String,
32    /// Optional county where this address is located.
33    #[serde(rename = "county", skip_serializing_if = "Option::is_none")]
34    pub county: Option<String>,
35    /// Optional district where this address is located.
36    #[serde(rename = "district", skip_serializing_if = "Option::is_none")]
37    pub district: Option<String>,
38    /// Name of the person, business, or institution at this address.
39    #[serde(rename = "name")]
40    pub name: String,
41    /// Optional E.164-formatted phone number for an available contact at this address.
42    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
43    pub phone_number: Option<String>,
44    /// Optional postal code where this address is located.
45    #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
46    pub postal_code: Option<String>,
47    /// State or region where this address is located. Note that this is contextual to the specified country code.
48    #[serde(rename = "stateOrRegion")]
49    pub state_or_region: String,
50}
51
52impl Address {
53    /// Shipping address that represents the origin or destination location.
54    pub fn new(address_line1: String, country_code: String, name: String, state_or_region: String) -> Address {
55        Address {
56            address_line1,
57            address_line2: None,
58            address_line3: None,
59            city: None,
60            country_code,
61            county: None,
62            district: None,
63            name,
64            phone_number: None,
65            postal_code: None,
66            state_or_region,
67        }
68    }
69}
70