//!
//! MISP Automation API
//!
//! ### 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)
//!
//! The version of the OpenAPI document: 2.4
//!
//! Generated by: https://openapi-generator.tech
//!
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Role {
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "perm_add", skip_serializing_if = "Option::is_none")]
pub perm_add: Option<bool>,
#[serde(rename = "perm_modify", skip_serializing_if = "Option::is_none")]
pub perm_modify: Option<bool>,
#[serde(rename = "perm_modify_org", skip_serializing_if = "Option::is_none")]
pub perm_modify_org: Option<bool>,
#[serde(rename = "perm_publish", skip_serializing_if = "Option::is_none")]
pub perm_publish: Option<bool>,
#[serde(rename = "perm_delegate", skip_serializing_if = "Option::is_none")]
pub perm_delegate: Option<bool>,
#[serde(rename = "perm_sync", skip_serializing_if = "Option::is_none")]
pub perm_sync: Option<bool>,
#[serde(rename = "perm_admin", skip_serializing_if = "Option::is_none")]
pub perm_admin: Option<bool>,
#[serde(rename = "perm_audit", skip_serializing_if = "Option::is_none")]
pub perm_audit: Option<bool>,
#[serde(rename = "perm_auth", skip_serializing_if = "Option::is_none")]
pub perm_auth: Option<bool>,
#[serde(rename = "perm_site_admin", skip_serializing_if = "Option::is_none")]
pub perm_site_admin: Option<bool>,
#[serde(rename = "perm_regexp_access", skip_serializing_if = "Option::is_none")]
pub perm_regexp_access: Option<bool>,
#[serde(rename = "perm_tagger", skip_serializing_if = "Option::is_none")]
pub perm_tagger: Option<bool>,
#[serde(rename = "perm_template", skip_serializing_if = "Option::is_none")]
pub perm_template: Option<bool>,
#[serde(rename = "perm_sharing_group", skip_serializing_if = "Option::is_none")]
pub perm_sharing_group: Option<bool>,
#[serde(rename = "perm_tag_editor", skip_serializing_if = "Option::is_none")]
pub perm_tag_editor: Option<bool>,
#[serde(rename = "perm_sighting", skip_serializing_if = "Option::is_none")]
pub perm_sighting: Option<bool>,
#[serde(rename = "perm_object_template", skip_serializing_if = "Option::is_none")]
pub perm_object_template: Option<bool>,
#[serde(rename = "perm_publish_zmq", skip_serializing_if = "Option::is_none")]
pub perm_publish_zmq: Option<bool>,
#[serde(rename = "perm_publish_kafka", skip_serializing_if = "Option::is_none")]
pub perm_publish_kafka: Option<bool>,
#[serde(rename = "perm_decaying", skip_serializing_if = "Option::is_none")]
pub perm_decaying: Option<bool>,
#[serde(rename = "perm_galaxy_editor", skip_serializing_if = "Option::is_none")]
pub perm_galaxy_editor: Option<bool>,
#[serde(rename = "default_role", skip_serializing_if = "Option::is_none")]
pub default_role: Option<bool>,
#[serde(rename = "memory_limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub memory_limit: Option<Option<String>>,
#[serde(rename = "max_execution_time", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub max_execution_time: Option<Option<String>>,
#[serde(rename = "restricted_to_site_admin", skip_serializing_if = "Option::is_none")]
pub restricted_to_site_admin: Option<bool>,
#[serde(rename = "enforce_rate_limit", skip_serializing_if = "Option::is_none")]
pub enforce_rate_limit: Option<bool>,
#[serde(rename = "rate_limit_count", skip_serializing_if = "Option::is_none")]
pub rate_limit_count: Option<String>,
#[serde(rename = "permission", skip_serializing_if = "Option::is_none")]
pub permission: Option<String>,
#[serde(rename = "permission_description", skip_serializing_if = "Option::is_none")]
pub permission_description: Option<String>,
}
impl Role {
pub fn new() -> Role {
Role {
id: None,
name: None,
perm_add: None,
perm_modify: None,
perm_modify_org: None,
perm_publish: None,
perm_delegate: None,
perm_sync: None,
perm_admin: None,
perm_audit: None,
perm_auth: None,
perm_site_admin: None,
perm_regexp_access: None,
perm_tagger: None,
perm_template: None,
perm_sharing_group: None,
perm_tag_editor: None,
perm_sighting: None,
perm_object_template: None,
perm_publish_zmq: None,
perm_publish_kafka: None,
perm_decaying: None,
perm_galaxy_editor: None,
default_role: None,
memory_limit: None,
max_execution_time: None,
restricted_to_site_admin: None,
enforce_rate_limit: None,
rate_limit_count: None,
permission: None,
permission_description: None,
}
}
}