Skip to main content

amazon_spapi/models/product_pricing_2022_05_01/
offer.rs

1/*
2 * Selling Partner API for Pricing
3 *
4 * 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).
5 *
6 * The version of the OpenAPI document: 2022-05-01
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Offer : The offer data of a product.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Offer {
17    /// The seller identifier for the offer.
18    #[serde(rename = "sellerId")]
19    pub seller_id: String,
20    #[serde(rename = "condition")]
21    pub condition: models::product_pricing_2022_05_01::Condition,
22    /// The item subcondition of the offer.
23    #[serde(rename = "subCondition", skip_serializing_if = "Option::is_none")]
24    pub sub_condition: Option<SubCondition>,
25    #[serde(rename = "fulfillmentType")]
26    pub fulfillment_type: models::product_pricing_2022_05_01::FulfillmentType,
27    #[serde(rename = "listingPrice")]
28    pub listing_price: Box<models::product_pricing_2022_05_01::MoneyType>,
29    /// A list of shipping options associated with this offer
30    #[serde(rename = "shippingOptions", skip_serializing_if = "Option::is_none")]
31    pub shipping_options: Option<Vec<models::product_pricing_2022_05_01::ShippingOption>>,
32    #[serde(rename = "points", skip_serializing_if = "Option::is_none")]
33    pub points: Option<Box<models::product_pricing_2022_05_01::Points>>,
34    #[serde(rename = "primeDetails", skip_serializing_if = "Option::is_none")]
35    pub prime_details: Option<Box<models::product_pricing_2022_05_01::PrimeDetails>>,
36}
37
38impl Offer {
39    /// The offer data of a product.
40    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 {
41        Offer {
42            seller_id,
43            condition,
44            sub_condition: None,
45            fulfillment_type,
46            listing_price: Box::new(listing_price),
47            shipping_options: None,
48            points: None,
49            prime_details: None,
50        }
51    }
52}
53/// The item subcondition of the offer.
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum SubCondition {
56    #[serde(rename = "New")]
57    New,
58    #[serde(rename = "Mint")]
59    Mint,
60    #[serde(rename = "VeryGood")]
61    VeryGood,
62    #[serde(rename = "Good")]
63    Good,
64    #[serde(rename = "Acceptable")]
65    Acceptable,
66    #[serde(rename = "Poor")]
67    Poor,
68    #[serde(rename = "Club")]
69    Club,
70    #[serde(rename = "OEM")]
71    Oem,
72    #[serde(rename = "Warranty")]
73    Warranty,
74    #[serde(rename = "RefurbishedWarranty")]
75    RefurbishedWarranty,
76    #[serde(rename = "Refurbished")]
77    Refurbished,
78    #[serde(rename = "OpenBox")]
79    OpenBox,
80    #[serde(rename = "Other")]
81    Other,
82}
83
84impl Default for SubCondition {
85    fn default() -> SubCondition {
86        Self::New
87    }
88}
89