thehive_client/models/
output_user.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 OutputUser {
16    #[serde(rename = "_id")]
17    pub _id: String,
18    #[serde(rename = "_createdBy")]
19    pub _created_by: String,
20    #[serde(rename = "_createdAt")]
21    pub _created_at: i64,
22    #[serde(rename = "_updatedBy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub _updated_by: Option<Option<String>>,
24    #[serde(rename = "_updatedAt", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub _updated_at: Option<Option<i64>>,
26    #[serde(rename = "login")]
27    pub login: String,
28    #[serde(rename = "name")]
29    pub name: String,
30    #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub email: Option<Option<String>>,
32    #[serde(rename = "hasKey")]
33    pub has_key: bool,
34    #[serde(rename = "hasPassword")]
35    pub has_password: bool,
36    #[serde(rename = "hasMFA")]
37    pub has_mfa: bool,
38    #[serde(rename = "locked")]
39    pub locked: bool,
40    #[serde(rename = "profile")]
41    pub profile: String,
42    #[serde(rename = "organisation")]
43    pub organisation: String,
44    #[serde(rename = "type")]
45    pub r#type: String,
46    #[serde(rename = "permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
47    pub permissions: Option<Option<Vec<String>>>,
48    #[serde(rename = "avatar", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
49    pub avatar: Option<Option<String>>,
50    #[serde(rename = "organisations", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub organisations: Option<Option<Vec<models::OutputOrganisationProfile>>>,
52    #[serde(rename = "defaultOrganisation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub default_organisation: Option<Option<String>>,
54    #[serde(rename = "extraData")]
55    pub extra_data: std::collections::HashMap<String, serde_json::Value>,
56}
57
58impl OutputUser {
59    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 {
60        OutputUser {
61            _id,
62            _created_by,
63            _created_at,
64            _updated_by: None,
65            _updated_at: None,
66            login,
67            name,
68            email: None,
69            has_key,
70            has_password,
71            has_mfa,
72            locked,
73            profile,
74            organisation,
75            r#type,
76            permissions: None,
77            avatar: None,
78            organisations: None,
79            default_organisation: None,
80            extra_data,
81        }
82    }
83}
84