aws-sdk-securityagent 1.1.0

AWS SDK for AWS Security Agent
Documentation
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Represents a security vulnerability or issue discovered during testing
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Finding {
    /// Unique identifier for the finding
    pub finding_id: ::std::string::String,
    /// Identifier of the agent space that created this finding
    pub agent_space_id: ::std::string::String,
    /// Identifier of the parent pentest
    pub pentest_id: ::std::option::Option<::std::string::String>,
    /// Identifier of the pentest job
    pub pentest_job_id: ::std::option::Option<::std::string::String>,
    /// Identifier of the associated task
    pub task_id: ::std::option::Option<::std::string::String>,
    /// Name or title of the finding
    pub name: ::std::option::Option<::std::string::String>,
    /// Detailed description of the security vulnerability
    pub description: ::std::option::Option<::std::string::String>,
    /// Current status of the finding
    pub status: ::std::option::Option<crate::types::FindingStatus>,
    /// Type of security risk identified
    pub risk_type: ::std::option::Option<::std::string::String>,
    /// Severity level of the identified risk
    pub risk_level: ::std::option::Option<crate::types::RiskLevel>,
    /// Risk score associated with the finding
    pub risk_score: ::std::option::Option<::std::string::String>,
    /// Justification for the assigned risk score
    pub reasoning: ::std::option::Option<::std::string::String>,
    /// Confidence level of the finding
    pub confidence: ::std::option::Option<crate::types::ConfidenceLevel>,
    /// Proof-of-concept code demonstrating the vulnerability
    pub attack_script: ::std::option::Option<::std::string::String>,
    /// Code remediation task associated with this finding
    pub code_remediation_task: ::std::option::Option<crate::types::CodeRemediationTask>,
    /// Identifier of the task or agent that last updated this finding
    pub last_updated_by: ::std::option::Option<::std::string::String>,
    /// Timestamp when the finding was created
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Timestamp when the finding was last updated
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl Finding {
    /// Unique identifier for the finding
    pub fn finding_id(&self) -> &str {
        use std::ops::Deref;
        self.finding_id.deref()
    }
    /// Identifier of the agent space that created this finding
    pub fn agent_space_id(&self) -> &str {
        use std::ops::Deref;
        self.agent_space_id.deref()
    }
    /// Identifier of the parent pentest
    pub fn pentest_id(&self) -> ::std::option::Option<&str> {
        self.pentest_id.as_deref()
    }
    /// Identifier of the pentest job
    pub fn pentest_job_id(&self) -> ::std::option::Option<&str> {
        self.pentest_job_id.as_deref()
    }
    /// Identifier of the associated task
    pub fn task_id(&self) -> ::std::option::Option<&str> {
        self.task_id.as_deref()
    }
    /// Name or title of the finding
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// Detailed description of the security vulnerability
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// Current status of the finding
    pub fn status(&self) -> ::std::option::Option<&crate::types::FindingStatus> {
        self.status.as_ref()
    }
    /// Type of security risk identified
    pub fn risk_type(&self) -> ::std::option::Option<&str> {
        self.risk_type.as_deref()
    }
    /// Severity level of the identified risk
    pub fn risk_level(&self) -> ::std::option::Option<&crate::types::RiskLevel> {
        self.risk_level.as_ref()
    }
    /// Risk score associated with the finding
    pub fn risk_score(&self) -> ::std::option::Option<&str> {
        self.risk_score.as_deref()
    }
    /// Justification for the assigned risk score
    pub fn reasoning(&self) -> ::std::option::Option<&str> {
        self.reasoning.as_deref()
    }
    /// Confidence level of the finding
    pub fn confidence(&self) -> ::std::option::Option<&crate::types::ConfidenceLevel> {
        self.confidence.as_ref()
    }
    /// Proof-of-concept code demonstrating the vulnerability
    pub fn attack_script(&self) -> ::std::option::Option<&str> {
        self.attack_script.as_deref()
    }
    /// Code remediation task associated with this finding
    pub fn code_remediation_task(&self) -> ::std::option::Option<&crate::types::CodeRemediationTask> {
        self.code_remediation_task.as_ref()
    }
    /// Identifier of the task or agent that last updated this finding
    pub fn last_updated_by(&self) -> ::std::option::Option<&str> {
        self.last_updated_by.as_deref()
    }
    /// Timestamp when the finding was created
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// Timestamp when the finding was last updated
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
}
impl Finding {
    /// Creates a new builder-style object to manufacture [`Finding`](crate::types::Finding).
    pub fn builder() -> crate::types::builders::FindingBuilder {
        crate::types::builders::FindingBuilder::default()
    }
}

/// A builder for [`Finding`](crate::types::Finding).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct FindingBuilder {
    pub(crate) finding_id: ::std::option::Option<::std::string::String>,
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) pentest_id: ::std::option::Option<::std::string::String>,
    pub(crate) pentest_job_id: ::std::option::Option<::std::string::String>,
    pub(crate) task_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::FindingStatus>,
    pub(crate) risk_type: ::std::option::Option<::std::string::String>,
    pub(crate) risk_level: ::std::option::Option<crate::types::RiskLevel>,
    pub(crate) risk_score: ::std::option::Option<::std::string::String>,
    pub(crate) reasoning: ::std::option::Option<::std::string::String>,
    pub(crate) confidence: ::std::option::Option<crate::types::ConfidenceLevel>,
    pub(crate) attack_script: ::std::option::Option<::std::string::String>,
    pub(crate) code_remediation_task: ::std::option::Option<crate::types::CodeRemediationTask>,
    pub(crate) last_updated_by: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl FindingBuilder {
    /// Unique identifier for the finding
    /// This field is required.
    pub fn finding_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.finding_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Unique identifier for the finding
    pub fn set_finding_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.finding_id = input;
        self
    }
    /// Unique identifier for the finding
    pub fn get_finding_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.finding_id
    }
    /// Identifier of the agent space that created this finding
    /// This field is required.
    pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_space_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the agent space that created this finding
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// Identifier of the agent space that created this finding
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// Identifier of the parent pentest
    pub fn pentest_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pentest_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the parent pentest
    pub fn set_pentest_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pentest_id = input;
        self
    }
    /// Identifier of the parent pentest
    pub fn get_pentest_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pentest_id
    }
    /// Identifier of the pentest job
    pub fn pentest_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pentest_job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the pentest job
    pub fn set_pentest_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pentest_job_id = input;
        self
    }
    /// Identifier of the pentest job
    pub fn get_pentest_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pentest_job_id
    }
    /// Identifier of the associated task
    pub fn task_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.task_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the associated task
    pub fn set_task_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.task_id = input;
        self
    }
    /// Identifier of the associated task
    pub fn get_task_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.task_id
    }
    /// Name or title of the finding
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// Name or title of the finding
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// Name or title of the finding
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// Detailed description of the security vulnerability
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// Detailed description of the security vulnerability
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// Detailed description of the security vulnerability
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Current status of the finding
    pub fn status(mut self, input: crate::types::FindingStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// Current status of the finding
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FindingStatus>) -> Self {
        self.status = input;
        self
    }
    /// Current status of the finding
    pub fn get_status(&self) -> &::std::option::Option<crate::types::FindingStatus> {
        &self.status
    }
    /// Type of security risk identified
    pub fn risk_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.risk_type = ::std::option::Option::Some(input.into());
        self
    }
    /// Type of security risk identified
    pub fn set_risk_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.risk_type = input;
        self
    }
    /// Type of security risk identified
    pub fn get_risk_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.risk_type
    }
    /// Severity level of the identified risk
    pub fn risk_level(mut self, input: crate::types::RiskLevel) -> Self {
        self.risk_level = ::std::option::Option::Some(input);
        self
    }
    /// Severity level of the identified risk
    pub fn set_risk_level(mut self, input: ::std::option::Option<crate::types::RiskLevel>) -> Self {
        self.risk_level = input;
        self
    }
    /// Severity level of the identified risk
    pub fn get_risk_level(&self) -> &::std::option::Option<crate::types::RiskLevel> {
        &self.risk_level
    }
    /// Risk score associated with the finding
    pub fn risk_score(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.risk_score = ::std::option::Option::Some(input.into());
        self
    }
    /// Risk score associated with the finding
    pub fn set_risk_score(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.risk_score = input;
        self
    }
    /// Risk score associated with the finding
    pub fn get_risk_score(&self) -> &::std::option::Option<::std::string::String> {
        &self.risk_score
    }
    /// Justification for the assigned risk score
    pub fn reasoning(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reasoning = ::std::option::Option::Some(input.into());
        self
    }
    /// Justification for the assigned risk score
    pub fn set_reasoning(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reasoning = input;
        self
    }
    /// Justification for the assigned risk score
    pub fn get_reasoning(&self) -> &::std::option::Option<::std::string::String> {
        &self.reasoning
    }
    /// Confidence level of the finding
    pub fn confidence(mut self, input: crate::types::ConfidenceLevel) -> Self {
        self.confidence = ::std::option::Option::Some(input);
        self
    }
    /// Confidence level of the finding
    pub fn set_confidence(mut self, input: ::std::option::Option<crate::types::ConfidenceLevel>) -> Self {
        self.confidence = input;
        self
    }
    /// Confidence level of the finding
    pub fn get_confidence(&self) -> &::std::option::Option<crate::types::ConfidenceLevel> {
        &self.confidence
    }
    /// Proof-of-concept code demonstrating the vulnerability
    pub fn attack_script(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.attack_script = ::std::option::Option::Some(input.into());
        self
    }
    /// Proof-of-concept code demonstrating the vulnerability
    pub fn set_attack_script(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.attack_script = input;
        self
    }
    /// Proof-of-concept code demonstrating the vulnerability
    pub fn get_attack_script(&self) -> &::std::option::Option<::std::string::String> {
        &self.attack_script
    }
    /// Code remediation task associated with this finding
    pub fn code_remediation_task(mut self, input: crate::types::CodeRemediationTask) -> Self {
        self.code_remediation_task = ::std::option::Option::Some(input);
        self
    }
    /// Code remediation task associated with this finding
    pub fn set_code_remediation_task(mut self, input: ::std::option::Option<crate::types::CodeRemediationTask>) -> Self {
        self.code_remediation_task = input;
        self
    }
    /// Code remediation task associated with this finding
    pub fn get_code_remediation_task(&self) -> &::std::option::Option<crate::types::CodeRemediationTask> {
        &self.code_remediation_task
    }
    /// Identifier of the task or agent that last updated this finding
    pub fn last_updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.last_updated_by = ::std::option::Option::Some(input.into());
        self
    }
    /// Identifier of the task or agent that last updated this finding
    pub fn set_last_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.last_updated_by = input;
        self
    }
    /// Identifier of the task or agent that last updated this finding
    pub fn get_last_updated_by(&self) -> &::std::option::Option<::std::string::String> {
        &self.last_updated_by
    }
    /// Timestamp when the finding was created
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when the finding was created
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// Timestamp when the finding was created
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// Timestamp when the finding was last updated
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// Timestamp when the finding was last updated
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// Timestamp when the finding was last updated
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Consumes the builder and constructs a [`Finding`](crate::types::Finding).
    /// This method will fail if any of the following fields are not set:
    /// - [`finding_id`](crate::types::builders::FindingBuilder::finding_id)
    /// - [`agent_space_id`](crate::types::builders::FindingBuilder::agent_space_id)
    pub fn build(self) -> ::std::result::Result<crate::types::Finding, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Finding {
            finding_id: self.finding_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "finding_id",
                    "finding_id was not specified but it is required when building Finding",
                )
            })?,
            agent_space_id: self.agent_space_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_space_id",
                    "agent_space_id was not specified but it is required when building Finding",
                )
            })?,
            pentest_id: self.pentest_id,
            pentest_job_id: self.pentest_job_id,
            task_id: self.task_id,
            name: self.name,
            description: self.description,
            status: self.status,
            risk_type: self.risk_type,
            risk_level: self.risk_level,
            risk_score: self.risk_score,
            reasoning: self.reasoning,
            confidence: self.confidence,
            attack_script: self.attack_script,
            code_remediation_task: self.code_remediation_task,
            last_updated_by: self.last_updated_by,
            created_at: self.created_at,
            updated_at: self.updated_at,
        })
    }
}