/*
 * Thalex RPC API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct VerifyWithdrawalRpcResult {
    /// Projected available margin after the withdrawal.
    #[serde(rename = "available_margin")]
    pub available_margin: rust_decimal::Decimal,
    /// Projected required margin after the withdrawal.
    #[serde(rename = "required_margin")]
    pub required_margin: rust_decimal::Decimal,
    /// Amount of fees withheld.
    #[serde(rename = "fee", skip_serializing_if = "Option::is_none")]
    pub fee: Option<rust_decimal::Decimal>,
    /// Asset in which the withdrawal fees are withheld.
    #[serde(rename = "fee_asset", skip_serializing_if = "Option::is_none")]
    pub fee_asset: Option<String>,
    #[serde(rename = "error", skip_serializing_if = "Option::is_none")]
    pub error: Option<models::VerifyWithdrawalRpcResultError>,
}

impl VerifyWithdrawalRpcResult {
    pub fn new(
        available_margin: rust_decimal::Decimal,
        required_margin: rust_decimal::Decimal,
    ) -> VerifyWithdrawalRpcResult {
        VerifyWithdrawalRpcResult {
            available_margin,
            required_margin,
            fee: None,
            fee_asset: None,
            error: None,
        }
    }
}
