amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Catalog Items
 *
 * Use the Selling Partner API for Catalog Items to retrieve information about items in the Amazon catalog.  For more information, refer to the [Catalog Items API Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/:catalog-items-api-v2022-04-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2022-04-01
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Item : An item in the Amazon catalog.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Item {
    /// The unique identifier of an item in the Amazon catalog.
    #[serde(rename = "asin")]
    pub asin: String,
    /// A JSON object containing structured item attribute data that is keyed by attribute name. Catalog item attributes conform to the related Amazon product type definitions that you can get from the [Product Type Definitions API](https://developer-docs.amazon.com/sp-api/reference/product-type-definitions-v2020-09-01).
    #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
    pub attributes: Option<std::collections::HashMap<String, serde_json::Value>>,
    /// An array of classifications (browse nodes) that is associated with the item in the Amazon catalog, grouped by `marketplaceId`.
    #[serde(rename = "classifications", skip_serializing_if = "Option::is_none")]
    pub classifications: Option<Vec<models::catalog_items_2022_04_01::ItemBrowseClassificationsByMarketplace>>,
    /// An array of dimensions that are associated with the item in the Amazon catalog, grouped by `marketplaceId`.
    #[serde(rename = "dimensions", skip_serializing_if = "Option::is_none")]
    pub dimensions: Option<Vec<models::catalog_items_2022_04_01::ItemDimensionsByMarketplace>>,
    /// Identifiers associated with the item in the Amazon catalog, such as UPC and EAN identifiers.
    #[serde(rename = "identifiers", skip_serializing_if = "Option::is_none")]
    pub identifiers: Option<Vec<models::catalog_items_2022_04_01::ItemIdentifiersByMarketplace>>,
    /// The images for an item in the Amazon catalog.
    #[serde(rename = "images", skip_serializing_if = "Option::is_none")]
    pub images: Option<Vec<models::catalog_items_2022_04_01::ItemImagesByMarketplace>>,
    /// Product types that are associated with the Amazon catalog item.
    #[serde(rename = "productTypes", skip_serializing_if = "Option::is_none")]
    pub product_types: Option<Vec<models::catalog_items_2022_04_01::ItemProductTypeByMarketplace>>,
    /// Relationships grouped by `marketplaceId` for an Amazon catalog item (for example, variations).
    #[serde(rename = "relationships", skip_serializing_if = "Option::is_none")]
    pub relationships: Option<Vec<models::catalog_items_2022_04_01::ItemRelationshipsByMarketplace>>,
    /// Sales ranks of an Amazon catalog item.
    #[serde(rename = "salesRanks", skip_serializing_if = "Option::is_none")]
    pub sales_ranks: Option<Vec<models::catalog_items_2022_04_01::ItemSalesRanksByMarketplace>>,
    /// Summaries of Amazon catalog items.
    #[serde(rename = "summaries", skip_serializing_if = "Option::is_none")]
    pub summaries: Option<Vec<models::catalog_items_2022_04_01::ItemSummaryByMarketplace>>,
    /// The vendor details that are associated with an Amazon catalog item. Vendor details are only available to vendors.
    #[serde(rename = "vendorDetails", skip_serializing_if = "Option::is_none")]
    pub vendor_details: Option<Vec<models::catalog_items_2022_04_01::ItemVendorDetailsByMarketplace>>,
}

impl Item {
    /// An item in the Amazon catalog.
    pub fn new(asin: String) -> Item {
        Item {
            asin,
            attributes: None,
            classifications: None,
            dimensions: None,
            identifiers: None,
            images: None,
            product_types: None,
            relationships: None,
            sales_ranks: None,
            summaries: None,
            vendor_details: None,
        }
    }
}