ocsf_codegen/
profiles.rs

1use crate::module::Module;
2use crate::*;
3
4// TODO: profiles from the profiles dir
5
6pub fn generate_profiles(paths: &DirPaths, root_module: &mut Module) -> Result<(), Box<dyn Error>> {
7    // let mut output_scope = codegen::Scope::new();
8
9    let profiles_module = root_module
10        .children
11        .get_mut("profiles")
12        .expect("Couldn't find the profiles module in root?");
13
14    profiles_module.scope.writeln("//* OCSF Profiles");
15    profiles_module.scope.add_generation_timestamp_comment();
16
17    write_source_file(
18        &format!("{}src/profiles.rs", paths.destination_path),
19        &profiles_module.scope.to_string(),
20    )
21}