Skip to main content

amazon_spapi/models/shipping_v2/
address.rs

1/*
2 * Amazon Shipping API
3 *
4 * The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
5 *
6 * The version of the OpenAPI document: v2
7 * Contact: swa-api-core@amazon.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Address : The 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 name of the business or institution associated with the address.
30    #[serde(rename = "companyName", skip_serializing_if = "Option::is_none")]
31    pub company_name: Option<String>,
32    /// The state, county or region where the person, business or institution is located.
33    #[serde(rename = "stateOrRegion")]
34    pub state_or_region: String,
35    /// The city or town where the person, business or institution is located.
36    #[serde(rename = "city")]
37    pub city: String,
38    /// The two digit country code. Follows ISO 3166-1 alpha-2 format.
39    #[serde(rename = "countryCode")]
40    pub country_code: String,
41    /// The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
42    #[serde(rename = "postalCode")]
43    pub postal_code: String,
44    /// The email address of the contact associated with the address.
45    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
46    pub email: Option<String>,
47    /// The phone number of the person, business or institution located at that address, including the country calling code.
48    #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
49    pub phone_number: Option<String>,
50    #[serde(rename = "geocode", skip_serializing_if = "Option::is_none")]
51    pub geocode: Option<Box<models::shipping_v2::Geocode>>,
52}
53
54impl Address {
55    /// The address.
56    pub fn new(name: String, address_line1: String, state_or_region: String, city: String, country_code: String, postal_code: String) -> Address {
57        Address {
58            name,
59            address_line1,
60            address_line2: None,
61            address_line3: None,
62            company_name: None,
63            state_or_region,
64            city,
65            country_code,
66            postal_code,
67            email: None,
68            phone_number: None,
69            geocode: None,
70        }
71    }
72}
73