#[allow(unused_imports)]
use serde_json::Value;
#[derive(Debug, Serialize, Deserialize)]
pub struct OrderRequest {
#[serde(rename = "acctId")]
acct_id: Option<String>,
#[serde(rename = "conid")]
conid: Option<i32>,
#[serde(rename = "secType")]
sec_type: Option<String>,
#[serde(rename = "cOID")]
c_oid: Option<String>,
#[serde(rename = "orderType")]
order_type: Option<String>,
#[serde(rename = "listingExchange")]
listing_exchange: Option<String>,
#[serde(rename = "outsideRTH")]
outside_rth: Option<bool>,
#[serde(rename = "price")]
price: Option<f32>,
#[serde(rename = "side")]
side: Option<String>,
#[serde(rename = "ticker")]
ticker: Option<String>,
#[serde(rename = "tif")]
tif: Option<String>,
#[serde(rename = "referrer")]
referrer: Option<String>,
#[serde(rename = "quantity")]
quantity: Option<f32>
}
impl OrderRequest {
pub fn new() -> OrderRequest {
OrderRequest {
acct_id: None,
conid: None,
sec_type: None,
c_oid: None,
order_type: None,
listing_exchange: None,
outside_rth: None,
price: None,
side: None,
ticker: None,
tif: None,
referrer: None,
quantity: 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) -> OrderRequest {
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_conid(&mut self, conid: i32) {
self.conid = Some(conid);
}
pub fn with_conid(mut self, conid: i32) -> OrderRequest {
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_sec_type(&mut self, sec_type: String) {
self.sec_type = Some(sec_type);
}
pub fn with_sec_type(mut self, sec_type: String) -> OrderRequest {
self.sec_type = Some(sec_type);
self
}
pub fn sec_type(&self) -> Option<&String> {
self.sec_type.as_ref()
}
pub fn reset_sec_type(&mut self) {
self.sec_type = None;
}
pub fn set_c_oid(&mut self, c_oid: String) {
self.c_oid = Some(c_oid);
}
pub fn with_c_oid(mut self, c_oid: String) -> OrderRequest {
self.c_oid = Some(c_oid);
self
}
pub fn c_oid(&self) -> Option<&String> {
self.c_oid.as_ref()
}
pub fn reset_c_oid(&mut self) {
self.c_oid = 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) -> OrderRequest {
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_listing_exchange(&mut self, listing_exchange: String) {
self.listing_exchange = Some(listing_exchange);
}
pub fn with_listing_exchange(mut self, listing_exchange: String) -> OrderRequest {
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_outside_rth(&mut self, outside_rth: bool) {
self.outside_rth = Some(outside_rth);
}
pub fn with_outside_rth(mut self, outside_rth: bool) -> OrderRequest {
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) -> OrderRequest {
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_side(&mut self, side: String) {
self.side = Some(side);
}
pub fn with_side(mut self, side: String) -> OrderRequest {
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) -> OrderRequest {
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) -> OrderRequest {
self.tif = Some(tif);
self
}
pub fn tif(&self) -> Option<&String> {
self.tif.as_ref()
}
pub fn reset_tif(&mut self) {
self.tif = None;
}
pub fn set_referrer(&mut self, referrer: String) {
self.referrer = Some(referrer);
}
pub fn with_referrer(mut self, referrer: String) -> OrderRequest {
self.referrer = Some(referrer);
self
}
pub fn referrer(&self) -> Option<&String> {
self.referrer.as_ref()
}
pub fn reset_referrer(&mut self) {
self.referrer = None;
}
pub fn set_quantity(&mut self, quantity: f32) {
self.quantity = Some(quantity);
}
pub fn with_quantity(mut self, quantity: f32) -> OrderRequest {
self.quantity = Some(quantity);
self
}
pub fn quantity(&self) -> Option<&f32> {
self.quantity.as_ref()
}
pub fn reset_quantity(&mut self) {
self.quantity = None;
}
}