misp_client_rs/models/
role.rs

1//!
2//! MISP Automation API
3//!
4//!  ### Getting Started  MISP API allows you to query, create, modify data models, such as [Events](https://www.circl.lu/doc/misp/GLOSSARY.html#misp-event), [Objects](https://www.circl.lu/doc/misp/misp-objects/), [Attributes](https://www.circl.lu/doc/misp/GLOSSARY.html#misp-attribute). This is extremly useful for interconnecting MISP with external tools and feeding other systems with threat intel data.  It also lets you perform administrative tasks such as creating users, organisations, altering MISP settings, and much more.  To get an API key there are several options: * **[UI]** Go to [My Profile -> Auth Keys](/auth_keys/index) section and click on `+ Add authentication key`  * **[UI]** As an admin go to the the [Administration -> List Users -> View](/admin/users/view/[id]) page of the user you want to create an auth key for and on the `Auth keys` section click on `+ Add authentication key`  * **[CLI]** Use the following command: `./app/Console/cake user change_authkey [e-mail/user_id]`  * **API** Provided you already have an admin level API key, you can create an API key for another user using the `[POST]/auth_keys/add/{{user_id}}` endpoint.  > **NOTE:** The authentication key will only be displayed once, so take note of it or store it properly in your application secrets.  #### Accept and Content-Type headers  When performing your request, depending on the type of request, you might need to explicitly specify in what content  type you want to get your results. This is done by setting one of the below `Accept` headers:      Accept: application/json     Accept: application/xml  When submitting data in a `POST`, `PUT` or `DELETE` operation you also need to specify in what content-type you encoded the payload.  This is done by setting one of the below `Content-Type` headers:      Content-Type: application/json     Content-Type: application/xml  Example: ``` curl  --header \"Authorization: YOUR_API_KEY\" \\       --header \"Accept: application/json\" \\       --header \"Content-Type: application/json\" https://<misp url>/  ```  > **NOTE**: By appending .json or .xml the content type can also be set without the need for a header.  #### Automation using PyMISP  [PyMISP](https://github.com/MISP/PyMISP) is a Python library to access MISP platforms via their REST [API](https://www.circl.lu/doc/misp/GLOSSARY.html#api). It allows you to fetch events, add or update events/attributes, add or update samples or search for attributes.  ### FAQ * [Dev FAQ](https://www.circl.lu/doc/misp/dev-faq/) * [GitHub project FAQ](https://github.com/MISP/MISP/wiki/Frequently-Asked-Questions) 
5//!
6//! The version of the OpenAPI document: 2.4
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 Role {
16    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
17    pub id: Option<String>,
18    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
19    pub name: Option<String>,
20    #[serde(rename = "perm_add", skip_serializing_if = "Option::is_none")]
21    pub perm_add: Option<bool>,
22    #[serde(rename = "perm_modify", skip_serializing_if = "Option::is_none")]
23    pub perm_modify: Option<bool>,
24    #[serde(rename = "perm_modify_org", skip_serializing_if = "Option::is_none")]
25    pub perm_modify_org: Option<bool>,
26    #[serde(rename = "perm_publish", skip_serializing_if = "Option::is_none")]
27    pub perm_publish: Option<bool>,
28    #[serde(rename = "perm_delegate", skip_serializing_if = "Option::is_none")]
29    pub perm_delegate: Option<bool>,
30    #[serde(rename = "perm_sync", skip_serializing_if = "Option::is_none")]
31    pub perm_sync: Option<bool>,
32    #[serde(rename = "perm_admin", skip_serializing_if = "Option::is_none")]
33    pub perm_admin: Option<bool>,
34    #[serde(rename = "perm_audit", skip_serializing_if = "Option::is_none")]
35    pub perm_audit: Option<bool>,
36    #[serde(rename = "perm_auth", skip_serializing_if = "Option::is_none")]
37    pub perm_auth: Option<bool>,
38    #[serde(rename = "perm_site_admin", skip_serializing_if = "Option::is_none")]
39    pub perm_site_admin: Option<bool>,
40    #[serde(rename = "perm_regexp_access", skip_serializing_if = "Option::is_none")]
41    pub perm_regexp_access: Option<bool>,
42    #[serde(rename = "perm_tagger", skip_serializing_if = "Option::is_none")]
43    pub perm_tagger: Option<bool>,
44    #[serde(rename = "perm_template", skip_serializing_if = "Option::is_none")]
45    pub perm_template: Option<bool>,
46    #[serde(rename = "perm_sharing_group", skip_serializing_if = "Option::is_none")]
47    pub perm_sharing_group: Option<bool>,
48    #[serde(rename = "perm_tag_editor", skip_serializing_if = "Option::is_none")]
49    pub perm_tag_editor: Option<bool>,
50    #[serde(rename = "perm_sighting", skip_serializing_if = "Option::is_none")]
51    pub perm_sighting: Option<bool>,
52    #[serde(rename = "perm_object_template", skip_serializing_if = "Option::is_none")]
53    pub perm_object_template: Option<bool>,
54    #[serde(rename = "perm_publish_zmq", skip_serializing_if = "Option::is_none")]
55    pub perm_publish_zmq: Option<bool>,
56    #[serde(rename = "perm_publish_kafka", skip_serializing_if = "Option::is_none")]
57    pub perm_publish_kafka: Option<bool>,
58    #[serde(rename = "perm_decaying", skip_serializing_if = "Option::is_none")]
59    pub perm_decaying: Option<bool>,
60    #[serde(rename = "perm_galaxy_editor", skip_serializing_if = "Option::is_none")]
61    pub perm_galaxy_editor: Option<bool>,
62    #[serde(rename = "default_role", skip_serializing_if = "Option::is_none")]
63    pub default_role: Option<bool>,
64    #[serde(rename = "memory_limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
65    pub memory_limit: Option<Option<String>>,
66    #[serde(rename = "max_execution_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
67    pub max_execution_time: Option<Option<String>>,
68    #[serde(rename = "restricted_to_site_admin", skip_serializing_if = "Option::is_none")]
69    pub restricted_to_site_admin: Option<bool>,
70    #[serde(rename = "enforce_rate_limit", skip_serializing_if = "Option::is_none")]
71    pub enforce_rate_limit: Option<bool>,
72    #[serde(rename = "rate_limit_count", skip_serializing_if = "Option::is_none")]
73    pub rate_limit_count: Option<String>,
74    #[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
75    pub permission: Option<String>,
76    #[serde(rename = "permission_description", skip_serializing_if = "Option::is_none")]
77    pub permission_description: Option<String>,
78}
79
80impl Role {
81    pub fn new() -> Role {
82        Role {
83            id: None,
84            name: None,
85            perm_add: None,
86            perm_modify: None,
87            perm_modify_org: None,
88            perm_publish: None,
89            perm_delegate: None,
90            perm_sync: None,
91            perm_admin: None,
92            perm_audit: None,
93            perm_auth: None,
94            perm_site_admin: None,
95            perm_regexp_access: None,
96            perm_tagger: None,
97            perm_template: None,
98            perm_sharing_group: None,
99            perm_tag_editor: None,
100            perm_sighting: None,
101            perm_object_template: None,
102            perm_publish_zmq: None,
103            perm_publish_kafka: None,
104            perm_decaying: None,
105            perm_galaxy_editor: None,
106            default_role: None,
107            memory_limit: None,
108            max_execution_time: None,
109            restricted_to_site_admin: None,
110            enforce_rate_limit: None,
111            rate_limit_count: None,
112            permission: None,
113            permission_description: None,
114        }
115    }
116}
117