use std::collections::HashMap;
use crate::json::{from_number, Value};
#[derive(Debug, Clone, Default)]
pub struct EditThread(pub HashMap<&'static str, Value>);
impl EditThread {
pub fn name<D: ToString>(&mut self, name: D) -> &mut Self {
self.0.insert("name", Value::from(name.to_string()));
self
}
pub fn auto_archive_duration(&mut self, duration: u16) -> &mut Self {
self.0.insert("auto_archive_duration", from_number(duration));
self
}
pub fn archived(&mut self, archived: bool) -> &mut Self {
self.0.insert("archived", Value::from(archived));
self
}
pub fn locked(&mut self, lock: bool) -> &mut Self {
self.0.insert("locked", Value::from(lock));
self
}
pub fn invitable(&mut self, invitable: bool) -> &mut Self {
self.0.insert("invitable", Value::from(invitable));
self
}
}