amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Direct Fulfillment Payments
 *
 * The Selling Partner API for Direct Fulfillment Payments provides programmatic access to a direct fulfillment vendor's invoice data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// ChargeDetails : Monetary and tax details of the charge.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ChargeDetails {
    /// Type of charge applied.
    #[serde(rename = "type")]
    pub r#type: Type,
    #[serde(rename = "chargeAmount")]
    pub charge_amount: Box<models::vendor_direct_fulfillment_payments_v1::Money>,
    /// Individual tax details per line item.
    #[serde(rename = "taxDetails", skip_serializing_if = "Option::is_none")]
    pub tax_details: Option<Vec<models::vendor_direct_fulfillment_payments_v1::TaxDetail>>,
}

impl ChargeDetails {
    /// Monetary and tax details of the charge.
    pub fn new(r#type: Type, charge_amount: models::vendor_direct_fulfillment_payments_v1::Money) -> ChargeDetails {
        ChargeDetails {
            r#type,
            charge_amount: Box::new(charge_amount),
            tax_details: None,
        }
    }
}
/// Type of charge applied.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "GIFTWRAP")]
    Giftwrap,
    #[serde(rename = "FULFILLMENT")]
    Fulfillment,
    #[serde(rename = "MARKETINGINSERT")]
    Marketinginsert,
    #[serde(rename = "PACKAGING")]
    Packaging,
    #[serde(rename = "LOADING")]
    Loading,
    #[serde(rename = "FREIGHTOUT")]
    Freightout,
    #[serde(rename = "TAX_COLLECTED_AT_SOURCE")]
    TaxCollectedAtSource,
}

impl Default for Type {
    fn default() -> Type {
        Self::Giftwrap
    }
}