use crate::client::DhanClient;
use crate::error::{DhanError, Result};
use crate::types::data::*;
impl DhanClient {
pub async fn get_rolling_option_data(
&self,
req: &RollingOptionRequest,
) -> Result<RollingOptionResponse> {
req.validate()
.map_err(|message| DhanError::InvalidArgument(message.into()))?;
self.post("/v2/charts/rollingoption", req).await
}
pub async fn get_technical_metrics(
&self,
req: &TechnicalMetricsRequest,
) -> Result<TechnicalMetricsResponse> {
req.validate()
.map_err(|message| DhanError::InvalidArgument(message.into()))?;
self.post("/v2/data/technical", req).await
}
pub async fn get_market_movers(
&self,
req: &MarketMoversRequest,
) -> Result<MarketMoversResponse> {
req.validate()
.map_err(|message| DhanError::InvalidArgument(message.into()))?;
self.post("/v2/data/marketmovers", req).await
}
pub async fn get_company_info(&self, req: &CompanyInfoRequest) -> Result<CompanyInfoResponse> {
req.validate()
.map_err(|message| DhanError::InvalidArgument(message.into()))?;
self.post("/v2/data/companyinfo", req).await
}
}