1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* Amazon Shipping API
*
* 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.
*
* The version of the OpenAPI document: v2
* Contact: swa-api-core@amazon.com
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Address : The address.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Address {
/// The name of the person, business or institution at the address.
#[serde(rename = "name")]
pub name: String,
/// The first line of the address.
#[serde(rename = "addressLine1")]
pub address_line1: String,
/// Additional address information, if required.
#[serde(rename = "addressLine2", skip_serializing_if = "Option::is_none")]
pub address_line2: Option<String>,
/// Additional address information, if required.
#[serde(rename = "addressLine3", skip_serializing_if = "Option::is_none")]
pub address_line3: Option<String>,
/// The name of the business or institution associated with the address.
#[serde(rename = "companyName", skip_serializing_if = "Option::is_none")]
pub company_name: Option<String>,
/// The state, county or region where the person, business or institution is located.
#[serde(rename = "stateOrRegion")]
pub state_or_region: String,
/// The city or town where the person, business or institution is located.
#[serde(rename = "city")]
pub city: String,
/// The two digit country code. Follows ISO 3166-1 alpha-2 format.
#[serde(rename = "countryCode")]
pub country_code: String,
/// The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
#[serde(rename = "postalCode")]
pub postal_code: String,
/// The email address of the contact associated with the address.
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
/// The phone number of the person, business or institution located at that address, including the country calling code.
#[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
pub phone_number: Option<String>,
#[serde(rename = "geocode", skip_serializing_if = "Option::is_none")]
pub geocode: Option<Box<models::shipping_v2::Geocode>>,
}
impl Address {
/// The address.
pub fn new(name: String, address_line1: String, state_or_region: String, city: String, country_code: String, postal_code: String) -> Address {
Address {
name,
address_line1,
address_line2: None,
address_line3: None,
company_name: None,
state_or_region,
city,
country_code,
postal_code,
email: None,
phone_number: None,
geocode: None,
}
}
}