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 OutputUser {
    #[serde(rename = "_id")]
    pub _id: 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 = "login")]
    pub login: String,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub email: Option<Option<String>>,
    #[serde(rename = "hasKey")]
    pub has_key: bool,
    #[serde(rename = "hasPassword")]
    pub has_password: bool,
    #[serde(rename = "hasMFA")]
    pub has_mfa: bool,
    #[serde(rename = "locked")]
    pub locked: bool,
    #[serde(rename = "profile")]
    pub profile: String,
    #[serde(rename = "organisation")]
    pub organisation: String,
    #[serde(rename = "type")]
    pub r#type: String,
    #[serde(rename = "permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub permissions: Option<Option<Vec<String>>>,
    #[serde(rename = "avatar", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub avatar: Option<Option<String>>,
    #[serde(rename = "organisations", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub organisations: Option<Option<Vec<models::OutputOrganisationProfile>>>,
    #[serde(rename = "defaultOrganisation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub default_organisation: Option<Option<String>>,
    #[serde(rename = "extraData")]
    pub extra_data: std::collections::HashMap<String, serde_json::Value>,
}

impl OutputUser {
    pub fn new(_id: String, _created_by: String, _created_at: i64, login: String, name: String, has_key: bool, has_password: bool, has_mfa: bool, locked: bool, profile: String, organisation: String, r#type: String, extra_data: std::collections::HashMap<String, serde_json::Value>) -> OutputUser {
        OutputUser {
            _id,
            _created_by,
            _created_at,
            _updated_by: None,
            _updated_at: None,
            login,
            name,
            email: None,
            has_key,
            has_password,
            has_mfa,
            locked,
            profile,
            organisation,
            r#type,
            permissions: None,
            avatar: None,
            organisations: None,
            default_organisation: None,
            extra_data,
        }
    }
}