amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Amazon Warehousing and Distribution
 *
 * The Selling Partner API for Amazon Warehousing and Distribution (AWD) provides programmatic access to information about AWD shipments and inventory.
 *
 * The version of the OpenAPI document: 2024-05-09
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// ProductQuantity : Represents a product with the SKU details and the corresponding quantity.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ProductQuantity {
    /// Contains attributes for this instance of the product. For example, item color, or other attributes that distinguish the product beyond the SKU. This is metadata for the product and Amazon does not process this data.
    #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
    pub attributes: Option<Vec<models::awd_2024_05_09::ProductAttribute>>,
    /// Product quantity.
    #[serde(rename = "quantity")]
    pub quantity: i32,
    /// The seller or merchant SKU.
    #[serde(rename = "sku")]
    pub sku: String,
    /// The expiration date for the SKU. Values are in [ISO 8601](https://developer-docs.amazon.com/sp-api/docs/iso-8601) date-time format.
    #[serde(rename = "expiration", skip_serializing_if = "Option::is_none")]
    pub expiration: Option<String>,
    #[serde(rename = "prepDetails", skip_serializing_if = "Option::is_none")]
    pub prep_details: Option<Box<models::awd_2024_05_09::PrepDetails>>,
}

impl ProductQuantity {
    /// Represents a product with the SKU details and the corresponding quantity.
    pub fn new(quantity: i32, sku: String) -> ProductQuantity {
        ProductQuantity {
            attributes: None,
            quantity,
            sku,
            expiration: None,
            prep_details: None,
        }
    }
}