66 行
2 KiB
Rust
66 行
2 KiB
Rust
|
|
use serde::{Deserialize, Serialize};
|
||
|
|
|
||
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase")]
|
||
|
|
pub enum DiagnosticEntryKind {
|
||
|
|
System,
|
||
|
|
Window,
|
||
|
|
Process,
|
||
|
|
EventLog,
|
||
|
|
Network,
|
||
|
|
Port,
|
||
|
|
Service,
|
||
|
|
LogTail,
|
||
|
|
Configuration,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||
|
|
pub struct RedactionSummary {
|
||
|
|
pub category: String,
|
||
|
|
pub count: u32,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||
|
|
pub struct DiagnosticEntry {
|
||
|
|
pub entry_id: String,
|
||
|
|
pub kind: DiagnosticEntryKind,
|
||
|
|
pub source_label: String,
|
||
|
|
pub summary: String,
|
||
|
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||
|
|
pub content: Option<String>,
|
||
|
|
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||
|
|
pub mime_type: Option<String>,
|
||
|
|
#[serde(default)]
|
||
|
|
pub truncated: bool,
|
||
|
|
#[serde(default)]
|
||
|
|
pub redactions: Vec<RedactionSummary>,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||
|
|
pub struct DiagnosticAttachmentReference {
|
||
|
|
pub attachment_id: String,
|
||
|
|
pub mime_type: String,
|
||
|
|
pub size_bytes: u64,
|
||
|
|
pub sha256: String,
|
||
|
|
}
|
||
|
|
|
||
|
|
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||
|
|
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
|
||
|
|
#[serde(rename_all = "camelCase", deny_unknown_fields)]
|
||
|
|
pub struct DiagnosticBundle {
|
||
|
|
pub bundle_id: String,
|
||
|
|
pub generated_at: String,
|
||
|
|
pub scope: Vec<String>,
|
||
|
|
pub entries: Vec<DiagnosticEntry>,
|
||
|
|
#[serde(default)]
|
||
|
|
pub attachments: Vec<DiagnosticAttachmentReference>,
|
||
|
|
pub total_bytes: u64,
|
||
|
|
}
|