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

/// Order : contains all the order related info



#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Order {
    /// account id
    #[serde(rename = "acct", skip_serializing_if = "Option::is_none")]
    pub acct: Option<String>,
    #[serde(rename = "conid", skip_serializing_if = "Option::is_none")]
    pub conid: Option<i32>,
    #[serde(rename = "orderDesc", skip_serializing_if = "Option::is_none")]
    pub order_desc: Option<String>,
    #[serde(rename = "description1", skip_serializing_if = "Option::is_none")]
    pub description1: Option<String>,
    /// for exmple FB
    #[serde(rename = "ticker", skip_serializing_if = "Option::is_none")]
    pub ticker: Option<String>,
    /// for example STK
    #[serde(rename = "secType", skip_serializing_if = "Option::is_none")]
    pub sec_type: Option<String>,
    /// for example NASDAQ.NMS
    #[serde(rename = "listingExchange", skip_serializing_if = "Option::is_none")]
    pub listing_exchange: Option<String>,
    #[serde(rename = "remainingQuantity", skip_serializing_if = "Option::is_none")]
    pub remaining_quantity: Option<String>,
    #[serde(rename = "filledQuantity", skip_serializing_if = "Option::is_none")]
    pub filled_quantity: Option<String>,
    #[serde(rename = "companyName", skip_serializing_if = "Option::is_none")]
    pub company_name: Option<String>,
    /// PendingSubmit - Indicates the order was sent, but confirmation has not been received that it has been received by the destination.                  Occurs most commonly if an exchange is closed. PendingCancel - Indicates that a request has been sent to cancel an order but confirmation has not been received of its cancellation. PreSubmitted - Indicates that a simulated order type has been accepted by the IBKR system and that this order has yet to be elected.                 The order is held in the IBKR system until the election criteria are met. At that time the order is transmitted to the order destination as specified.  Submitted - Indicates that the order has been accepted at the order destination and is working. Cancelled - Indicates that the balance of the order has been confirmed cancelled by the IB system.              This could occur unexpectedly when IB or the destination has rejected the order.   Filled - Indicates that the order has been completely filled.  Inactive - Indicates the order is not working, for instance if the order was invalid and triggered an error message,            or if the order was to short a security and shares have not yet been located.  
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// for example Limit
    #[serde(rename = "origOrderType", skip_serializing_if = "Option::is_none")]
    pub orig_order_type: Option<String>,
    /// BUY or SELL
    #[serde(rename = "side", skip_serializing_if = "Option::is_none")]
    pub side: Option<String>,
    #[serde(rename = "price", skip_serializing_if = "Option::is_none")]
    pub price: Option<f32>,
    /// back-ground color
    #[serde(rename = "bgColor", skip_serializing_if = "Option::is_none")]
    pub bg_color: Option<String>,
    #[serde(rename = "fgColor", skip_serializing_if = "Option::is_none")]
    pub fg_color: Option<String>,
    #[serde(rename = "orderId", skip_serializing_if = "Option::is_none")]
    pub order_id: Option<i32>,
    /// Only exists in child order of bracket
    #[serde(rename = "parentId", skip_serializing_if = "Option::is_none")]
    pub parent_id: Option<i32>,
    /// User defined string used to identify the order. Value is set using \"cOID\" field while placing an order.
    #[serde(rename = "order_ref", skip_serializing_if = "Option::is_none")]
    pub order_ref: Option<String>,
}

impl Order {
    /// contains all the order related info
    pub fn new() -> Order {
        Order {
            acct: None,
            conid: None,
            order_desc: None,
            description1: None,
            ticker: None,
            sec_type: None,
            listing_exchange: None,
            remaining_quantity: None,
            filled_quantity: None,
            company_name: None,
            status: None,
            orig_order_type: None,
            side: None,
            price: None,
            bg_color: None,
            fg_color: None,
            order_id: None,
            parent_id: None,
            order_ref: None,
        }
    }
}


