use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Offer {
#[serde(rename = "sellerId")]
pub seller_id: String,
#[serde(rename = "condition")]
pub condition: models::product_pricing_2022_05_01::Condition,
#[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>,
#[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 {
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,
}
}
}
#[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
}
}