/*
 * 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 PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInnerAssetsInner {
    /// Asset name
    #[serde(rename = "asset_name", skip_serializing_if = "Option::is_none")]
    pub asset_name: Option<String>,
    #[serde(rename = "position", skip_serializing_if = "Option::is_none")]
    pub position: Option<rust_decimal::Decimal>,
    /// P&L for a single unit of this asset.
    #[serde(rename = "underlying_pnl", skip_serializing_if = "Option::is_none")]
    pub underlying_pnl: Option<rust_decimal::Decimal>,
    /// Total P&L for the position in this asset.
    #[serde(rename = "pnl", skip_serializing_if = "Option::is_none")]
    pub pnl: Option<rust_decimal::Decimal>,
    /// The collateral quality of the asset i.e. the fraction of the asset that can be used as a collateral.
    #[serde(rename = "collateral_factor", skip_serializing_if = "Option::is_none")]
    pub collateral_factor: Option<rust_decimal::Decimal>,
    /// Index price at the moment of scenario calculation.
    #[serde(rename = "index_price", skip_serializing_if = "Option::is_none")]
    pub index_price: Option<rust_decimal::Decimal>,
    /// The price at the moment of scenario calculation. This is the margin effect of this asset position, i.e. index price multiplied by collateral factor.
    #[serde(rename = "current_price", skip_serializing_if = "Option::is_none")]
    pub current_price: Option<rust_decimal::Decimal>,
    /// The price calculated for the scenario.
    #[serde(rename = "scenario_price", skip_serializing_if = "Option::is_none")]
    pub scenario_price: Option<rust_decimal::Decimal>,
}

impl PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInnerAssetsInner {
    pub fn new() -> PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInnerAssetsInner {
        PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInnerAssetsInner {
            asset_name: None,
            position: None,
            underlying_pnl: None,
            pnl: None,
            collateral_factor: None,
            index_price: None,
            current_price: None,
            scenario_price: None,
        }
    }
}
