amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Amazon Seller Wallet Open Banking API
 *
 * The Selling Partner API for Seller Wallet (Seller Wallet API) provides financial information that is relevant to a seller's Seller Wallet account. You can obtain financial events, balances, and transfer schedules for Seller Wallet accounts. You can also schedule and initiate transactions.
 *
 * The version of the OpenAPI document: 2024-03-01
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Fee : If the fees is in baseAmount (sourceAccount) currency, effectiveRate =  (baseAmount - sum(fees.feeAmount.currencyAmount)) * baseRate) / baseAmount. If the fees is in transferAmount (destinationAccount) currency, effectiveRate =  (( baseAmount * baseRate ) -  sum(fees.feeAmount.currencyAmount )) / baseAmount 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Fee {
    /// Unique identifier assigned to the Fee. 
    #[serde(rename = "feeId")]
    pub fee_id: String,
    #[serde(rename = "feeType")]
    pub fee_type: models::seller_wallet_2024_03_01::FeeType,
    /// A decimal number such as amount or FX rate.
    #[serde(rename = "feeRateValue")]
    pub fee_rate_value: f64,
    #[serde(rename = "feeAmount")]
    pub fee_amount: Box<models::seller_wallet_2024_03_01::Currency>,
}

impl Fee {
    /// If the fees is in baseAmount (sourceAccount) currency, effectiveRate =  (baseAmount - sum(fees.feeAmount.currencyAmount)) * baseRate) / baseAmount. If the fees is in transferAmount (destinationAccount) currency, effectiveRate =  (( baseAmount * baseRate ) -  sum(fees.feeAmount.currencyAmount )) / baseAmount 
    pub fn new(fee_id: String, fee_type: models::seller_wallet_2024_03_01::FeeType, fee_rate_value: f64, fee_amount: models::seller_wallet_2024_03_01::Currency) -> Fee {
        Fee {
            fee_id,
            fee_type,
            fee_rate_value,
            fee_amount: Box::new(fee_amount),
        }
    }
}