/*
 * Client Portal Web API
 *
 * Client Portal Web API
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct HistoryData {
    /// Underlying Symbol of the corresponding contract
    #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")]
    pub symbol: Option<String>,
    /// companyName of the corresponding contract
    #[serde(rename = "text", skip_serializing_if = "Option::is_none")]
    pub text: Option<String>,
    /// priceFactor is price increment obtained from display rule
    #[serde(rename = "priceFactor", skip_serializing_if = "Option::is_none")]
    pub price_factor: Option<i32>,
    /// start date time in the format YYYYMMDD-HH:mm:ss
    #[serde(rename = "startTime", skip_serializing_if = "Option::is_none")]
    pub start_time: Option<String>,
    /// High value during this time series with format %h/%v/%t. %h is the high price (scaled by priceFactor), %v is volume (volume factor will always be 100 (reported volume = actual volume/100)) and %t is minutes from start time of the chart 
    #[serde(rename = "high", skip_serializing_if = "Option::is_none")]
    pub high: Option<String>,
    /// Low value during this time series with format %l/%v/%t. %l is the low price (scaled by priceFactor), %v is volume (volume factor will always be 100 (reported volume = actual volume/100)) and %t is minutes from start time of the chart 
    #[serde(rename = "low", skip_serializing_if = "Option::is_none")]
    pub low: Option<String>,
    /// The duration for the historical data request
    #[serde(rename = "timePeriod", skip_serializing_if = "Option::is_none")]
    pub time_period: Option<String>,
    /// The number of seconds in a bar
    #[serde(rename = "barLength", skip_serializing_if = "Option::is_none")]
    pub bar_length: Option<i32>,
    /// Market Data Availability. The field may contain two chars. The first char is the primary code: S = Streaming, R = Realtime, D = Delayed, Z = Frozen, Y = Frozen Delayed. The second char is the secondary code: P = Snapshot Available, p = Consolidated. 
    #[serde(rename = "mdAvailability", skip_serializing_if = "Option::is_none")]
    pub md_availability: Option<String>,
    /// The time it takes, in milliseconds, to process the historical data request
    #[serde(rename = "mktDataDelay", skip_serializing_if = "Option::is_none")]
    pub mkt_data_delay: Option<i32>,
    /// The historical data returned includes outside of regular trading hours 
    #[serde(rename = "outsideRth", skip_serializing_if = "Option::is_none")]
    pub outside_rth: Option<bool>,
    /// The number of seconds in the trading day
    #[serde(rename = "tradingDayDuration", skip_serializing_if = "Option::is_none")]
    pub trading_day_duration: Option<i32>,
    #[serde(rename = "volumeFactor", skip_serializing_if = "Option::is_none")]
    pub volume_factor: Option<i32>,
    #[serde(rename = "priceDisplayRule", skip_serializing_if = "Option::is_none")]
    pub price_display_rule: Option<i32>,
    #[serde(rename = "priceDisplayValue", skip_serializing_if = "Option::is_none")]
    pub price_display_value: Option<String>,
    #[serde(rename = "negativeCapable", skip_serializing_if = "Option::is_none")]
    pub negative_capable: Option<bool>,
    #[serde(rename = "messageVersion", skip_serializing_if = "Option::is_none")]
    pub message_version: Option<i32>,
    #[serde(rename = "data", skip_serializing_if = "Option::is_none")]
    pub data: Option<Vec<crate::models::HistoryDataData>>,
    /// total number of points
    #[serde(rename = "points", skip_serializing_if = "Option::is_none")]
    pub points: Option<i32>,
    #[serde(rename = "travelTime", skip_serializing_if = "Option::is_none")]
    pub travel_time: Option<i32>,
}

impl HistoryData {
    pub fn new() -> HistoryData {
        HistoryData {
            symbol: None,
            text: None,
            price_factor: None,
            start_time: None,
            high: None,
            low: None,
            time_period: None,
            bar_length: None,
            md_availability: None,
            mkt_data_delay: None,
            outside_rth: None,
            trading_day_duration: None,
            volume_factor: None,
            price_display_rule: None,
            price_display_value: None,
            negative_capable: None,
            message_version: None,
            data: None,
            points: None,
            travel_time: None,
        }
    }
}


