1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* 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),
}
}
}