amazon_spapi/models/orders_v0/
substitution_preferences.rs

1/*
2 * Selling Partner API for Orders
3 *
4 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// SubstitutionPreferences : Substitution preferences for an order item.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct SubstitutionPreferences {
17    /// The type of substitution that these preferences represent.
18    #[serde(rename = "SubstitutionType")]
19    pub substitution_type: SubstitutionType,
20    /// A collection of substitution options.
21    #[serde(rename = "SubstitutionOptions", skip_serializing_if = "Option::is_none")]
22    pub substitution_options: Option<Vec<models::orders_v0::SubstitutionOption>>,
23}
24
25impl SubstitutionPreferences {
26    /// Substitution preferences for an order item.
27    pub fn new(substitution_type: SubstitutionType) -> SubstitutionPreferences {
28        SubstitutionPreferences {
29            substitution_type,
30            substitution_options: None,
31        }
32    }
33}
34/// The type of substitution that these preferences represent.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum SubstitutionType {
37    #[serde(rename = "CUSTOMER_PREFERENCE")]
38    CustomerPreference,
39    #[serde(rename = "AMAZON_RECOMMENDED")]
40    AmazonRecommended,
41    #[serde(rename = "DO_NOT_SUBSTITUTE")]
42    DoNotSubstitute,
43}
44
45impl Default for SubstitutionType {
46    fn default() -> SubstitutionType {
47        Self::CustomerPreference
48    }
49}
50