use anyhow::Result;
use crate::Client;
pub struct ThreatInsights {
pub client: Client,
}
impl ThreatInsights {
#[doc(hidden)]
pub fn new(client: Client) -> Self {
ThreatInsights { client }
}
pub async fn get_current_configuration(
&self,
) -> Result<crate::types::ThreatInsightConfiguration> {
let url = "/api/v1/threats/configuration".to_string();
self.client.get(&url, None).await
}
pub async fn update_configuration(
&self,
body: &crate::types::ThreatInsightConfiguration,
) -> Result<crate::types::ThreatInsightConfiguration> {
let url = "/api/v1/threats/configuration".to_string();
self.client
.post(&url, Some(reqwest::Body::from(serde_json::to_vec(body)?)))
.await
}
}