thehive_client/models/
input_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 InputObservable {
16    #[serde(rename = "dataType")]
17    pub data_type: String,
18    #[serde(rename = "data", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub data: Option<Option<String>>,
20    #[serde(rename = "message", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub message: Option<Option<String>>,
22    /// Epoch milliseconds
23    #[serde(rename = "startDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub start_date: Option<Option<i64>>,
25    #[serde(rename = "tlp", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub tlp: Option<Option<Tlp>>,
27    #[serde(rename = "pap", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub pap: Option<Option<Pap>>,
29    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub tags: Option<Option<Vec<String>>>,
31    #[serde(rename = "ioc", skip_serializing_if = "Option::is_none")]
32    pub ioc: Option<bool>,
33    #[serde(rename = "sighted", skip_serializing_if = "Option::is_none")]
34    pub sighted: Option<bool>,
35    /// Epoch milliseconds
36    #[serde(rename = "sightedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub sighted_at: Option<Option<i64>>,
38    #[serde(rename = "ignoreSimilarity", skip_serializing_if = "Option::is_none")]
39    pub ignore_similarity: Option<bool>,
40    #[serde(rename = "isZip", skip_serializing_if = "Option::is_none")]
41    pub is_zip: Option<bool>,
42    #[serde(rename = "zipPassword", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
43    pub zip_password: Option<Option<String>>,
44    #[serde(rename = "attachment", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub attachment: Option<Option<String>>,
46}
47
48impl InputObservable {
49    pub fn new(data_type: String) -> InputObservable {
50        InputObservable {
51            data_type,
52            data: None,
53            message: None,
54            start_date: None,
55            tlp: None,
56            pap: None,
57            tags: None,
58            ioc: None,
59            sighted: None,
60            sighted_at: None,
61            ignore_similarity: None,
62            is_zip: None,
63            zip_password: None,
64            attachment: None,
65        }
66    }
67}
68/// 
69#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
70pub enum Tlp {
71    #[serde(rename = "0")]
72    Variant0,
73    #[serde(rename = "1")]
74    Variant1,
75    #[serde(rename = "2")]
76    Variant2,
77    #[serde(rename = "3")]
78    Variant3,
79    #[serde(rename = "4")]
80    Variant4,
81}
82
83impl Default for Tlp {
84    fn default() -> Tlp {
85        Self::Variant0
86    }
87}
88/// 
89#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
90pub enum Pap {
91    #[serde(rename = "0")]
92    Variant0,
93    #[serde(rename = "1")]
94    Variant1,
95    #[serde(rename = "2")]
96    Variant2,
97    #[serde(rename = "3")]
98    Variant3,
99}
100
101impl Default for Pap {
102    fn default() -> Pap {
103        Self::Variant0
104    }
105}
106