amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Pricing
 *
 * The Selling Partner API for Pricing helps you programmatically retrieve product pricing and offer information for Amazon Marketplace products.
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Summary : Contains price information about the product, including the LowestPrices and BuyBoxPrices, the ListPrice, the SuggestedLowerPricePlusShipping, and NumberOfOffers and NumberOfBuyBoxEligibleOffers.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Summary {
    /// The number of unique offers contained in NumberOfOffers.
    #[serde(rename = "TotalOfferCount")]
    pub total_offer_count: i32,
    /// A list that contains the total number of offers information for given conditions and fulfillment channels.
    #[serde(rename = "NumberOfOffers", skip_serializing_if = "Option::is_none")]
    pub number_of_offers: Option<Vec<models::product_pricing_v0::OfferCountType>>,
    /// A list of the lowest prices.
    #[serde(rename = "LowestPrices", skip_serializing_if = "Option::is_none")]
    pub lowest_prices: Option<Vec<models::product_pricing_v0::LowestPriceType>>,
    /// A list of the Buy Box prices.
    #[serde(rename = "BuyBoxPrices", skip_serializing_if = "Option::is_none")]
    pub buy_box_prices: Option<Vec<models::product_pricing_v0::BuyBoxPriceType>>,
    #[serde(rename = "ListPrice", skip_serializing_if = "Option::is_none")]
    pub list_price: Option<Box<models::product_pricing_v0::MoneyType>>,
    #[serde(rename = "CompetitivePriceThreshold", skip_serializing_if = "Option::is_none")]
    pub competitive_price_threshold: Option<Box<models::product_pricing_v0::MoneyType>>,
    #[serde(rename = "SuggestedLowerPricePlusShipping", skip_serializing_if = "Option::is_none")]
    pub suggested_lower_price_plus_shipping: Option<Box<models::product_pricing_v0::MoneyType>>,
    /// A list of sales rank information for the item, by category.
    #[serde(rename = "SalesRankings", skip_serializing_if = "Option::is_none")]
    pub sales_rankings: Option<Vec<models::product_pricing_v0::SalesRankType>>,
    /// A list that contains the total number of offers that are eligible for the Buy Box for the given conditions and fulfillment channels.
    #[serde(rename = "BuyBoxEligibleOffers", skip_serializing_if = "Option::is_none")]
    pub buy_box_eligible_offers: Option<Vec<models::product_pricing_v0::OfferCountType>>,
    /// When the status is ActiveButTooSoonForProcessing, this is the time when the offers will be available for processing.
    #[serde(rename = "OffersAvailableTime", skip_serializing_if = "Option::is_none")]
    pub offers_available_time: Option<String>,
}

impl Summary {
    /// Contains price information about the product, including the LowestPrices and BuyBoxPrices, the ListPrice, the SuggestedLowerPricePlusShipping, and NumberOfOffers and NumberOfBuyBoxEligibleOffers.
    pub fn new(total_offer_count: i32) -> Summary {
        Summary {
            total_offer_count,
            number_of_offers: None,
            lowest_prices: None,
            buy_box_prices: None,
            list_price: None,
            competitive_price_threshold: None,
            suggested_lower_price_plus_shipping: None,
            sales_rankings: None,
            buy_box_eligible_offers: None,
            offers_available_time: None,
        }
    }
}