use crate::error::Result;
use std::collections::HashMap;
#[derive(Debug, Clone)]
pub struct AgentConfig {
pub agent_did: String,
pub security_mode: Option<String>,
pub debug: bool,
pub timeout_seconds: Option<u64>,
pub parameters: HashMap<String, String>,
}
impl AgentConfig {
pub fn new(did: String) -> Self {
Self {
agent_did: did,
security_mode: Some("SIGNED".to_string()),
debug: false,
timeout_seconds: Some(30),
parameters: HashMap::new(),
}
}
pub fn set_parameter(&mut self, key: &str, value: &str) {
self.parameters.insert(key.to_string(), value.to_string());
}
pub fn get_parameter(&self, key: &str) -> Option<&String> {
self.parameters.get(key)
}
pub fn with_security_mode(mut self, mode: &str) -> Self {
self.security_mode = Some(mode.to_string());
self
}
pub fn with_debug(mut self, debug: bool) -> Self {
self.debug = debug;
self
}
}
impl Default for AgentConfig {
fn default() -> Self {
Self::new("default_did".to_string())
}
}
pub fn validate(_config: &AgentConfig) -> Result<()> {
Ok(())
}