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};

/// Transaction : Contains all information related to the transaction.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Transaction {
    #[serde(rename = "sellingPartnerMetadata", skip_serializing_if = "Option::is_none")]
    pub selling_partner_metadata: Option<Box<models::finances_2024_06_19::SellingPartnerMetadata>>,
    /// Related business identifiers of the transaction.
    #[serde(rename = "relatedIdentifiers", skip_serializing_if = "Option::is_none")]
    pub related_identifiers: Option<Vec<models::finances_2024_06_19::RelatedIdentifier>>,
    /// The type of transaction.  Possible values:  * Shipment
    #[serde(rename = "transactionType", skip_serializing_if = "Option::is_none")]
    pub transaction_type: Option<String>,
    /// The unique identifier for the transaction.
    #[serde(rename = "transactionId", skip_serializing_if = "Option::is_none")]
    pub transaction_id: Option<String>,
    /// The status of the transaction.  **Possible values:**  * `DEFERRED`: the transaction is currently deferred. * `RELEASED`: the transaction is currently released. * `DEFERRED_RELEASED`: the transaction was deferred in the past, but is now released. The status of a deferred transaction is updated to `DEFERRED_RELEASED` when the transaction is released.
    #[serde(rename = "transactionStatus", skip_serializing_if = "Option::is_none")]
    pub transaction_status: Option<String>,
    /// Describes the reasons for the transaction.  Example: 'Order Payment','Refund Order'
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Fields with a schema type of date are in ISO 8601 date time format (for example GroupBeginDate).
    #[serde(rename = "postedDate", skip_serializing_if = "Option::is_none")]
    pub posted_date: Option<String>,
    #[serde(rename = "totalAmount", skip_serializing_if = "Option::is_none")]
    pub total_amount: Option<Box<models::finances_2024_06_19::Currency>>,
    #[serde(rename = "marketplaceDetails", skip_serializing_if = "Option::is_none")]
    pub marketplace_details: Option<Box<models::finances_2024_06_19::MarketplaceDetails>>,
    /// List of items in the transaction
    #[serde(rename = "items", skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<models::finances_2024_06_19::Item>>,
    /// List of additional Information about the item.
    #[serde(rename = "contexts", skip_serializing_if = "Option::is_none")]
    pub contexts: Option<Vec<models::finances_2024_06_19::Context>>,
    /// A list of breakdowns that detail how the total amount is calculated for the transaction.
    #[serde(rename = "breakdowns", skip_serializing_if = "Option::is_none")]
    pub breakdowns: Option<Vec<models::finances_2024_06_19::Breakdown>>,
}

impl Transaction {
    /// Contains all information related to the transaction.
    pub fn new() -> Transaction {
        Transaction {
            selling_partner_metadata: None,
            related_identifiers: None,
            transaction_type: None,
            transaction_id: None,
            transaction_status: None,
            description: None,
            posted_date: None,
            total_amount: None,
            marketplace_details: None,
            items: None,
            contexts: None,
            breakdowns: None,
        }
    }
}