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 pricing information for Amazon Marketplace products.  For more information, refer to the [Product Pricing v2022-05-01 Use Case Guide](https://developer-docs.amazon.com/sp-api/docs/product-pricing-api-v2022-05-01-use-case-guide).
 *
 * The version of the OpenAPI document: 2022-05-01
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Offer : The offer data of a product.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Offer {
    /// The seller identifier for the offer.
    #[serde(rename = "sellerId")]
    pub seller_id: String,
    #[serde(rename = "condition")]
    pub condition: models::product_pricing_2022_05_01::Condition,
    /// The item subcondition of the offer.
    #[serde(rename = "subCondition", skip_serializing_if = "Option::is_none")]
    pub sub_condition: Option<SubCondition>,
    #[serde(rename = "fulfillmentType")]
    pub fulfillment_type: models::product_pricing_2022_05_01::FulfillmentType,
    #[serde(rename = "listingPrice")]
    pub listing_price: Box<models::product_pricing_2022_05_01::MoneyType>,
    /// A list of shipping options associated with this offer
    #[serde(rename = "shippingOptions", skip_serializing_if = "Option::is_none")]
    pub shipping_options: Option<Vec<models::product_pricing_2022_05_01::ShippingOption>>,
    #[serde(rename = "points", skip_serializing_if = "Option::is_none")]
    pub points: Option<Box<models::product_pricing_2022_05_01::Points>>,
    #[serde(rename = "primeDetails", skip_serializing_if = "Option::is_none")]
    pub prime_details: Option<Box<models::product_pricing_2022_05_01::PrimeDetails>>,
}

impl Offer {
    /// The offer data of a product.
    pub fn new(seller_id: String, condition: models::product_pricing_2022_05_01::Condition, fulfillment_type: models::product_pricing_2022_05_01::FulfillmentType, listing_price: models::product_pricing_2022_05_01::MoneyType) -> Offer {
        Offer {
            seller_id,
            condition,
            sub_condition: None,
            fulfillment_type,
            listing_price: Box::new(listing_price),
            shipping_options: None,
            points: None,
            prime_details: None,
        }
    }
}
/// The item subcondition of the offer.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SubCondition {
    #[serde(rename = "New")]
    New,
    #[serde(rename = "Mint")]
    Mint,
    #[serde(rename = "VeryGood")]
    VeryGood,
    #[serde(rename = "Good")]
    Good,
    #[serde(rename = "Acceptable")]
    Acceptable,
    #[serde(rename = "Poor")]
    Poor,
    #[serde(rename = "Club")]
    Club,
    #[serde(rename = "OEM")]
    Oem,
    #[serde(rename = "Warranty")]
    Warranty,
    #[serde(rename = "RefurbishedWarranty")]
    RefurbishedWarranty,
    #[serde(rename = "Refurbished")]
    Refurbished,
    #[serde(rename = "OpenBox")]
    OpenBox,
    #[serde(rename = "Other")]
    Other,
}

impl Default for SubCondition {
    fn default() -> SubCondition {
        Self::New
    }
}