use crate::error::Error;
use crate::http::HttpClient;
use crate::types::common::RequestOptions;
use crate::types::discovery::{
DiscoverEffectsRequest, DiscoverEffectsResponse, PredictFromDiscoveryRequest,
PredictFromDiscoveryResponse,
};
#[derive(Debug, Clone)]
pub struct DiscoveryClient {
http: HttpClient,
}
impl DiscoveryClient {
pub(crate) fn new(http: HttpClient) -> Self {
Self { http }
}
pub async fn discover_effects(
&self,
request: DiscoverEffectsRequest,
options: Option<&RequestOptions>,
) -> Result<DiscoverEffectsResponse, Error> {
self.http
.post("/discovery/effects", &request, options)
.await
}
pub async fn predict(
&self,
request: PredictFromDiscoveryRequest,
options: Option<&RequestOptions>,
) -> Result<PredictFromDiscoveryResponse, Error> {
self.http
.post("/discovery/predict", &request, options)
.await
}
}