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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// ======================================
// This file was automatically generated.
// ======================================
use crate::ids::{FinancialConnectionsTransactionId};
use crate::params::{Object, Timestamp};
use crate::resources::{Currency};
use serde::{Deserialize, Serialize};
/// The resource representing a Stripe "BankConnectionsResourceTransaction".
///
/// For more details see <https://stripe.com/docs/api/financial_connections/transactions/object>
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct FinancialConnectionsTransaction {
/// Unique identifier for the object.
pub id: FinancialConnectionsTransactionId,
/// The ID of the Financial Connections Account this transaction belongs to.
pub account: String,
/// The amount of this transaction, in cents (or local equivalent).
pub amount: i64,
/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
///
/// Must be a [supported currency](https://stripe.com/docs/currencies).
pub currency: Currency,
/// The description of this transaction.
pub description: String,
/// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
pub livemode: bool,
/// The status of the transaction.
pub status: FinancialConnectionsTransactionStatus,
pub status_transitions: BankConnectionsResourceTransactionResourceStatusTransitions,
/// Time at which the transaction was transacted.
///
/// Measured in seconds since the Unix epoch.
pub transacted_at: Timestamp,
/// The token of the transaction refresh that last updated or created this transaction.
pub transaction_refresh: String,
/// Time at which the object was last updated.
///
/// Measured in seconds since the Unix epoch.
pub updated: Timestamp,
}
impl Object for FinancialConnectionsTransaction {
type Id = FinancialConnectionsTransactionId;
fn id(&self) -> Self::Id {
self.id.clone()
}
fn object(&self) -> &'static str {
"financial_connections.transaction"
}
}
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct BankConnectionsResourceTransactionResourceStatusTransitions {
/// Time at which this transaction posted.
///
/// Measured in seconds since the Unix epoch.
pub posted_at: Option<Timestamp>,
/// Time at which this transaction was voided.
///
/// Measured in seconds since the Unix epoch.
pub void_at: Option<Timestamp>,
}
/// An enum representing the possible values of an `FinancialConnectionsTransaction`'s `status` field.
#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]
#[serde(rename_all = "snake_case")]
pub enum FinancialConnectionsTransactionStatus {
Pending,
Posted,
Void,
}
impl FinancialConnectionsTransactionStatus {
pub fn as_str(self) -> &'static str {
match self {
FinancialConnectionsTransactionStatus::Pending => "pending",
FinancialConnectionsTransactionStatus::Posted => "posted",
FinancialConnectionsTransactionStatus::Void => "void",
}
}
}
impl AsRef<str> for FinancialConnectionsTransactionStatus {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl std::fmt::Display for FinancialConnectionsTransactionStatus {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
self.as_str().fmt(f)
}
}
impl std::default::Default for FinancialConnectionsTransactionStatus {
fn default() -> Self {
Self::Pending
}
}