Skip to main content

amazon_spapi/models/merchant_fulfillment_v0/
address.rs

1/*
2 * Selling Partner API for Merchant Fulfillment
3 *
4 * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services.
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Address : The postal address information.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Address {
17    /// The name of the addressee, or business name.
18    #[serde(rename = "Name")]
19    pub name: String,
20    /// The street address information.
21    #[serde(rename = "AddressLine1")]
22    pub address_line1: String,
23    /// Additional street address information.
24    #[serde(rename = "AddressLine2", skip_serializing_if = "Option::is_none")]
25    pub address_line2: Option<String>,
26    /// Additional street address information.
27    #[serde(rename = "AddressLine3", skip_serializing_if = "Option::is_none")]
28    pub address_line3: Option<String>,
29    /// The district or county.
30    #[serde(rename = "DistrictOrCounty", skip_serializing_if = "Option::is_none")]
31    pub district_or_county: Option<String>,
32    /// The email address.
33    #[serde(rename = "Email")]
34    pub email: String,
35    /// The city.
36    #[serde(rename = "City")]
37    pub city: String,
38    /// The state or province code. This is a required field in Canada, US, and UK marketplaces, and for shipments that originate in China.
39    #[serde(rename = "StateOrProvinceCode", skip_serializing_if = "Option::is_none")]
40    pub state_or_province_code: Option<String>,
41    /// The zip code or postal code.
42    #[serde(rename = "PostalCode")]
43    pub postal_code: String,
44    /// The two-letter country code in [ISO 3166-1 alpha-2](https://www.iban.com/country-codes) format.
45    #[serde(rename = "CountryCode")]
46    pub country_code: String,
47    /// The phone number.
48    #[serde(rename = "Phone")]
49    pub phone: String,
50}
51
52impl Address {
53    /// The postal address information.
54    pub fn new(name: String, address_line1: String, email: String, city: String, postal_code: String, country_code: String, phone: String) -> Address {
55        Address {
56            name,
57            address_line1,
58            address_line2: None,
59            address_line3: None,
60            district_or_county: None,
61            email,
62            city,
63            state_or_province_code: None,
64            postal_code,
65            country_code,
66            phone,
67        }
68    }
69}
70