use serde_json::Value;
use tracing::debug;
use super::SessionClient;
use crate::error::Error;
impl SessionClient {
pub async fn list_network_conf(&self) -> Result<Vec<Value>, Error> {
let url = self.site_url("rest/networkconf");
debug!("listing networkconf records");
self.get(url).await
}
pub async fn create_network_conf(&self, body: &Value) -> Result<Vec<Value>, Error> {
let url = self.site_url("rest/networkconf");
debug!("creating networkconf record");
self.post(url, body).await
}
pub async fn update_network_conf(
&self,
record_id: &str,
body: &Value,
) -> Result<Vec<Value>, Error> {
let url = self.site_url(&format!("rest/networkconf/{record_id}"));
debug!(record_id, "updating networkconf record");
self.put(url, body).await
}
pub async fn delete_network_conf(&self, record_id: &str) -> Result<Vec<Value>, Error> {
let url = self.site_url(&format!("rest/networkconf/{record_id}"));
debug!(record_id, "deleting networkconf record");
self.delete(url).await
}
}