use indexmap::IndexMap;
use super::option::CrawlerOption;
#[derive(Debug, Clone)]
pub struct OptionGroup {
pub apl_code: String,
pub name: String,
pub options: IndexMap<String, CrawlerOption>,
}
impl OptionGroup {
pub fn new(apl_code: &str, name: &str, options: Vec<CrawlerOption>) -> Self {
let mut options_map = IndexMap::new();
for option in options {
options_map.insert(option.property_to_fill.clone(), option);
}
Self {
apl_code: apl_code.to_string(),
name: name.to_string(),
options: options_map,
}
}
}