use serde_json::Value;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RawAuditEvent(Value);
impl RawAuditEvent {
pub fn new(value: Value) -> Self {
Self(value)
}
pub(crate) fn into_value(self) -> Value {
self.0
}
}
impl From<Value> for RawAuditEvent {
fn from(value: Value) -> Self {
Self::new(value)
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct SanitizedAuditEvent(Value);
impl SanitizedAuditEvent {
pub(crate) fn new(value: Value) -> Self {
Self(value)
}
pub fn as_value(&self) -> &Value {
&self.0
}
pub fn into_value(self) -> Value {
self.0
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct HeartbeatUpdate {
pub agent_id: String,
pub last_heartbeat_at: Value,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum SanitizeOutcome {
Audit(SanitizedAuditEvent),
Heartbeat(HeartbeatUpdate),
}