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};

use std::collections::HashMap;
use serde_json::Value;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct QueryOperation {
    #[serde(rename = "_name", skip_serializing_if = "Option::is_none")]
    pub _name: Option<String>,

    #[serde(flatten)]
    pub additional_fields: HashMap<String, Value>,
}

impl QueryOperation {
    pub fn new() -> QueryOperation {
        QueryOperation {
            _name: None,
            additional_fields: HashMap::new(),
        }
    }

    pub fn with_name(name: String) -> QueryOperation {
        QueryOperation {
            _name: Some(name),
            additional_fields: HashMap::new(),
        }
    }

    pub fn add_field(mut self, key: String, value: Value) -> Self {
        self.additional_fields.insert(key, value);
        self
    }
}