(event: HookEvent)
| 93 | |
| 94 | impl HookContext { |
| 95 | pub fn new(event: HookEvent) -> Self { |
| 96 | Self { |
| 97 | event, |
| 98 | data: HashMap::new(), |
| 99 | session_id: None, |
| 100 | timestamp: Utc::now(), |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | pub fn with_data(mut self, key: &str, value: serde_json::Value) -> Self { |
| 105 | self.data.insert(key.to_string(), value); |