thehive_client/models/
query_operation.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
14use std::collections::HashMap;
15use serde_json::Value;
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct QueryOperation {
19    #[serde(rename = "_name", skip_serializing_if = "Option::is_none")]
20    pub _name: Option<String>,
21
22    #[serde(flatten)]
23    pub additional_fields: HashMap<String, Value>,
24}
25
26impl QueryOperation {
27    pub fn new() -> QueryOperation {
28        QueryOperation {
29            _name: None,
30            additional_fields: HashMap::new(),
31        }
32    }
33
34    pub fn with_name(name: String) -> QueryOperation {
35        QueryOperation {
36            _name: Some(name),
37            additional_fields: HashMap::new(),
38        }
39    }
40
41    pub fn add_field(mut self, key: String, value: Value) -> Self {
42        self.additional_fields.insert(key, value);
43        self
44    }
45}
46