thehive_client/models/
output_observable.rs

1/*
2 * TheHive API
3 *
4 * 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. 
5 *
6 * The version of the OpenAPI document: 2.1.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct OutputObservable {
16    #[serde(rename = "_id")]
17    pub _id: String,
18    #[serde(rename = "_type")]
19    pub _type: String,
20    #[serde(rename = "_createdBy")]
21    pub _created_by: String,
22    #[serde(rename = "_createdAt")]
23    pub _created_at: i64,
24    #[serde(rename = "_updatedBy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub _updated_by: Option<Option<String>>,
26    #[serde(rename = "_updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub _updated_at: Option<Option<i64>>,
28    #[serde(rename = "dataType")]
29    pub data_type: String,
30    #[serde(rename = "data", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub data: Option<Option<String>>,
32    #[serde(rename = "attachment", skip_serializing_if = "Option::is_none")]
33    pub attachment: Option<Box<models::OutputAttachment>>,
34    #[serde(rename = "message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub message: Option<Option<String>>,
36    #[serde(rename = "startDate")]
37    pub start_date: i64,
38    #[serde(rename = "tlp")]
39    pub tlp: i32,
40    #[serde(rename = "tlpLabel")]
41    pub tlp_label: String,
42    #[serde(rename = "pap")]
43    pub pap: i32,
44    #[serde(rename = "papLabel")]
45    pub pap_label: String,
46    #[serde(rename = "ioc")]
47    pub ioc: bool,
48    #[serde(rename = "sighted")]
49    pub sighted: bool,
50    #[serde(rename = "sightedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub sighted_at: Option<Option<i64>>,
52    #[serde(rename = "reports")]
53    pub reports: std::collections::HashMap<String, serde_json::Value>,
54    #[serde(rename = "extraData")]
55    pub extra_data: std::collections::HashMap<String, serde_json::Value>,
56    #[serde(rename = "ignoreSimilarity")]
57    pub ignore_similarity: bool,
58    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
59    pub tags: Option<Option<Vec<String>>>,
60}
61
62impl OutputObservable {
63    pub fn new(_id: String, _type: String, _created_by: String, _created_at: i64, data_type: String, start_date: i64, tlp: i32, tlp_label: String, pap: i32, pap_label: String, ioc: bool, sighted: bool, reports: std::collections::HashMap<String, serde_json::Value>, extra_data: std::collections::HashMap<String, serde_json::Value>, ignore_similarity: bool) -> OutputObservable {
64        OutputObservable {
65            _id,
66            _type,
67            _created_by,
68            _created_at,
69            _updated_by: None,
70            _updated_at: None,
71            data_type,
72            data: None,
73            attachment: None,
74            message: None,
75            start_date,
76            tlp,
77            tlp_label,
78            pap,
79            pap_label,
80            ioc,
81            sighted,
82            sighted_at: None,
83            reports,
84            extra_data,
85            ignore_similarity,
86            tags: None,
87        }
88    }
89}
90