btcpay-client 0.1.0

A client library for BTCPay Server.
Documentation
/*
 * BTCPay Greenfield API
 *
 * A full API to use your BTCPay Server
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct PayoutData {
    /// The id of the payout
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    /// The revision number of the payout. This revision number is incremented when the payout amount or destination is modified before the approval.
    #[serde(rename = "revision", skip_serializing_if = "Option::is_none")]
    pub revision: Option<i32>,
    /// The id of the pull payment this payout belongs to
    #[serde(rename = "pullPaymentId", skip_serializing_if = "Option::is_none")]
    pub pull_payment_id: Option<String>,
    /// The creation date of the payout as a unix timestamp
    #[serde(rename = "date", skip_serializing_if = "Option::is_none")]
    pub date: Option<String>,
    /// The destination of the payout (can be an address or a BIP21 url)
    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
    pub destination: Option<String>,
    /// The amount of the payout in the currency of the pull payment (eg. USD).
    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
    pub amount: Option<String>,
    /// The payment method of the payout (e.g., \"BTC\" or \"BTC_LightningLike\"
    #[serde(rename = "paymentMethod", skip_serializing_if = "Option::is_none")]
    pub payment_method: Option<String>,
    /// Crypto code of the payment method of the payout (e.g., \"BTC\" or \"LTC\")
    #[serde(rename = "cryptoCode", skip_serializing_if = "Option::is_none")]
    pub crypto_code: Option<String>,
    /// The amount of the payout in the currency of the payment method (eg. BTC). This is only available from the `AwaitingPayment` state.
    #[serde(rename = "paymentMethodAmount", skip_serializing_if = "Option::is_none")]
    pub payment_method_amount: Option<String>,
    /// The state of the payout (`AwaitingApproval`, `AwaitingPayment`, `InProgress`, `Completed`, `Cancelled`)
    #[serde(rename = "state", skip_serializing_if = "Option::is_none")]
    pub state: Option<State>,
}

impl PayoutData {
    pub fn new() -> PayoutData {
        PayoutData {
            id: None,
            revision: None,
            pull_payment_id: None,
            date: None,
            destination: None,
            amount: None,
            payment_method: None,
            crypto_code: None,
            payment_method_amount: None,
            state: None,
        }
    }
}

/// The state of the payout (`AwaitingApproval`, `AwaitingPayment`, `InProgress`, `Completed`, `Cancelled`)
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum State {
    #[serde(rename = "AwaitingApproval")]
    AwaitingApproval,
    #[serde(rename = "AwaitingPayment")]
    AwaitingPayment,
    #[serde(rename = "InProgress")]
    InProgress,
    #[serde(rename = "Completed")]
    Completed,
    #[serde(rename = "Cancelled")]
    Cancelled,
}

impl Default for State {
    fn default() -> State {
        Self::AwaitingApproval
    }
}