amazon_spapi/models/product_pricing_2022_05_01/
offer.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Offer {
17 #[serde(rename = "sellerId")]
19 pub seller_id: String,
20 #[serde(rename = "condition")]
21 pub condition: models::product_pricing_2022_05_01::Condition,
22 #[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 #[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 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#[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