amazon-spapi 2.0.3

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

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

/// Address : A physical 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 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.
    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// The district or county where the person, business, or institution is located.
    #[serde(rename = "districtOrCounty", skip_serializing_if = "Option::is_none")]
    pub district_or_county: Option<String>,
    /// The state or region where the person, business or institution is located.
    #[serde(rename = "stateOrRegion")]
    pub state_or_region: String,
    /// The postal code of the address.
    #[serde(rename = "postalCode")]
    pub postal_code: String,
    /// The two digit country code. In ISO 3166-1 alpha-2 format.
    #[serde(rename = "countryCode")]
    pub country_code: String,
    /// The phone number of the person, business, or institution located at the address.
    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
}

impl Address {
    /// A physical address.
    pub fn new(name: String, address_line1: String, state_or_region: String, postal_code: String, country_code: String) -> Address {
        Address {
            name,
            address_line1,
            address_line2: None,
            address_line3: None,
            city: None,
            district_or_county: None,
            state_or_region,
            postal_code,
            country_code,
            phone: None,
        }
    }
}