use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GttOrderRequest {
pub side: i64,
pub symbol: String,
#[serde(rename = "productType")]
pub product_type: String,
#[serde(default, rename = "orderTag", skip_serializing_if = "Option::is_none")]
pub order_tag: Option<String>,
#[serde(rename = "orderInfo")]
pub order_info: GttOrderInfo,
}
pub type GttOcoOrderRequest = GttOrderRequest;
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GttOrderInfo {
pub leg1: GttOrderLeg,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub leg2: Option<GttOrderLeg>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GttOrderLeg {
pub price: f64,
#[serde(rename = "triggerPrice")]
pub trigger_price: f64,
pub qty: i64,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ModifyGttOrderRequest {
pub id: String,
#[serde(rename = "orderInfo")]
pub order_info: GttOrderInfo,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CancelGttOrderRequest {
pub id: String,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct GttActionResponse {
pub code: i64,
pub s: String,
pub message: String,
#[serde(default)]
pub id: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GttOrderBookResponse {
pub code: i64,
pub s: String,
pub message: String,
#[serde(rename = "orderBook")]
pub order_book: Vec<GttOrderBookItem>,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct GttOrderBookItem {
#[serde(rename = "clientId")]
pub client_id: String,
pub exchange: i64,
pub fy_token: String,
pub id_fyers: String,
pub id: String,
pub instrument: i64,
pub lot_size: i64,
pub multiplier: i64,
pub ord_status: i64,
pub precision: i64,
pub price_limit: f64,
pub price2_limit: f64,
pub price_trigger: f64,
pub price2_trigger: f64,
pub product_type: String,
pub qty: i64,
pub qty2: i64,
pub report_type: String,
pub segment: i64,
pub symbol: String,
pub symbol_desc: String,
pub symbol_exch: String,
pub tick_size: f64,
pub tran_side: i64,
pub gtt_oco_ind: i64,
pub create_time: String,
pub create_time_epoch: i64,
pub oms_msg: String,
pub ltp_ch: f64,
pub ltp_chp: f64,
pub ltp: f64,
}