/*
 * 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 PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInner {
    /// Simulated underlying change, %
    #[serde(
        rename = "underlying_change_pct",
        skip_serializing_if = "Option::is_none"
    )]
    pub underlying_change_pct: Option<rust_decimal::Decimal>,
    /// Simulated volatility change, %
    #[serde(
        rename = "vol_change_pct_point",
        skip_serializing_if = "Option::is_none"
    )]
    pub vol_change_pct_point: Option<rust_decimal::Decimal>,
    /// P&L resulting from this scenario.
    #[serde(rename = "pnl", skip_serializing_if = "Option::is_none")]
    pub pnl: Option<rust_decimal::Decimal>,
    /// Effect factor of P&L on the loss margin.
    #[serde(rename = "coverage_factor", skip_serializing_if = "Option::is_none")]
    pub coverage_factor: Option<rust_decimal::Decimal>,
    /// Total required margin in this scenario.
    #[serde(rename = "required_margin", skip_serializing_if = "Option::is_none")]
    pub required_margin: Option<rust_decimal::Decimal>,
    /// Margin based on scenario loss coverage.
    #[serde(rename = "loss_margin", skip_serializing_if = "Option::is_none")]
    pub loss_margin: Option<rust_decimal::Decimal>,
    /// Roll position x index price in this underlying.
    #[serde(rename = "roll_cash_position", skip_serializing_if = "Option::is_none")]
    pub roll_cash_position: Option<rust_decimal::Decimal>,
    /// Margin based on roll position.
    #[serde(
        rename = "roll_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub roll_contingency_margin: Option<rust_decimal::Decimal>,
    /// Delta one roll position x index price in this underlying.
    #[serde(
        rename = "d1_roll_cash_position",
        skip_serializing_if = "Option::is_none"
    )]
    pub d1_roll_cash_position: Option<rust_decimal::Decimal>,
    /// Margin based on delta one roll position.
    #[serde(
        rename = "d1_roll_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub d1_roll_contingency_margin: Option<rust_decimal::Decimal>,
    /// Options roll position x index price in this underlying.
    #[serde(
        rename = "options_roll_cash_position",
        skip_serializing_if = "Option::is_none"
    )]
    pub options_roll_cash_position: Option<rust_decimal::Decimal>,
    /// Margin based on options roll position.
    #[serde(
        rename = "options_roll_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub options_roll_contingency_margin: Option<rust_decimal::Decimal>,
    /// Total short options position x index price in this underlying.
    #[serde(
        rename = "options_short_cash_position",
        skip_serializing_if = "Option::is_none"
    )]
    pub options_short_cash_position: Option<rust_decimal::Decimal>,
    /// Margin based on options short position.
    #[serde(
        rename = "options_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub options_contingency_margin: Option<rust_decimal::Decimal>,
    #[serde(rename = "positions", skip_serializing_if = "Option::is_none")]
    pub positions: Option<
        Vec<models::PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInnerPositionsInner>,
    >,
    /// Results of scenario simulations on affected asset positions.
    #[serde(rename = "assets", skip_serializing_if = "Option::is_none")]
    pub assets: Option<
        Vec<models::PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInnerAssetsInner>,
    >,
    /// `true` if this scenario was used to calculate total margin requirements for this underlying.
    #[serde(rename = "highlight", skip_serializing_if = "Option::is_none")]
    pub highlight: Option<bool>,
}

impl PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInner {
    pub fn new() -> PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInner {
        PortfolioMarginBreakdownPortfolioUnderlyingsInnerScenariosInner {
            underlying_change_pct: None,
            vol_change_pct_point: None,
            pnl: None,
            coverage_factor: None,
            required_margin: None,
            loss_margin: None,
            roll_cash_position: None,
            roll_contingency_margin: None,
            d1_roll_cash_position: None,
            d1_roll_contingency_margin: None,
            options_roll_cash_position: None,
            options_roll_contingency_margin: None,
            options_short_cash_position: None,
            options_contingency_margin: None,
            positions: None,
            assets: None,
            highlight: None,
        }
    }
}
