thehive-client 0.1.0

Rust client for TheHive API, enabling programmatic management of alerts, cases, observables, tasks, and other security incident response entities.
Documentation
/*
 * TheHive API
 *
 * Comprehensive OpenAPI specification inferred from the TheHive4py client library. This API allows interaction with TheHive platform for managing alerts, cases, observables, tasks, users, and other entities. 
 *
 * The version of the OpenAPI document: 2.1.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OutputAlert {
    #[serde(rename = "_id")]
    pub _id: String,
    #[serde(rename = "_type")]
    pub _type: String,
    #[serde(rename = "_createdBy")]
    pub _created_by: String,
    #[serde(rename = "_createdAt")]
    pub _created_at: i64,
    #[serde(rename = "_updatedBy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub _updated_by: Option<Option<String>>,
    #[serde(rename = "_updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub _updated_at: Option<Option<i64>>,
    #[serde(rename = "type")]
    pub r#type: String,
    #[serde(rename = "source")]
    pub source: String,
    #[serde(rename = "sourceRef")]
    pub source_ref: String,
    #[serde(rename = "externalLink", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub external_link: Option<Option<String>>,
    #[serde(rename = "title")]
    pub title: String,
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "severity")]
    pub severity: i32,
    #[serde(rename = "severityLabel")]
    pub severity_label: String,
    #[serde(rename = "date")]
    pub date: i64,
    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub tags: Option<Option<Vec<String>>>,
    #[serde(rename = "tlp")]
    pub tlp: i32,
    #[serde(rename = "tlpLabel")]
    pub tlp_label: String,
    #[serde(rename = "pap")]
    pub pap: i32,
    #[serde(rename = "papLabel")]
    pub pap_label: String,
    #[serde(rename = "follow")]
    pub follow: bool,
    #[serde(rename = "customFields", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub custom_fields: Option<Option<Vec<models::OutputCustomFieldValue>>>,
    #[serde(rename = "status")]
    pub status: String,
    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub summary: Option<Option<String>>,
    #[serde(rename = "assignee", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub assignee: Option<Option<String>>,
    #[serde(rename = "caseTemplate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub case_template: Option<Option<String>>,
    #[serde(rename = "caseId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub case_id: Option<Option<String>>,
    #[serde(rename = "observableCount")]
    pub observable_count: i32,
    #[serde(rename = "stage")]
    pub stage: String,
    #[serde(rename = "extraData")]
    pub extra_data: std::collections::HashMap<String, serde_json::Value>,
    #[serde(rename = "newDate")]
    pub new_date: i64,
    #[serde(rename = "inProgressDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub in_progress_date: Option<Option<i64>>,
    #[serde(rename = "closedDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub closed_date: Option<Option<i64>>,
    #[serde(rename = "importedDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub imported_date: Option<Option<i64>>,
    #[serde(rename = "timeToDetect")]
    pub time_to_detect: i64,
    #[serde(rename = "timeToTriage", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub time_to_triage: Option<Option<i64>>,
    #[serde(rename = "timeToQualify", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub time_to_qualify: Option<Option<i64>>,
    #[serde(rename = "timeToAcknowledge", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub time_to_acknowledge: Option<Option<i64>>,
}

impl OutputAlert {
    pub fn new(_id: String, _type: String, _created_by: String, _created_at: i64, r#type: String, source: String, source_ref: String, title: String, description: String, severity: i32, severity_label: String, date: i64, tlp: i32, tlp_label: String, pap: i32, pap_label: String, follow: bool, status: String, observable_count: i32, stage: String, extra_data: std::collections::HashMap<String, serde_json::Value>, new_date: i64, time_to_detect: i64) -> OutputAlert {
        OutputAlert {
            _id,
            _type,
            _created_by,
            _created_at,
            _updated_by: None,
            _updated_at: None,
            r#type,
            source,
            source_ref,
            external_link: None,
            title,
            description,
            severity,
            severity_label,
            date,
            tags: None,
            tlp,
            tlp_label,
            pap,
            pap_label,
            follow,
            custom_fields: None,
            status,
            summary: None,
            assignee: None,
            case_template: None,
            case_id: None,
            observable_count,
            stage,
            extra_data,
            new_date,
            in_progress_date: None,
            closed_date: None,
            imported_date: None,
            time_to_detect,
            time_to_triage: None,
            time_to_qualify: None,
            time_to_acknowledge: None,
        }
    }
}