btcpay_client/models/
payout_data.rs

1/*
2 * BTCPay Greenfield API
3 *
4 * A full API to use your BTCPay Server
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct PayoutData {
16    /// The id of the payout
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// The revision number of the payout. This revision number is incremented when the payout amount or destination is modified before the approval.
20    #[serde(rename = "revision", skip_serializing_if = "Option::is_none")]
21    pub revision: Option<i32>,
22    /// The id of the pull payment this payout belongs to
23    #[serde(rename = "pullPaymentId", skip_serializing_if = "Option::is_none")]
24    pub pull_payment_id: Option<String>,
25    /// The creation date of the payout as a unix timestamp
26    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
27    pub date: Option<String>,
28    /// The destination of the payout (can be an address or a BIP21 url)
29    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
30    pub destination: Option<String>,
31    /// The amount of the payout in the currency of the pull payment (eg. USD).
32    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
33    pub amount: Option<String>,
34    /// The payment method of the payout (e.g., \"BTC\" or \"BTC_LightningLike\"
35    #[serde(rename = "paymentMethod", skip_serializing_if = "Option::is_none")]
36    pub payment_method: Option<String>,
37    /// Crypto code of the payment method of the payout (e.g., \"BTC\" or \"LTC\")
38    #[serde(rename = "cryptoCode", skip_serializing_if = "Option::is_none")]
39    pub crypto_code: Option<String>,
40    /// The amount of the payout in the currency of the payment method (eg. BTC). This is only available from the `AwaitingPayment` state.
41    #[serde(rename = "paymentMethodAmount", skip_serializing_if = "Option::is_none")]
42    pub payment_method_amount: Option<String>,
43    /// The state of the payout (`AwaitingApproval`, `AwaitingPayment`, `InProgress`, `Completed`, `Cancelled`)
44    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
45    pub state: Option<State>,
46}
47
48impl PayoutData {
49    pub fn new() -> PayoutData {
50        PayoutData {
51            id: None,
52            revision: None,
53            pull_payment_id: None,
54            date: None,
55            destination: None,
56            amount: None,
57            payment_method: None,
58            crypto_code: None,
59            payment_method_amount: None,
60            state: None,
61        }
62    }
63}
64
65/// The state of the payout (`AwaitingApproval`, `AwaitingPayment`, `InProgress`, `Completed`, `Cancelled`)
66#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
67pub enum State {
68    #[serde(rename = "AwaitingApproval")]
69    AwaitingApproval,
70    #[serde(rename = "AwaitingPayment")]
71    AwaitingPayment,
72    #[serde(rename = "InProgress")]
73    InProgress,
74    #[serde(rename = "Completed")]
75    Completed,
76    #[serde(rename = "Cancelled")]
77    Cancelled,
78}
79
80impl Default for State {
81    fn default() -> State {
82        Self::AwaitingApproval
83    }
84}
85