misp_client_rs/models/
rest_search_events_request.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 RestSearchEventsRequest {
16    #[serde(rename = "page", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
17    pub page: Option<Option<i32>>,
18    #[serde(rename = "limit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub limit: Option<Option<i32>>,
20    #[serde(rename = "value", skip_serializing_if = "Option::is_none")]
21    pub value: Option<String>,
22    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
23    pub r#type: Option<models::AttributeType>,
24    #[serde(rename = "category", skip_serializing_if = "Option::is_none")]
25    pub category: Option<models::AttributeCategory>,
26    #[serde(rename = "org", skip_serializing_if = "Option::is_none")]
27    pub org: Option<Box<models::RestSearchEventsRequestOrg>>,
28    #[serde(rename = "tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub tags: Option<Option<Vec<String>>>,
30    #[serde(rename = "event_tags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub event_tags: Option<Option<Vec<String>>>,
32    /// Search events by matching any tag names, event descriptions, attribute values or attribute comments
33    #[serde(rename = "searchall", skip_serializing_if = "Option::is_none")]
34    pub searchall: Option<String>,
35    /// You can use any of the valid time related filters (examples: 7d, timestamps, [14d, 7d] for ranges, etc.)
36    #[serde(rename = "from", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub from: Option<Option<String>>,
38    /// You can use any of the valid time related filters (examples: 7d, timestamps, [14d, 7d] for ranges, etc.)
39    #[serde(rename = "to", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub to: Option<Option<String>>,
41    #[serde(rename = "last", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub last: Option<Option<Box<models::LastRestSearchFilter>>>,
43    #[serde(rename = "eventid", skip_serializing_if = "Option::is_none")]
44    pub eventid: Option<String>,
45    /// Extends the response with the base64 representation of the attachment, if there is one
46    #[serde(rename = "withAttachments", skip_serializing_if = "Option::is_none")]
47    pub with_attachments: Option<bool>,
48    /// Sharing group ID(s), either as single string or list of IDs
49    #[serde(rename = "sharinggroup", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub sharinggroup: Option<Option<Vec<String>>>,
51    /// Will only return the metadata of the given query scope, contained data is omitted.
52    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
53    pub metadata: Option<Option<bool>>,
54    #[serde(rename = "uuid", skip_serializing_if = "Option::is_none")]
55    pub uuid: Option<uuid::Uuid>,
56    #[serde(rename = "publish_timestamp", skip_serializing_if = "Option::is_none")]
57    pub publish_timestamp: Option<String>,
58    #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")]
59    pub timestamp: Option<String>,
60    #[serde(rename = "published", skip_serializing_if = "Option::is_none")]
61    pub published: Option<bool>,
62    /// Should the warning list be enforced. Adds blocked field for matching attributes
63    #[serde(rename = "enforceWarninglist", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
64    pub enforce_warninglist: Option<Option<bool>>,
65    /// Will only return the sharing group ID
66    #[serde(rename = "sgReferenceOnly", skip_serializing_if = "Option::is_none")]
67    pub sg_reference_only: Option<bool>,
68    /// List of properties that will be selected in the CSV export
69    #[serde(rename = "requested_attributes", skip_serializing_if = "Option::is_none")]
70    pub requested_attributes: Option<Vec<String>>,
71    /// Adds events context fields in the CSV export
72    #[serde(rename = "includeContext", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
73    pub include_context: Option<Option<bool>>,
74    /// Removes header in the CSV export
75    #[serde(rename = "headerless", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
76    pub headerless: Option<Option<bool>>,
77    #[serde(rename = "includeWarninglistHits", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
78    pub include_warninglist_hits: Option<Option<bool>>,
79    #[serde(rename = "attackGalaxy", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
80    pub attack_galaxy: Option<Option<String>>,
81    #[serde(rename = "to_ids", skip_serializing_if = "Option::is_none")]
82    pub to_ids: Option<bool>,
83    /// Whether to include soft-deleted attributes. Default value 0. If set to 1, only deleted attributes will be returned. If set to [0,1], both deleted and non-deleted attributes wil be returned.
84    #[serde(rename = "deleted", skip_serializing_if = "Option::is_none")]
85    pub deleted: Option<bool>,
86    /// Exclude local tags from the export
87    #[serde(rename = "excludeLocalTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
88    pub exclude_local_tags: Option<Option<bool>>,
89    /// You can use any of the valid time related filters (examples: 7d, timestamps, [14d, 7d] for ranges, etc.)
90    #[serde(rename = "date", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
91    pub date: Option<Option<String>>,
92    /// Extend response with Sightings DB results if the module is enabled
93    #[serde(rename = "includeSightingdb", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
94    pub include_sightingdb: Option<Option<bool>>,
95    #[serde(rename = "tag", skip_serializing_if = "Option::is_none")]
96    pub tag: Option<String>,
97    /// Filter by the attribute object relation value
98    #[serde(rename = "object_relation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
99    pub object_relation: Option<Option<String>>,
100    #[serde(rename = "threat_level_id", skip_serializing_if = "Option::is_none")]
101    pub threat_level_id: Option<models::ThreatLevelId>,
102    #[serde(rename = "returnFormat", skip_serializing_if = "Option::is_none")]
103    pub return_format: Option<models::EventsRestSearchReturnFormat>,
104}
105
106impl RestSearchEventsRequest {
107    pub fn new() -> RestSearchEventsRequest {
108        RestSearchEventsRequest {
109            page: None,
110            limit: None,
111            value: None,
112            r#type: None,
113            category: None,
114            org: None,
115            tags: None,
116            event_tags: None,
117            searchall: None,
118            from: None,
119            to: None,
120            last: None,
121            eventid: None,
122            with_attachments: None,
123            sharinggroup: None,
124            metadata: None,
125            uuid: None,
126            publish_timestamp: None,
127            timestamp: None,
128            published: None,
129            enforce_warninglist: None,
130            sg_reference_only: None,
131            requested_attributes: None,
132            include_context: None,
133            headerless: None,
134            include_warninglist_hits: None,
135            attack_galaxy: None,
136            to_ids: None,
137            deleted: None,
138            exclude_local_tags: None,
139            date: None,
140            include_sightingdb: None,
141            tag: None,
142            object_relation: None,
143            threat_level_id: None,
144            return_format: None,
145        }
146    }
147}
148