stripe/resources/generated/
transfer_reversal.rs

1// ======================================
2// This file was automatically generated.
3// ======================================
4
5use crate::ids::TransferReversalId;
6use crate::params::{Expandable, Metadata, Object, Timestamp};
7use crate::resources::{BalanceTransaction, Currency, Refund, Transfer};
8use serde::{Deserialize, Serialize};
9
10/// The resource representing a Stripe "TransferReversal".
11///
12/// For more details see <https://stripe.com/docs/api/transfer_reversals/object>
13#[derive(Clone, Debug, Default, Deserialize, Serialize)]
14pub struct TransferReversal {
15    /// Unique identifier for the object.
16    pub id: TransferReversalId,
17
18    /// Amount, in cents (or local equivalent).
19    pub amount: i64,
20
21    /// Balance transaction that describes the impact on your account balance.
22    pub balance_transaction: Option<Expandable<BalanceTransaction>>,
23
24    /// Time at which the object was created.
25    ///
26    /// Measured in seconds since the Unix epoch.
27    pub created: Timestamp,
28
29    /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase.
30    ///
31    /// Must be a [supported currency](https://stripe.com/docs/currencies).
32    pub currency: Currency,
33
34    /// Linked payment refund for the transfer reversal.
35    pub destination_payment_refund: Option<Expandable<Refund>>,
36
37    /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object.
38    ///
39    /// This can be useful for storing additional information about the object in a structured format.
40    pub metadata: Option<Metadata>,
41
42    /// ID of the refund responsible for the transfer reversal.
43    pub source_refund: Option<Expandable<Refund>>,
44
45    /// ID of the transfer that was reversed.
46    pub transfer: Expandable<Transfer>,
47}
48
49impl Object for TransferReversal {
50    type Id = TransferReversalId;
51    fn id(&self) -> Self::Id {
52        self.id.clone()
53    }
54    fn object(&self) -> &'static str {
55        "transfer_reversal"
56    }
57}