/*
 * 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 AlertRequest {
    /// orderId is required when modifying alert. You can get it from /iserver/account/:accountId/alerts 
    #[serde(rename = "orderId", skip_serializing_if = "Option::is_none")]
    pub order_id: Option<i32>,
    /// name of alert
    #[serde(rename = "alertName", skip_serializing_if = "Option::is_none")]
    pub alert_name: Option<String>,
    /// The message you want to receive via email or text message
    #[serde(rename = "alertMessage", skip_serializing_if = "Option::is_none")]
    pub alert_message: Option<String>,
    /// whether alert is repeatable or not, so value can only be 0 or 1, this has to be 1 for MTA alert
    #[serde(rename = "alertRepeatable", skip_serializing_if = "Option::is_none")]
    pub alert_repeatable: Option<i32>,
    /// email address to receive alert
    #[serde(rename = "email", skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    /// whether allowing to send email or not, so value can only be 0 or 1, 
    #[serde(rename = "sendMessage", skip_serializing_if = "Option::is_none")]
    pub send_message: Option<i32>,
    /// time in force, can only be GTC or GTD
    #[serde(rename = "tif", skip_serializing_if = "Option::is_none")]
    pub tif: Option<String>,
    /// format, YYYYMMDD-HH:mm:ss, please NOTE this will only work when tif is GTD 
    #[serde(rename = "expireTime", skip_serializing_if = "Option::is_none")]
    pub expire_time: Option<String>,
    /// value can only be 0 or 1, set to 1 if the alert can be triggered outside regular trading hours. 
    #[serde(rename = "outsideRth", skip_serializing_if = "Option::is_none")]
    pub outside_rth: Option<i32>,
    /// value can only be 0 or 1, set to 1 to enable the alert only in IBKR mobile 
    #[serde(rename = "iTWSOrdersOnly", skip_serializing_if = "Option::is_none")]
    pub i_tws_orders_only: Option<i32>,
    /// value can only be 0 or 1, set to 1 to allow to show alert in pop-ups
    #[serde(rename = "showPopup", skip_serializing_if = "Option::is_none")]
    pub show_popup: Option<i32>,
    /// for MTA alert only, each user has a unique toolId and it will stay the same, do not send for normal alert 
    #[serde(rename = "toolId", skip_serializing_if = "Option::is_none")]
    pub tool_id: Option<i32>,
    /// audio message to play when alert is triggered
    #[serde(rename = "playAudio", skip_serializing_if = "Option::is_none")]
    pub play_audio: Option<String>,
    #[serde(rename = "conditions", skip_serializing_if = "Option::is_none")]
    pub conditions: Option<Vec<crate::models::AlertRequestConditions>>,
}

impl AlertRequest {
    pub fn new() -> AlertRequest {
        AlertRequest {
            order_id: None,
            alert_name: None,
            alert_message: None,
            alert_repeatable: None,
            email: None,
            send_message: None,
            tif: None,
            expire_time: None,
            outside_rth: None,
            i_tws_orders_only: None,
            show_popup: None,
            tool_id: None,
            play_audio: None,
            conditions: None,
        }
    }
}


