#[non_exhaustive]pub struct ExceptionItem {Show 15 fields
pub id: String,
pub item_id: String,
pub list_id: String,
pub name: String,
pub description: String,
pub namespace_type: NamespaceType,
pub revision: Option<String>,
pub item_type: String,
pub entries: Vec<Value>,
pub tags: Vec<String>,
pub os_types: Vec<OsType>,
pub comments: Vec<ItemComment>,
pub expire_time: Option<String>,
pub meta: Option<Map<String, Value>>,
pub extra: Map<String, Value>,
}Expand description
A retrieved exception item and its current entries and comments.
Use Self::edit to change it without dropping unchanged writable fields.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: StringKibana saved-object ID, distinct from item_id.
item_id: StringStable item identifier, retained across exports and imports.
list_id: String§name: String§description: String§namespace_type: NamespaceType§revision: Option<String>Opaque concurrency token, sent by ExceptionItem::edit.
item_type: String§entries: Vec<Value>JSON preserves entry variants added by newer deployments.
os_types: Vec<OsType>§comments: Vec<ItemComment>§expire_time: Option<String>§meta: Option<Map<String, Value>>§extra: Map<String, Value>Implementations§
Source§impl ExceptionItem
impl ExceptionItem
Sourcepub fn edit(&self) -> ItemEdit
pub fn edit(&self) -> ItemEdit
A replacement for this item that keeps its current editable fields, including entries of types this client does not model, until changed. It is bound to the item’s ID, namespace and concurrency token. Sending the edit fails locally if the retrieved token is missing or empty. Existing comments stay on the server; only newly added comments are sent.
use security_client_rs::exceptions::ExceptionItem;
use serde_json::{from_value, json, to_value};
let item: ExceptionItem = from_value(json!({
"id": "item-a", "item_id": "scanner", "list_id": "allowlist",
"name": "Scanner", "description": "Known host", "namespace_type": "single",
"_version": "opaque-token", "entries": [], "tags": ["reviewed"],
"comments": [{"id": "comment-a", "comment": "Already reviewed"}]
}))?;
let body = to_value(item.edit().name("Approved scanner").add_comment("Checked again"))?;
assert_eq!(body["_version"], "opaque-token");
assert_eq!(body["tags"], json!(["reviewed"]));
assert_eq!(body["comments"], json!([{"comment": "Checked again"}]));Trait Implementations§
Source§impl Clone for ExceptionItem
impl Clone for ExceptionItem
Source§impl Debug for ExceptionItem
impl Debug for ExceptionItem
Source§impl<'de> Deserialize<'de> for ExceptionItem
impl<'de> Deserialize<'de> for ExceptionItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<&'a ExceptionItem> for ItemTarget<'a>
impl<'a> From<&'a ExceptionItem> for ItemTarget<'a>
Source§fn from(item: &'a ExceptionItem) -> Self
fn from(item: &'a ExceptionItem) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ExceptionItem
impl RefUnwindSafe for ExceptionItem
impl Send for ExceptionItem
impl Sync for ExceptionItem
impl Unpin for ExceptionItem
impl UnsafeUnpin for ExceptionItem
impl UnwindSafe for ExceptionItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more