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

/// TransactionInitiationRequest : Request body to initiate a transaction from a SW bank account to another customer defined bank account 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransactionInitiationRequest {
    /// The unique identifier of the source Amazon SW bank account from where the money needs to be debited 
    #[serde(rename = "sourceAccountId")]
    pub source_account_id: String,
    /// Optional field to specify the unique identifier of the destination bank account where the money needs to be deposited 
    #[serde(rename = "destinationAccountId", skip_serializing_if = "Option::is_none")]
    pub destination_account_id: Option<String>,
    /// Optional field to specify description for the transaction 
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "destinationTransactionInstrument")]
    pub destination_transaction_instrument: Box<models::seller_wallet_2024_03_01::TransactionInstrumentDetails>,
    #[serde(rename = "destinationAccountHolderAddress", skip_serializing_if = "Option::is_none")]
    pub destination_account_holder_address: Option<Box<models::seller_wallet_2024_03_01::AccountHolderAddress>>,
    #[serde(rename = "sourceAmount")]
    pub source_amount: Box<models::seller_wallet_2024_03_01::Currency>,
    #[serde(rename = "transferRateDetails", skip_serializing_if = "Option::is_none")]
    pub transfer_rate_details: Option<Box<models::seller_wallet_2024_03_01::TransferRatePreview>>,
    /// The transaction initiation request time in date-time format 
    #[serde(rename = "requestTime")]
    pub request_time: String,
}

impl TransactionInitiationRequest {
    /// Request body to initiate a transaction from a SW bank account to another customer defined bank account 
    pub fn new(source_account_id: String, description: String, destination_transaction_instrument: models::seller_wallet_2024_03_01::TransactionInstrumentDetails, source_amount: models::seller_wallet_2024_03_01::Currency, request_time: String) -> TransactionInitiationRequest {
        TransactionInitiationRequest {
            source_account_id,
            destination_account_id: None,
            description,
            destination_transaction_instrument: Box::new(destination_transaction_instrument),
            destination_account_holder_address: None,
            source_amount: Box::new(source_amount),
            transfer_rate_details: None,
            request_time,
        }
    }
}