Skip to main content

orvanta_api/models/
log_search_hit.rs

1/*
2 * Orvanta API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.7.0
7 * Contact: contact@orvanta.cloud
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LogSearchHit : A matched service-log line. `document` is Tantivy's native `{field: [values, ...]}` shape, with keys `host`, `mode`, `worker_group`, `file_name`, `line_number`, `timestamp`, `json_fmt`, `logs`.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LogSearchHit {
17    #[serde(rename = "document", skip_serializing_if = "Option::is_none")]
18    pub document: Option<serde_json::Value>,
19    /// Plain-text excerpt around the match, if a snippet could be generated.
20    #[serde(rename = "snippet_fragment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub snippet_fragment: Option<Option<String>>,
22    /// Character ranges within `snippet_fragment` to highlight.
23    #[serde(rename = "snippet_highlighted", skip_serializing_if = "Option::is_none")]
24    pub snippet_highlighted: Option<Vec<models::LogSearchHitSnippetHighlightedInner>>,
25}
26
27impl LogSearchHit {
28    /// A matched service-log line. `document` is Tantivy's native `{field: [values, ...]}` shape, with keys `host`, `mode`, `worker_group`, `file_name`, `line_number`, `timestamp`, `json_fmt`, `logs`.
29    pub fn new() -> LogSearchHit {
30        LogSearchHit {
31            document: None,
32            snippet_fragment: None,
33            snippet_highlighted: None,
34        }
35    }
36}
37