/*
 * 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 MarginBreakdownWithOrderCurrentUnderlying {
    /// Underlying index name.
    #[serde(rename = "underlying", skip_serializing_if = "Option::is_none")]
    pub underlying: Option<String>,
    /// Total margin required for positions with this underlying.
    #[serde(rename = "required_margin", skip_serializing_if = "Option::is_none")]
    pub required_margin: Option<f64>,
    /// Margin based on scenario loss coverage.
    #[serde(rename = "loss_margin", skip_serializing_if = "Option::is_none")]
    pub loss_margin: Option<f64>,
    /// Margin based on roll position.
    #[serde(
        rename = "roll_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub roll_contingency_margin: Option<f64>,
    /// 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<f64>,
    /// Margin based on options roll position.
    #[serde(
        rename = "options_roll_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub options_roll_contingency_margin: Option<f64>,
    /// Margin based on options short position.
    #[serde(
        rename = "options_contingency_margin",
        skip_serializing_if = "Option::is_none"
    )]
    pub options_contingency_margin: Option<f64>,
}

impl MarginBreakdownWithOrderCurrentUnderlying {
    pub fn new() -> MarginBreakdownWithOrderCurrentUnderlying {
        MarginBreakdownWithOrderCurrentUnderlying {
            underlying: None,
            required_margin: None,
            loss_margin: None,
            roll_contingency_margin: None,
            d1_roll_contingency_margin: None,
            options_roll_contingency_margin: None,
            options_contingency_margin: None,
        }
    }
}
