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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
use serde::{Serialize, Deserialize};
use super::{SweepStatus, SweepTrigger};
/**Describes a sweep of funds to / from the sweep account.
A sweep is associated with many sweep events (events of type `swept` or `return_swept`) which can be retrieved by invoking the `/transfer/event/list` endpoint with the corresponding `sweep_id`.
`swept` events occur when the transfer amount is credited or debited from your sweep account, depending on the `type` of the transfer. `return_swept` events occur when a transfer is returned and Plaid undoes the credit or debit.
The total sum of the `swept` and `return_swept` events is equal to the `amount` of the sweep Plaid creates and matches the amount of the entry on your sweep account ledger.*/
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TransferSweep {
/**Signed decimal amount of the sweep as it appears on your sweep account ledger (e.g. "-10.00")
If amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced.*/
pub amount: String,
///The datetime when the sweep occurred, in RFC 3339 format.
pub created: chrono::DateTime<chrono::Utc>,
///The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
///The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited.
pub funding_account_id: String,
///Identifier of the sweep.
pub id: String,
///The currency of the sweep, e.g. "USD".
pub iso_currency_code: String,
///Plaid’s unique identifier for a Plaid Ledger Balance.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub ledger_id: Option<String>,
/**The trace identifier for the transfer based on its network. This will only be set after the transfer has posted.
For `ach` or `same-day-ach` transfers, this is the ACH trace number.
For `rtp` transfers, this is the Transaction Identification number.
For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub network_trace_id: Option<String>,
///The date when the sweep settled, in the YYYY-MM-DD format.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub settled: Option<chrono::NaiveDate>,
/**The status of a sweep transfer
`"pending"` - The sweep is currently pending
`"posted"` - The sweep has been posted
`"settled"` - The sweep has settled
`"returned"` - The sweep has been returned
`"failed"` - The sweep has failed*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub status: Option<SweepStatus>,
/**The trigger of the sweep
`"manual"` - The sweep is created manually by the customer
`"incoming"` - The sweep is created by incoming funds flow (e.g. Incoming Wire)
`"balance_threshold"` - The sweep is created by balance threshold setting
`"automatic_aggregate"` - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.*/
#[serde(default, skip_serializing_if = "Option::is_none")]
pub trigger: Option<SweepTrigger>,
}
impl std::fmt::Display for TransferSweep {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
write!(f, "{}", serde_json::to_string(self).unwrap())
}
}