windmill-api 1.800.1

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
Documentation
/*
 * Windmill API
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.800.1
 * Contact: contact@windmill.dev
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LogSearchHit {
    /// timestamp of the log line itself, not of the file containing it
    #[serde(rename = "ts")]
    pub ts: String,
    #[serde(rename = "host")]
    pub host: String,
    #[serde(rename = "level")]
    pub level: Level,
    /// the tracing target that emitted the line
    #[serde(rename = "target", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub target: Option<Option<String>>,
    #[serde(rename = "message")]
    pub message: String,
    /// the log file the line came from
    #[serde(rename = "file_path")]
    pub file_path: String,
    /// offset of the line within its file
    #[serde(rename = "line_no")]
    pub line_no: i32,
}

impl LogSearchHit {
    pub fn new(ts: String, host: String, level: Level, message: String, file_path: String, line_no: i32) -> LogSearchHit {
        LogSearchHit {
            ts,
            host,
            level,
            target: None,
            message,
            file_path,
            line_no,
        }
    }
}
/// 
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Level {
    #[serde(rename = "TRACE")]
    Trace,
    #[serde(rename = "DEBUG")]
    Debug,
    #[serde(rename = "INFO")]
    Info,
    #[serde(rename = "WARN")]
    Warn,
    #[serde(rename = "ERROR")]
    Error,
}

impl Default for Level {
    fn default() -> Level {
        Self::Trace
    }
}