use std::collections::HashMap;
use serde_json::Value;
use crate::error::TombaError;
use crate::tomba::{Tomba, TombaResponse};
impl Tomba {
pub fn list_leads_lists(&self) -> Result<TombaResponse, TombaError> {
self.call("GET", "leads_lists", &HashMap::new())
}
pub fn get_leads_list(
&self,
id: &str,
) -> Result<TombaResponse, TombaError> {
let path = format!("leads_lists/{}", id);
self.call("GET", &path, &HashMap::new())
}
pub fn create_leads_list(
&self,
body: &Value,
) -> Result<TombaResponse, TombaError> {
self.call_json("POST", "leads_lists", body)
}
pub fn update_leads_list(
&self,
id: &str,
body: &Value,
) -> Result<TombaResponse, TombaError> {
let path = format!("leads_lists/{}", id);
self.call_json("PUT", &path, body)
}
pub fn delete_leads_list(
&self,
id: &str,
) -> Result<TombaResponse, TombaError> {
let path = format!("leads_lists/{}", id);
self.call("DELETE", &path, &HashMap::new())
}
}