use std::collections::HashMap;
use serde_json::Value;
use crate::error::TombaError;
use crate::tomba::{Tomba, TombaResponse};
impl Tomba {
pub fn list_leads_attributes(&self) -> Result<TombaResponse, TombaError> {
self.call("GET", "leads_attributes", &HashMap::new())
}
pub fn get_leads_attribute(
&self,
id: &str,
) -> Result<TombaResponse, TombaError> {
let path = format!("leads_attributes/{}", id);
self.call("GET", &path, &HashMap::new())
}
pub fn create_leads_attribute(
&self,
body: &Value,
) -> Result<TombaResponse, TombaError> {
self.call_json("POST", "leads_attributes", body)
}
pub fn update_leads_attribute(
&self,
id: &str,
body: &Value,
) -> Result<TombaResponse, TombaError> {
let path = format!("leads_attributes/{}", id);
self.call_json("PUT", &path, body)
}
pub fn delete_leads_attribute(
&self,
id: &str,
) -> Result<TombaResponse, TombaError> {
let path = format!("leads_attributes/{}", id);
self.call("DELETE", &path, &HashMap::new())
}
}