amazon_spapi/models/shipping/address.rs
1/*
2 * Selling Partner API for Shipping
3 *
4 * Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of <a href=\"https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference\">Amazon Shipping API (v2)</a> on the <a href=\"https://developer-docs.amazon.com/amazon-shipping/\">Amazon Shipping Developer Documentation</a> site.
5 *
6 * The version of the OpenAPI document: v1
7 *
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 that address.
18 #[serde(rename = "name")]
19 pub name: String,
20 /// First line of that 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 state or region where the person, business or institution is located.
30 #[serde(rename = "stateOrRegion")]
31 pub state_or_region: String,
32 /// The city where the person, business or institution is located.
33 #[serde(rename = "city")]
34 pub city: String,
35 /// The two digit country code. In ISO 3166-1 alpha-2 format.
36 #[serde(rename = "countryCode")]
37 pub country_code: String,
38 /// The postal code of that address. It contains a series of letters or digits or both, sometimes including spaces or punctuation.
39 #[serde(rename = "postalCode")]
40 pub postal_code: String,
41 /// The email address of the contact associated with the address.
42 #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
43 pub email: Option<String>,
44 /// The email cc addresses of the contact associated with the address.
45 #[serde(rename = "copyEmails", skip_serializing_if = "Option::is_none")]
46 pub copy_emails: Option<Vec<String>>,
47 /// The phone number of the person, business or institution located at that address.
48 #[serde(rename = "phoneNumber", skip_serializing_if = "Option::is_none")]
49 pub phone_number: Option<String>,
50}
51
52impl Address {
53 /// The address.
54 pub fn new(name: String, address_line1: String, state_or_region: String, city: String, country_code: String, postal_code: String) -> Address {
55 Address {
56 name,
57 address_line1,
58 address_line2: None,
59 address_line3: None,
60 state_or_region,
61 city,
62 country_code,
63 postal_code,
64 email: None,
65 copy_emails: None,
66 phone_number: None,
67 }
68 }
69}
70