1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
use crate::pagination::default_size;
use chrono::NaiveDate;
use derive_builder::Builder;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Builder)]
#[builder(setter(into), default)]
#[serde(rename_all = "camelCase")]
pub struct TopicsParameters {
/// The UUID of a specific topic to return.
/// Example: c0f010fe-da9c-4aa6-b898-c57d483df51b
pub id: Option<Uuid>,
/// The UUID of a contributor.
/// Example: c28a806c-84c7-44bf-95d3-1241475de5bf
pub editor_id: Option<Uuid>,
/// Text to query the name attribute. A substring match is performed
/// Example: bluekeep
pub name: Option<String>,
/// Return all topics that were created on the given date.
/// Example: 2019-07-04
pub created: Option<NaiveDate>,
/// Return all topics that were created after the given date.
/// Example: 2019-07-04
pub created_after: Option<NaiveDate>,
/// Return all topics that were created before the given date.
/// Example: 2019-07-04
pub created_before: Option<NaiveDate>,
/// Return all topics that were last edited on the given date.
/// Example: 2019-07-04
pub revision_date: Option<NaiveDate>,
/// Return all topics that were last edited after the given date.
/// Example: 2019-07-04
pub revised_after: Option<NaiveDate>,
/// Return all topics that were last edited before the given date.
/// Example: 2019-07-04
pub revised_before: Option<NaiveDate>,
/// Return all topics that were disclosed on the given date.
/// Example: 2019-07-04
pub disclosure_date: Option<NaiveDate>,
/// Text to query the document attribute. A substring match is performed
/// Example : RDP
pub document: Option<String>,
/// Text to query the metadata attribute. A substring match is performed
/// Example : metasploit
pub metadata: Option<String>,
/// Return all topics that are featured.
pub featured: Option<bool>,
/// Return all topics where the rapid7Analysis was created on the given date.
/// Example: 2019-07-04
pub rapid7_analysis_created: Option<NaiveDate>,
/// Return all topics where the rapid7Analysis was created after the given date.
/// Example: 2019-07-04
pub rapid7_analysis_created_after: Option<NaiveDate>,
/// Return all topics where the rapid7Analysis was created before the given date.
/// Example: 2019-07-04
pub rapid7_analysis_created_before: Option<NaiveDate>,
/// Return all topics where the rapid7Analysis was last edited on the given date.
/// Example: 2019-07-04
pub rapid7_analysis_revision_date: Option<NaiveDate>,
/// Return all topics where the rapid7Analysis was last edited after the given date.
/// Example: 2019-07-04
pub rapid7_analysis_revised_after: Option<NaiveDate>,
/// Return all topics where the rapid7Analysis was last edited before the given date.
/// Example: 2019-07-04
pub rapid7_analysis_revised_before: Option<NaiveDate>,
/// Return all topics that have content that matches the query string q.
/// Example : eternal blue
pub q: Option<String>,
/// Pagination page number.
/// Default value : 0
#[serde(default)]
pub page: i32,
/// The number of topics returned per page.
/// Default value : 10
#[serde(default = "default_size")]
pub size: i32,
pub sort: Option<String>,
pub expand: Option<String>,
}
impl Default for TopicsParameters {
fn default() -> Self {
Self {
id: None,
editor_id: None,
name: None,
created: None,
created_after: None,
created_before: None,
revision_date: None,
revised_after: None,
revised_before: None,
disclosure_date: None,
document: None,
metadata: None,
featured: None,
rapid7_analysis_created: None,
rapid7_analysis_created_after: None,
rapid7_analysis_created_before: None,
rapid7_analysis_revision_date: None,
rapid7_analysis_revised_after: None,
rapid7_analysis_revised_before: None,
q: None,
page: 0,
size: 10,
sort: None,
expand: None,
}
}
}
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Builder)]
#[builder(setter(into), default)]
#[serde(rename_all = "camelCase")]
pub struct AssessmentsParameters {
/// The UUID of a specific assessment to return.
/// Example: c0f010fe-da9c-4aa6-b898-c57d483df51b
pub id: Option<Uuid>,
/// The UUID of a contributor.
/// Example: c28a806c-84c7-44bf-95d3-1241475de5bf
pub editor_id: Option<Uuid>,
/// The UUID of the topic this assessment was based on.
/// Example: c28a806c-84c7-44bf-95d3-1241475de5bf
pub topic_id: Option<Uuid>,
/// Return all assessments that were created on the given date.
/// Example: 2019-07-04
pub created: Option<NaiveDate>,
/// Return all assessments that were created after the given date.
/// Example: 2019-07-04
pub created_after: Option<NaiveDate>,
/// Return all assessments that were created before the given date.
/// Example: 2019-07-04
pub created_before: Option<NaiveDate>,
/// Return all assessments that were last edited on the given date.
/// Example: 2019-07-04
pub revision_date: Option<NaiveDate>,
/// Return all assessments that were last edited after the given date.
/// Example: 2019-07-04
pub revised_after: Option<NaiveDate>,
/// Return all assessments that were last edited before the given date.
/// Example: 2019-07-04
pub revised_before: Option<NaiveDate>,
/// Return all topics that were disclosed on the given date.
/// Example: 2019-07-04
pub document: Option<String>,
/// Return all assessments with this score.
pub score: Option<i32>,
/// Text to query the metadata attribute. A substring match is performed
/// Example : metasploit
pub metadata: Option<String>,
/// Return all assessments that have content that matches the query string q.
pub q: Option<String>,
/// Pagination page number.
/// Default value : 0
#[serde(default)]
pub page: i32,
/// The number of topics returned per page.
/// Default value : 10
#[serde(default = "default_size")]
pub size: i32,
/// Sort by assessment attribute. This parameter takes the form attribute:order.
/// attribute: id, editorId, created, revisionDate, document, score, metadata
/// order: asc (ascending), desc (descending)
/// Each attribute is sorted by its respective type.
pub sort: Option<String>,
/// Comma separated list of related objects to fully expand in the returned result. Only the id of related objects will be included if this parameter is not specified.
pub expand: Option<String>,
}
impl Default for AssessmentsParameters {
fn default() -> Self {
Self {
id: None,
editor_id: None,
topic_id: None,
created: None,
created_after: None,
created_before: None,
revision_date: None,
revised_after: None,
revised_before: None,
document: None,
score: None,
metadata: None,
q: None,
page: 0,
size: 10,
sort: None,
expand: None,
}
}
}
#[derive(Debug, Serialize, Deserialize, PartialEq, Clone, Builder)]
#[builder(setter(into), default)]
#[serde(rename_all = "camelCase")]
pub struct ContributorsParameters {
/// The UUID of a specific contributor to return.
/// Example: c0f010fe-da9c-4aa6-b898-c57d483df51b
pub id: Option<Uuid>,
/// Return contributors with the matching username.
/// Example: c28a806c-84c7-44bf-95d3-1241475de5bf
pub username: Option<String>,
/// Return all contributors where avatar matches the given value.
/// Example: c28a806c-84c7-44bf-95d3-1241475de5bf
pub avatar: Option<Uuid>,
/// Return all contributors that were created on the given date.
/// Example: 2019-07-04
pub created: Option<NaiveDate>,
/// Return all contributors that were created after the given date.
/// Example: 2019-07-04
pub created_after: Option<NaiveDate>,
/// Return all contributors that were created before the given date.
/// Example: 2019-07-04
pub created_before: Option<NaiveDate>,
/// Return all contributors with this score.
pub score: Option<i32>,
/// Return all contributors that have usernames that match the query string q.
pub q: Option<String>,
/// Pagination page number.
/// Default value : 0
#[serde(default)]
pub page: i32,
/// The number of topics returned per page.
/// Default value : 10
#[serde(default = "default_size")]
pub size: i32,
/// Sort by contributor attribute. This parameter takes the form attribute:order.
/// attribute: id, username, avatar, created, score.
/// order: asc (ascending), desc (descending)
/// Each attribute is sorted by its respective type.
pub sort: Option<String>,
}
impl Default for ContributorsParameters {
fn default() -> Self {
Self {
id: None,
username: None,
avatar: None,
created: None,
created_after: None,
created_before: None,
score: None,
q: None,
page: 0,
size: 10,
sort: None,
}
}
}