/*
 * Websocket Subscription Schemas
 *
 * Schema definitions Websocket API subscriptions for Thalex exchange.
 *
 * 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 UnderlyingStatisticsPayload {
    /// Total amount traded in 24 hours, including futures and options.
    #[serde(rename = "trade_volume_24h", skip_serializing_if = "Option::is_none")]
    pub trade_volume_24h: Option<rust_decimal::Decimal>,
    /// Total amount of options traded in the past 24 hours.
    #[serde(rename = "option_volume_24h", skip_serializing_if = "Option::is_none")]
    pub option_volume_24h: Option<rust_decimal::Decimal>,
    /// Total amount of futures traded in the past 24 hours.
    #[serde(
        rename = "delta_one_volume_24h",
        skip_serializing_if = "Option::is_none"
    )]
    pub delta_one_volume_24h: Option<rust_decimal::Decimal>,
    /// Total underlying value traded in 24 hours. This is the sum of (amount * index price at time of trade).
    #[serde(rename = "trade_value_24h", skip_serializing_if = "Option::is_none")]
    pub trade_value_24h: Option<rust_decimal::Decimal>,
    /// Total option value traded in 24 hours. This is the sum of (amount * index price at time of trade).
    #[serde(rename = "option_value_24h", skip_serializing_if = "Option::is_none")]
    pub option_value_24h: Option<rust_decimal::Decimal>,
    /// Total delta one value traded in 24 hours. This is the sum of (amount * index price at time of trade).
    #[serde(
        rename = "delta_one_value_24h",
        skip_serializing_if = "Option::is_none"
    )]
    pub delta_one_value_24h: Option<rust_decimal::Decimal>,
    #[serde(rename = "open_interest", skip_serializing_if = "Option::is_none")]
    pub open_interest: Option<models::UnderlyingStatisticsOpenInterest>,
}

impl UnderlyingStatisticsPayload {
    pub fn new() -> UnderlyingStatisticsPayload {
        UnderlyingStatisticsPayload {
            trade_volume_24h: None,
            option_volume_24h: None,
            delta_one_volume_24h: None,
            trade_value_24h: None,
            option_value_24h: None,
            delta_one_value_24h: None,
            open_interest: None,
        }
    }
}
