amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Finances
 *
 * 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.
 *
 * The version of the OpenAPI document: 2024-06-19
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Context : Additional Information about the item.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Context {
    /// The store name associated with the transaction.
    #[serde(rename = "storeName", skip_serializing_if = "Option::is_none")]
    pub store_name: Option<StoreName>,
    /// Order type of the transaction.
    #[serde(rename = "orderType", skip_serializing_if = "Option::is_none")]
    pub order_type: Option<String>,
    /// Channel details of related transaction.
    #[serde(rename = "channel", skip_serializing_if = "Option::is_none")]
    pub channel: Option<String>,
    /// Amazon Standard Identification Number (ASIN) of the item.
    #[serde(rename = "asin", skip_serializing_if = "Option::is_none")]
    pub asin: Option<String>,
    /// Stock keeping unit (SKU) of the item.
    #[serde(rename = "sku", skip_serializing_if = "Option::is_none")]
    pub sku: Option<String>,
    /// Quantity of the item shipped.
    #[serde(rename = "quantityShipped", skip_serializing_if = "Option::is_none")]
    pub quantity_shipped: Option<i32>,
    /// Fulfillment network of the item.
    #[serde(rename = "fulfillmentNetwork", skip_serializing_if = "Option::is_none")]
    pub fulfillment_network: Option<String>,
    /// Type of payment made.
    #[serde(rename = "paymentType", skip_serializing_if = "Option::is_none")]
    pub payment_type: Option<String>,
    /// Method of payment made.
    #[serde(rename = "paymentMethod", skip_serializing_if = "Option::is_none")]
    pub payment_method: Option<String>,
    /// Reference number of payment made.
    #[serde(rename = "paymentReference", skip_serializing_if = "Option::is_none")]
    pub payment_reference: Option<String>,
    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
    #[serde(rename = "paymentDate", skip_serializing_if = "Option::is_none")]
    pub payment_date: Option<String>,
    /// The deferral policy applied to the transaction.  **Examples:** `B2B` (invoiced orders), `DD7` (delivery date policy)
    #[serde(rename = "deferralReason", skip_serializing_if = "Option::is_none")]
    pub deferral_reason: Option<String>,
    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
    #[serde(rename = "maturityDate", skip_serializing_if = "Option::is_none")]
    pub maturity_date: Option<String>,
    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,
    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
    #[serde(rename = "endTime", skip_serializing_if = "Option::is_none")]
    pub end_time: Option<String>,
    #[serde(rename = "contextType")]
    pub context_type: String,
}

impl Context {
    /// Additional Information about the item.
    pub fn new(context_type: String) -> Context {
        Context {
            store_name: None,
            order_type: None,
            channel: None,
            asin: None,
            sku: None,
            quantity_shipped: None,
            fulfillment_network: None,
            payment_type: None,
            payment_method: None,
            payment_reference: None,
            payment_date: None,
            deferral_reason: None,
            maturity_date: None,
            start_time: None,
            end_time: None,
            context_type,
        }
    }
}
/// The store name associated with the transaction.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum StoreName {
    #[serde(rename = "AMAZON_HAUL")]
    AmazonHaul,
}

impl Default for StoreName {
    fn default() -> StoreName {
        Self::AmazonHaul
    }
}