amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Listings Items
 *
 * The Selling Partner API for Listings Items (Listings Items API) provides programmatic access to selling partner listings on Amazon. Use this API in collaboration with the Selling Partner API for Product Type Definitions, which you use to retrieve the information about Amazon product types needed to use the Listings Items API.  For more information, see the [Listings Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/listings-items-api-v2021-08-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2021-08-01
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Item : A listings item.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Item {
    /// A selling partner provided identifier for an Amazon listing.
    #[serde(rename = "sku")]
    pub sku: String,
    /// Summary details of a listings item.
    #[serde(rename = "summaries", skip_serializing_if = "Option::is_none")]
    pub summaries: Option<Vec<models::listings_items_2021_08_01::ItemSummaryByMarketplace>>,
    /// A JSON object containing structured listings item attribute data keyed by attribute name.
    #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
    pub attributes: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// The issues associated with the listings item.
    #[serde(rename = "issues", skip_serializing_if = "Option::is_none")]
    pub issues: Option<Vec<models::listings_items_2021_08_01::Issue>>,
    /// Offer details for the listings item.
    #[serde(rename = "offers", skip_serializing_if = "Option::is_none")]
    pub offers: Option<Vec<models::listings_items_2021_08_01::ItemOfferByMarketplace>>,
    /// The fulfillment availability for the listings item.
    #[serde(rename = "fulfillmentAvailability", skip_serializing_if = "Option::is_none")]
    pub fulfillment_availability: Option<Vec<models::listings_items_2021_08_01::FulfillmentAvailability>>,
    /// The vendor procurement information for the listings item.
    #[serde(rename = "procurement", skip_serializing_if = "Option::is_none")]
    pub procurement: Option<Vec<models::listings_items_2021_08_01::ItemProcurement>>,
    /// Relationships for a listing item, by marketplace (for example, variations).
    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
    pub relationships: Option<Vec<models::listings_items_2021_08_01::ItemRelationshipsByMarketplace>>,
    /// Product types for a listing item, by marketplace.
    #[serde(rename = "productTypes", skip_serializing_if = "Option::is_none")]
    pub product_types: Option<Vec<models::listings_items_2021_08_01::ItemProductTypeByMarketplace>>,
}

impl Item {
    /// A listings item.
    pub fn new(sku: String) -> Item {
        Item {
            sku,
            summaries: None,
            attributes: None,
            issues: None,
            offers: None,
            fulfillment_availability: None,
            procurement: None,
            relationships: None,
            product_types: None,
        }
    }
}