amazon_spapi/models/finances_2024_06_19/
context.rs

1/*
2 * The Selling Partner API for Finances
3 *
4 * The Selling Partner API for Finances helps you obtain financial information relevant to a seller's business. You can obtain financial events for a given order or date range without having to wait until a statement period closes.
5 *
6 * The version of the OpenAPI document: 2024-06-19
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Context : Additional Information about the item.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Context {
17    /// The store name associated with the transaction.
18    #[serde(rename = "storeName", skip_serializing_if = "Option::is_none")]
19    pub store_name: Option<StoreName>,
20    /// Order type of the transaction.
21    #[serde(rename = "orderType", skip_serializing_if = "Option::is_none")]
22    pub order_type: Option<String>,
23    /// Channel details of related transaction.
24    #[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
25    pub channel: Option<String>,
26    /// Amazon Standard Identification Number (ASIN) of the item.
27    #[serde(rename = "asin", skip_serializing_if = "Option::is_none")]
28    pub asin: Option<String>,
29    /// Stock keeping unit (SKU) of the item.
30    #[serde(rename = "sku", skip_serializing_if = "Option::is_none")]
31    pub sku: Option<String>,
32    /// Quantity of the item shipped.
33    #[serde(rename = "quantityShipped", skip_serializing_if = "Option::is_none")]
34    pub quantity_shipped: Option<i32>,
35    /// Fulfillment network of the item.
36    #[serde(rename = "fulfillmentNetwork", skip_serializing_if = "Option::is_none")]
37    pub fulfillment_network: Option<String>,
38    /// Type of payment made.
39    #[serde(rename = "paymentType", skip_serializing_if = "Option::is_none")]
40    pub payment_type: Option<String>,
41    /// Method of payment made.
42    #[serde(rename = "paymentMethod", skip_serializing_if = "Option::is_none")]
43    pub payment_method: Option<String>,
44    /// Reference number of payment made.
45    #[serde(rename = "paymentReference", skip_serializing_if = "Option::is_none")]
46    pub payment_reference: Option<String>,
47    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
48    #[serde(rename = "paymentDate", skip_serializing_if = "Option::is_none")]
49    pub payment_date: Option<String>,
50    /// The deferral policy applied to the transaction.  **Examples:** `B2B` (invoiced orders), `DD7` (delivery date policy)
51    #[serde(rename = "deferralReason", skip_serializing_if = "Option::is_none")]
52    pub deferral_reason: Option<String>,
53    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
54    #[serde(rename = "maturityDate", skip_serializing_if = "Option::is_none")]
55    pub maturity_date: Option<String>,
56    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
57    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
58    pub start_time: Option<String>,
59    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
60    #[serde(rename = "endTime", skip_serializing_if = "Option::is_none")]
61    pub end_time: Option<String>,
62    #[serde(rename = "contextType")]
63    pub context_type: String,
64}
65
66impl Context {
67    /// Additional Information about the item.
68    pub fn new(context_type: String) -> Context {
69        Context {
70            store_name: None,
71            order_type: None,
72            channel: None,
73            asin: None,
74            sku: None,
75            quantity_shipped: None,
76            fulfillment_network: None,
77            payment_type: None,
78            payment_method: None,
79            payment_reference: None,
80            payment_date: None,
81            deferral_reason: None,
82            maturity_date: None,
83            start_time: None,
84            end_time: None,
85            context_type,
86        }
87    }
88}
89/// The store name associated with the transaction.
90#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
91pub enum StoreName {
92    #[serde(rename = "AMAZON_HAUL")]
93    AmazonHaul,
94}
95
96impl Default for StoreName {
97    fn default() -> StoreName {
98        Self::AmazonHaul
99    }
100}
101