amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Sellers
 *
 * The [Selling Partner API for Sellers](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) (Sellers API) provides essential information about seller accounts, such as:  - The marketplaces a seller can list in - The default language and currency of a marketplace - Whether the seller has suspended listings  Refer to the [Sellers API reference](https://developer-docs.amazon.com/sp-api/docs/sellers-api-v1-reference) for details about this API's operations, data types, and schemas.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Address : Represents an address
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Address {
    /// 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>,
    /// The country code in two-character ISO 3166-1 alpha-2 format.
    #[serde(rename = "countryCode")]
    pub country_code: String,
    /// The state or province code.
    #[serde(rename = "stateOrProvinceCode", skip_serializing_if = "Option::is_none")]
    pub state_or_province_code: Option<String>,
    /// The city.
    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// The postal code.
    #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
}

impl Address {
    /// Represents an address
    pub fn new(address_line1: String, country_code: String) -> Address {
        Address {
            address_line1,
            address_line2: None,
            country_code,
            state_or_province_code: None,
            city: None,
            postal_code: None,
        }
    }
}