Skip to main content

sz_configtool_lib/
lib.rs

1//! # SzConfigTool Library
2//!
3//! Pure Rust library for manipulating Senzing configuration JSON documents.
4//!
5//! This library provides programmatic access to configuration operations
6//! without any display logic, making it suitable for automation, migration
7//! scripts, and external tools.
8//!
9//! ## ⚠️ Important: Unofficial SDK - Requires Senzing Guidance
10//!
11//! **This is an unofficial SDK.** Senzing does not publicly document the meaning, usage, or
12//! recommended practices for most configuration functions and parameters beyond basic operations
13//! (like adding data sources).
14//!
15//! **Before using this library**, you should have received specific guidance from Senzing support
16//! or documentation about:
17//! - When and why to use particular configuration functions
18//! - Appropriate parameter values for your specific use case
19//! - Impact of configuration changes on entity resolution behavior
20//!
21//! This library provides the programmatic interface ("how") - proper usage requires
22//! Senzing-provided guidance on configuration best practices ("what" and "when").
23//!
24//! ## Features
25//!
26//! - Pure JSON manipulation (no SDK dependencies)
27//! - No display logic (no formatting, colors, or output)
28//! - Type-safe error handling
29//! - Parameters aligned with sz_configtool CLI commands
30//!
31//! ## Example Usage
32//!
33//! ```no_run
34//! use sz_configtool_lib::{datasources, attributes};
35//!
36//! fn main() -> Result<(), Box<dyn std::error::Error>> {
37//!     // Load existing config
38//!     let config = std::fs::read_to_string("g2config.json")?;
39//!
40//!     // Add a data source
41//!     let config = datasources::add_data_source(
42//!         &config,
43//!         datasources::AddDataSourceParams {
44//!             code: "NEW_SOURCE",
45//!             ..Default::default()
46//!         },
47//!     )?;
48//!
49//!     // Add an attribute
50//!     let (config, _) = attributes::add_attribute(
51//!         &config,
52//!         attributes::AddAttributeParams {
53//!             attribute: "NEW_ATTR",
54//!             feature: "ADDRESS",
55//!             element: "ELEMENT",
56//!             class: "OTHER",
57//!             default_value: None,
58//!             internal: None,
59//!             required: None,
60//!         },
61//!     )?;
62//!
63//!     // Save modified config
64//!     std::fs::write("g2config_modified.json", config)?;
65//!
66//!     Ok(())
67//! }
68//! ```
69
70pub mod error;
71pub mod helpers;
72
73// Core entity modules
74pub mod attributes;
75pub mod behavior_overrides;
76pub mod datasources;
77pub mod elements;
78pub mod features;
79pub mod thresholds;
80
81// Advanced operations modules
82pub mod command_processor;
83pub mod config_sections;
84pub mod fragments;
85pub mod generic_plans;
86pub mod hashes;
87pub mod rules;
88pub mod system_params;
89pub mod versioning;
90
91// Function and call management modules
92pub mod calls;
93pub mod functions;
94
95// Re-export commonly used types
96pub use error::{Result, SzConfigError};
97
98// C FFI module
99pub mod ffi;