amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Services
 *
 * With the Services API, you can build applications that help service providers get and modify their service orders and manage their resources.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Address : The shipping address for the service job.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Address {
    /// The name of the person, business, or institution.
    #[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.
    #[serde(rename = "city", skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// The county.
    #[serde(rename = "county", skip_serializing_if = "Option::is_none")]
    pub county: Option<String>,
    /// The district.
    #[serde(rename = "district", skip_serializing_if = "Option::is_none")]
    pub district: Option<String>,
    /// The state or region.
    #[serde(rename = "stateOrRegion", skip_serializing_if = "Option::is_none")]
    pub state_or_region: Option<String>,
    /// The postal code. This can contain letters, digits, spaces, and/or punctuation.
    #[serde(rename = "postalCode", skip_serializing_if = "Option::is_none")]
    pub postal_code: Option<String>,
    /// The two digit country code, in ISO 3166-1 alpha-2 format.
    #[serde(rename = "countryCode", skip_serializing_if = "Option::is_none")]
    pub country_code: Option<String>,
    /// The phone number.
    #[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
    pub phone: Option<String>,
}

impl Address {
    /// The shipping address for the service job.
    pub fn new(name: String, address_line1: String) -> Address {
        Address {
            name,
            address_line1,
            address_line2: None,
            address_line3: None,
            city: None,
            county: None,
            district: None,
            state_or_region: None,
            postal_code: None,
            country_code: None,
            phone: None,
        }
    }
}