amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Merchant Fulfillment
 *
 * 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.
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Address : The postal address information.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Address {
    /// The name of the addressee, or business name.
    #[serde(rename = "Name")]
    pub name: String,
    /// The street address information.
    #[serde(rename = "AddressLine1")]
    pub address_line1: String,
    /// Additional street address information.
    #[serde(rename = "AddressLine2", skip_serializing_if = "Option::is_none")]
    pub address_line2: Option<String>,
    /// Additional street address information.
    #[serde(rename = "AddressLine3", skip_serializing_if = "Option::is_none")]
    pub address_line3: Option<String>,
    /// The district or county.
    #[serde(rename = "DistrictOrCounty", skip_serializing_if = "Option::is_none")]
    pub district_or_county: Option<String>,
    /// The email address.
    #[serde(rename = "Email")]
    pub email: String,
    /// The city.
    #[serde(rename = "City")]
    pub city: String,
    /// The state or province code. This is a required field in Canada, US, and UK marketplaces, and for shipments that originate in China.
    #[serde(rename = "StateOrProvinceCode", skip_serializing_if = "Option::is_none")]
    pub state_or_province_code: Option<String>,
    /// The zip code or postal code.
    #[serde(rename = "PostalCode")]
    pub postal_code: String,
    /// The two-letter country code in [ISO 3166-1 alpha-2](https://www.iban.com/country-codes) format.
    #[serde(rename = "CountryCode")]
    pub country_code: String,
    /// The phone number.
    #[serde(rename = "Phone")]
    pub phone: String,
}

impl Address {
    /// The postal address information.
    pub fn new(name: String, address_line1: String, email: String, city: String, postal_code: String, country_code: String, phone: String) -> Address {
        Address {
            name,
            address_line1,
            address_line2: None,
            address_line3: None,
            district_or_county: None,
            email,
            city,
            state_or_province_code: None,
            postal_code,
            country_code,
            phone,
        }
    }
}