Skip to main content

amazon_spapi/models/fulfillment_outbound_2020_07_01/
address.rs

1/*
2 * Selling Partner APIs for Fulfillment Outbound
3 *
4 * The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders.
5 *
6 * The version of the OpenAPI document: 2020-07-01
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Address : A physical address.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Address {
17    /// The name of the person, business or institution at the address.
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 where the person, business, or institution is located. This property is required in all countries except Japan. It should not be used in Japan.
30    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
31    pub city: Option<String>,
32    /// The district or county where the person, business, or institution is located.
33    #[serde(rename = "districtOrCounty", skip_serializing_if = "Option::is_none")]
34    pub district_or_county: Option<String>,
35    /// The state or region where the person, business or institution is located.
36    #[serde(rename = "stateOrRegion")]
37    pub state_or_region: String,
38    /// The postal code of the address.
39    #[serde(rename = "postalCode")]
40    pub postal_code: String,
41    /// The two digit country code. In ISO 3166-1 alpha-2 format.
42    #[serde(rename = "countryCode")]
43    pub country_code: String,
44    /// The phone number of the person, business, or institution located at the address.
45    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
46    pub phone: Option<String>,
47}
48
49impl Address {
50    /// A physical address.
51    pub fn new(name: String, address_line1: String, state_or_region: String, postal_code: String, country_code: String) -> Address {
52        Address {
53            name,
54            address_line1,
55            address_line2: None,
56            address_line3: None,
57            city: None,
58            district_or_county: None,
59            state_or_region,
60            postal_code,
61            country_code,
62            phone: None,
63        }
64    }
65}
66