misp_client_rs/models/
server.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
14use serde_with::serde_as;
15
16#[serde_as]
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct Server {
19    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
20    pub name: Option<String>,
21    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
22    pub url: Option<String>,
23    #[serde(rename = "authkey", skip_serializing_if = "Option::is_none")]
24    pub authkey: Option<String>,
25    #[serde(rename = "org_id", skip_serializing_if = "Option::is_none")]
26    pub org_id: Option<String>,
27    #[serde(rename = "push", skip_serializing_if = "Option::is_none")]
28    pub push: Option<bool>,
29    #[serde(rename = "pull", skip_serializing_if = "Option::is_none")]
30    pub pull: Option<bool>,
31    #[serde(rename = "push_sightings", skip_serializing_if = "Option::is_none")]
32    pub push_sightings: Option<bool>,
33    #[serde(rename = "push_galaxy_clusters", skip_serializing_if = "Option::is_none")]
34    pub push_galaxy_clusters: Option<bool>,
35    #[serde(rename = "pull_galaxy_clusters", skip_serializing_if = "Option::is_none")]
36    pub pull_galaxy_clusters: Option<bool>,
37    #[serde(rename = "lastpulledid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub lastpulledid: Option<Option<String>>,
39    #[serde(rename = "lastpushedid", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub lastpushedid: Option<Option<String>>,
41    #[serde(rename = "organization", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub organization: Option<Option<String>>,
43    #[serde(rename = "remote_org_id", skip_serializing_if = "Option::is_none")]
44    pub remote_org_id: Option<String>,
45    #[serde(rename = "publish_without_email", skip_serializing_if = "Option::is_none")]
46    pub publish_without_email: Option<bool>,
47    #[serde(rename = "unpublish_event", skip_serializing_if = "Option::is_none")]
48    pub unpublish_event: Option<bool>,
49    #[serde(rename = "self_signed", skip_serializing_if = "Option::is_none")]
50    pub self_signed: Option<bool>,
51    /// Stringified JSON rules for pulling events from this server.
52    #[serde(rename = "pull_rules", skip_serializing_if = "Option::is_none")]
53    pub pull_rules: Option<String>,
54    /// Stringified JSON rules for pushing events from this server.
55    #[serde(rename = "push_rules", skip_serializing_if = "Option::is_none")]
56    pub push_rules: Option<String>,
57    /// Base64 encoded certificate
58    #[serde_as(as = "super::DoubleOption<serde_with::base64::Base64>")]
59    #[serde(rename = "cert_file", default, skip_serializing_if = "Option::is_none")]
60    pub cert_file: Option<Option<Vec<u8>>>,
61    /// Base64 encoded client certificate
62    #[serde_as(as = "super::DoubleOption<serde_with::base64::Base64>")]
63    #[serde(rename = "client_cert_file", default, skip_serializing_if = "Option::is_none")]
64    pub client_cert_file: Option<Option<Vec<u8>>>,
65    #[serde(rename = "internal", skip_serializing_if = "Option::is_none")]
66    pub internal: Option<bool>,
67    #[serde(rename = "skip_proxy", skip_serializing_if = "Option::is_none")]
68    pub skip_proxy: Option<bool>,
69    #[serde(rename = "caching_enabled", skip_serializing_if = "Option::is_none")]
70    pub caching_enabled: Option<bool>,
71    #[serde(rename = "priority", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
72    pub priority: Option<Option<String>>,
73    #[serde(rename = "cache_timestamp", skip_serializing_if = "Option::is_none")]
74    pub cache_timestamp: Option<bool>,
75    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
76    pub id: Option<String>,
77}
78
79impl Server {
80    pub fn new() -> Server {
81        Server {
82            name: None,
83            url: None,
84            authkey: None,
85            org_id: None,
86            push: None,
87            pull: None,
88            push_sightings: None,
89            push_galaxy_clusters: None,
90            pull_galaxy_clusters: None,
91            lastpulledid: None,
92            lastpushedid: None,
93            organization: None,
94            remote_org_id: None,
95            publish_without_email: None,
96            unpublish_event: None,
97            self_signed: None,
98            pull_rules: None,
99            push_rules: None,
100            cert_file: None,
101            client_cert_file: None,
102            internal: None,
103            skip_proxy: None,
104            caching_enabled: None,
105            priority: None,
106            cache_timestamp: None,
107            id: None,
108        }
109    }
110}
111