#![allow(missing_docs)]
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize)]
#[allow(non_snake_case)]
pub struct OptionChainRequest {
pub UnderlyingScrip: u64,
pub UnderlyingSeg: String,
pub Expiry: String,
}
#[derive(Debug, Clone, Serialize)]
#[allow(non_snake_case)]
pub struct ExpiryListRequest {
pub UnderlyingScrip: u64,
pub UnderlyingSeg: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct Greeks {
pub delta: f64,
pub theta: f64,
pub gamma: f64,
pub vega: f64,
}
#[derive(Debug, Clone, Deserialize)]
pub struct OptionData {
#[serde(default)]
pub average_price: Option<f64>,
pub greeks: Option<Greeks>,
#[serde(default)]
pub implied_volatility: Option<f64>,
pub last_price: f64,
#[serde(default)]
pub oi: Option<i64>,
#[serde(default)]
pub previous_close_price: Option<f64>,
#[serde(default)]
pub previous_oi: Option<i64>,
#[serde(default)]
pub previous_volume: Option<i64>,
#[serde(default)]
pub security_id: Option<u64>,
#[serde(default)]
pub top_ask_price: Option<f64>,
#[serde(default)]
pub top_ask_quantity: Option<i64>,
#[serde(default)]
pub top_bid_price: Option<f64>,
#[serde(default)]
pub top_bid_quantity: Option<i64>,
#[serde(default)]
pub volume: Option<i64>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct StrikeData {
pub ce: Option<OptionData>,
pub pe: Option<OptionData>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct OptionChainData {
pub last_price: f64,
pub oc: HashMap<String, StrikeData>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct OptionChainResponse {
pub data: OptionChainData,
pub status: String,
}
#[derive(Debug, Clone, Deserialize)]
pub struct ExpiryListResponse {
pub data: Vec<String>,
pub status: String,
}