1use crate::client::DhanClient;
5use crate::error::{DhanError, Result};
6use crate::types::data::*;
7
8impl DhanClient {
9 pub async fn get_rolling_option_data(
13 &self,
14 req: &RollingOptionRequest,
15 ) -> Result<RollingOptionResponse> {
16 req.validate()
17 .map_err(|message| DhanError::InvalidArgument(message.into()))?;
18 self.post("/v2/charts/rollingoption", req).await
19 }
20
21 pub async fn get_technical_metrics(
25 &self,
26 req: &TechnicalMetricsRequest,
27 ) -> Result<TechnicalMetricsResponse> {
28 req.validate()
29 .map_err(|message| DhanError::InvalidArgument(message.into()))?;
30 self.post("/v2/data/technical", req).await
31 }
32
33 pub async fn get_market_movers(
37 &self,
38 req: &MarketMoversRequest,
39 ) -> Result<MarketMoversResponse> {
40 req.validate()
41 .map_err(|message| DhanError::InvalidArgument(message.into()))?;
42 self.post("/v2/data/marketmovers", req).await
43 }
44
45 pub async fn get_company_info(&self, req: &CompanyInfoRequest) -> Result<CompanyInfoResponse> {
49 req.validate()
50 .map_err(|message| DhanError::InvalidArgument(message.into()))?;
51 self.post("/v2/data/companyinfo", req).await
52 }
53}