76 lines
1.3 KiB
Rust
76 lines
1.3 KiB
Rust
mod windows;
|
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
use crate::domains::common::*;
|
|
|
|
pub use self::windows::WindowsEvent;
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Event {
|
|
pub name: String,
|
|
#[serde(flatten)]
|
|
pub body: EventBody,
|
|
pub description: String,
|
|
}
|
|
|
|
impl DomainModel for Event {
|
|
fn kind() -> DomainModelKind {
|
|
DomainModelKind::ObserveEvent
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
self.name.as_str()
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub enum EventBody {
|
|
WindowsEvent(WindowsEvent),
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Detection {
|
|
pub name: String,
|
|
}
|
|
|
|
impl DomainModel for Detection {
|
|
fn kind() -> DomainModelKind {
|
|
DomainModelKind::ObserveDetection
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
self.name.as_str()
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Provider {
|
|
pub name: String,
|
|
}
|
|
|
|
impl DomainModel for Provider {
|
|
fn kind() -> DomainModelKind {
|
|
DomainModelKind::ObserveProvider
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
self.name.as_str()
|
|
}
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Configuration {
|
|
pub name: String,
|
|
}
|
|
|
|
impl DomainModel for Configuration {
|
|
fn kind() -> DomainModelKind {
|
|
DomainModelKind::ObserveConfiguration
|
|
}
|
|
|
|
fn name(&self) -> &str {
|
|
self.name.as_str()
|
|
}
|
|
}
|