ib 3.0.0

A Rust client to the Interactive Brokers HTTP REST API
Documentation
/* 
 * Client Portal Web API
 *
 * Client Poral Web API
 *
 * OpenAPI spec version: 1.0.0
 * 
 * Generated by: https://github.com/swagger-api/swagger-codegen.git
 */


#[allow(unused_imports)]
use serde_json::Value;

#[derive(Debug, Serialize, Deserialize)]
pub struct ModifyOrder {
  #[serde(rename = "acctId")]
  acct_id: Option<String>,
  #[serde(rename = "auxPrice")]
  aux_price: Option<f32>,
  #[serde(rename = "conid")]
  conid: Option<i32>,
  /// Set to true if you want to pause a working order. For details refer to the [TWS Users' Guide:](https://guides.interactivebrokers.com/tws/twsguide.html#usersguidebook/getstarted/pause_execution.htm) 
  #[serde(rename = "deactivated")]
  deactivated: Option<bool>,
  /// optional, not required
  #[serde(rename = "listingExchange")]
  listing_exchange: Option<String>,
  /// for example LMT
  #[serde(rename = "orderType")]
  order_type: Option<String>,
  #[serde(rename = "outsideRTH")]
  outside_rth: Option<bool>,
  #[serde(rename = "price")]
  price: Option<f32>,
  /// usually integer, for some special cases can be float numbers
  #[serde(rename = "quantity")]
  quantity: Option<f32>,
  /// SELL or BUY
  #[serde(rename = "side")]
  side: Option<String>,
  /// The ticker symbol of the original place order
  #[serde(rename = "ticker")]
  ticker: Option<String>,
  /// Specify a time in force to change how long your order will continue to work in the market
  #[serde(rename = "tif")]
  tif: Option<String>
}

impl ModifyOrder {
  pub fn new() -> ModifyOrder {
    ModifyOrder {
      acct_id: None,
      aux_price: None,
      conid: None,
      deactivated: None,
      listing_exchange: None,
      order_type: None,
      outside_rth: None,
      price: None,
      quantity: None,
      side: None,
      ticker: None,
      tif: None
    }
  }

  pub fn set_acct_id(&mut self, acct_id: String) {
    self.acct_id = Some(acct_id);
  }

  pub fn with_acct_id(mut self, acct_id: String) -> ModifyOrder {
    self.acct_id = Some(acct_id);
    self
  }

  pub fn acct_id(&self) -> Option<&String> {
    self.acct_id.as_ref()
  }

  pub fn reset_acct_id(&mut self) {
    self.acct_id = None;
  }

  pub fn set_aux_price(&mut self, aux_price: f32) {
    self.aux_price = Some(aux_price);
  }

  pub fn with_aux_price(mut self, aux_price: f32) -> ModifyOrder {
    self.aux_price = Some(aux_price);
    self
  }

  pub fn aux_price(&self) -> Option<&f32> {
    self.aux_price.as_ref()
  }

  pub fn reset_aux_price(&mut self) {
    self.aux_price = None;
  }

  pub fn set_conid(&mut self, conid: i32) {
    self.conid = Some(conid);
  }

  pub fn with_conid(mut self, conid: i32) -> ModifyOrder {
    self.conid = Some(conid);
    self
  }

  pub fn conid(&self) -> Option<&i32> {
    self.conid.as_ref()
  }

  pub fn reset_conid(&mut self) {
    self.conid = None;
  }

  pub fn set_deactivated(&mut self, deactivated: bool) {
    self.deactivated = Some(deactivated);
  }

  pub fn with_deactivated(mut self, deactivated: bool) -> ModifyOrder {
    self.deactivated = Some(deactivated);
    self
  }

  pub fn deactivated(&self) -> Option<&bool> {
    self.deactivated.as_ref()
  }

  pub fn reset_deactivated(&mut self) {
    self.deactivated = None;
  }

  pub fn set_listing_exchange(&mut self, listing_exchange: String) {
    self.listing_exchange = Some(listing_exchange);
  }

  pub fn with_listing_exchange(mut self, listing_exchange: String) -> ModifyOrder {
    self.listing_exchange = Some(listing_exchange);
    self
  }

  pub fn listing_exchange(&self) -> Option<&String> {
    self.listing_exchange.as_ref()
  }

  pub fn reset_listing_exchange(&mut self) {
    self.listing_exchange = None;
  }

  pub fn set_order_type(&mut self, order_type: String) {
    self.order_type = Some(order_type);
  }

  pub fn with_order_type(mut self, order_type: String) -> ModifyOrder {
    self.order_type = Some(order_type);
    self
  }

  pub fn order_type(&self) -> Option<&String> {
    self.order_type.as_ref()
  }

  pub fn reset_order_type(&mut self) {
    self.order_type = None;
  }

  pub fn set_outside_rth(&mut self, outside_rth: bool) {
    self.outside_rth = Some(outside_rth);
  }

  pub fn with_outside_rth(mut self, outside_rth: bool) -> ModifyOrder {
    self.outside_rth = Some(outside_rth);
    self
  }

  pub fn outside_rth(&self) -> Option<&bool> {
    self.outside_rth.as_ref()
  }

  pub fn reset_outside_rth(&mut self) {
    self.outside_rth = None;
  }

  pub fn set_price(&mut self, price: f32) {
    self.price = Some(price);
  }

  pub fn with_price(mut self, price: f32) -> ModifyOrder {
    self.price = Some(price);
    self
  }

  pub fn price(&self) -> Option<&f32> {
    self.price.as_ref()
  }

  pub fn reset_price(&mut self) {
    self.price = None;
  }

  pub fn set_quantity(&mut self, quantity: f32) {
    self.quantity = Some(quantity);
  }

  pub fn with_quantity(mut self, quantity: f32) -> ModifyOrder {
    self.quantity = Some(quantity);
    self
  }

  pub fn quantity(&self) -> Option<&f32> {
    self.quantity.as_ref()
  }

  pub fn reset_quantity(&mut self) {
    self.quantity = None;
  }

  pub fn set_side(&mut self, side: String) {
    self.side = Some(side);
  }

  pub fn with_side(mut self, side: String) -> ModifyOrder {
    self.side = Some(side);
    self
  }

  pub fn side(&self) -> Option<&String> {
    self.side.as_ref()
  }

  pub fn reset_side(&mut self) {
    self.side = None;
  }

  pub fn set_ticker(&mut self, ticker: String) {
    self.ticker = Some(ticker);
  }

  pub fn with_ticker(mut self, ticker: String) -> ModifyOrder {
    self.ticker = Some(ticker);
    self
  }

  pub fn ticker(&self) -> Option<&String> {
    self.ticker.as_ref()
  }

  pub fn reset_ticker(&mut self) {
    self.ticker = None;
  }

  pub fn set_tif(&mut self, tif: String) {
    self.tif = Some(tif);
  }

  pub fn with_tif(mut self, tif: String) -> ModifyOrder {
    self.tif = Some(tif);
    self
  }

  pub fn tif(&self) -> Option<&String> {
    self.tif.as_ref()
  }

  pub fn reset_tif(&mut self) {
    self.tif = None;
  }

}