aws-sdk-securityagent 1.8.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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Input for updating an existing threat.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateThreatInput {
    /// <p>The unique identifier of the threat to update.</p>
    pub threat_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the agent space.</p>
    pub agent_space_id: ::std::option::Option<::std::string::String>,
    /// <p>A short title summarizing the threat.</p>
    pub title: ::std::option::Option<::std::string::String>,
    /// <p>The updated status of the threat.</p>
    pub status: ::std::option::Option<crate::types::ThreatStatus>,
    /// <p>Optional customer comment.</p>
    pub comments: ::std::option::Option<::std::string::String>,
    /// <p>The updated natural-language threat statement.</p>
    pub statement: ::std::option::Option<::std::string::String>,
    /// <p>The updated severity level of the threat.</p>
    pub severity: ::std::option::Option<crate::types::ThreatSeverity>,
    /// <p>The updated actor or origin of the threat.</p>
    pub threat_source: ::std::option::Option<::std::string::String>,
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub prerequisites: ::std::option::Option<::std::string::String>,
    /// <p>The updated description of what the threat source can do.</p>
    pub threat_action: ::std::option::Option<::std::string::String>,
    /// <p>The updated direct consequence of the threat action.</p>
    pub threat_impact: ::std::option::Option<::std::string::String>,
    /// <p>The updated security goals affected by the threat.</p>
    pub impacted_goal: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub impacted_assets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub anchor: ::std::option::Option<crate::types::ThreatAnchorShape>,
    /// <p>The updated source code files supporting the threat.</p>
    pub evidence: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>,
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub recommendation: ::std::option::Option<::std::string::String>,
}
impl UpdateThreatInput {
    /// <p>The unique identifier of the threat to update.</p>
    pub fn threat_id(&self) -> ::std::option::Option<&str> {
        self.threat_id.as_deref()
    }
    /// <p>The unique identifier of the agent space.</p>
    pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
        self.agent_space_id.as_deref()
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn title(&self) -> ::std::option::Option<&str> {
        self.title.as_deref()
    }
    /// <p>The updated status of the threat.</p>
    pub fn status(&self) -> ::std::option::Option<&crate::types::ThreatStatus> {
        self.status.as_ref()
    }
    /// <p>Optional customer comment.</p>
    pub fn comments(&self) -> ::std::option::Option<&str> {
        self.comments.as_deref()
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn statement(&self) -> ::std::option::Option<&str> {
        self.statement.as_deref()
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn severity(&self) -> ::std::option::Option<&crate::types::ThreatSeverity> {
        self.severity.as_ref()
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn threat_source(&self) -> ::std::option::Option<&str> {
        self.threat_source.as_deref()
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn prerequisites(&self) -> ::std::option::Option<&str> {
        self.prerequisites.as_deref()
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn threat_action(&self) -> ::std::option::Option<&str> {
        self.threat_action.as_deref()
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn threat_impact(&self) -> ::std::option::Option<&str> {
        self.threat_impact.as_deref()
    }
    /// <p>The updated security goals affected by the threat.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.impacted_goal.is_none()`.
    pub fn impacted_goal(&self) -> &[::std::string::String] {
        self.impacted_goal.as_deref().unwrap_or_default()
    }
    /// <p>The updated list of specific assets affected by the threat.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.impacted_assets.is_none()`.
    pub fn impacted_assets(&self) -> &[::std::string::String] {
        self.impacted_assets.as_deref().unwrap_or_default()
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn anchor(&self) -> ::std::option::Option<&crate::types::ThreatAnchorShape> {
        self.anchor.as_ref()
    }
    /// <p>The updated source code files supporting the threat.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.evidence.is_none()`.
    pub fn evidence(&self) -> &[crate::types::ThreatEvidenceShape] {
        self.evidence.as_deref().unwrap_or_default()
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn recommendation(&self) -> ::std::option::Option<&str> {
        self.recommendation.as_deref()
    }
}
impl UpdateThreatInput {
    /// Creates a new builder-style object to manufacture [`UpdateThreatInput`](crate::operation::update_threat::UpdateThreatInput).
    pub fn builder() -> crate::operation::update_threat::builders::UpdateThreatInputBuilder {
        crate::operation::update_threat::builders::UpdateThreatInputBuilder::default()
    }
}

/// A builder for [`UpdateThreatInput`](crate::operation::update_threat::UpdateThreatInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateThreatInputBuilder {
    pub(crate) threat_id: ::std::option::Option<::std::string::String>,
    pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
    pub(crate) title: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::ThreatStatus>,
    pub(crate) comments: ::std::option::Option<::std::string::String>,
    pub(crate) statement: ::std::option::Option<::std::string::String>,
    pub(crate) severity: ::std::option::Option<crate::types::ThreatSeverity>,
    pub(crate) threat_source: ::std::option::Option<::std::string::String>,
    pub(crate) prerequisites: ::std::option::Option<::std::string::String>,
    pub(crate) threat_action: ::std::option::Option<::std::string::String>,
    pub(crate) threat_impact: ::std::option::Option<::std::string::String>,
    pub(crate) impacted_goal: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) impacted_assets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) anchor: ::std::option::Option<crate::types::ThreatAnchorShape>,
    pub(crate) evidence: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>,
    pub(crate) recommendation: ::std::option::Option<::std::string::String>,
}
impl UpdateThreatInputBuilder {
    /// <p>The unique identifier of the threat to update.</p>
    /// This field is required.
    pub fn threat_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.threat_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the threat to update.</p>
    pub fn set_threat_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.threat_id = input;
        self
    }
    /// <p>The unique identifier of the threat to update.</p>
    pub fn get_threat_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.threat_id
    }
    /// <p>The unique identifier of the agent space.</p>
    /// 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
    }
    /// <p>The unique identifier of the agent space.</p>
    pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_space_id = input;
        self
    }
    /// <p>The unique identifier of the agent space.</p>
    pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_space_id
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.title = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.title = input;
        self
    }
    /// <p>A short title summarizing the threat.</p>
    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
        &self.title
    }
    /// <p>The updated status of the threat.</p>
    pub fn status(mut self, input: crate::types::ThreatStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated status of the threat.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ThreatStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The updated status of the threat.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ThreatStatus> {
        &self.status
    }
    /// <p>Optional customer comment.</p>
    pub fn comments(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.comments = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Optional customer comment.</p>
    pub fn set_comments(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.comments = input;
        self
    }
    /// <p>Optional customer comment.</p>
    pub fn get_comments(&self) -> &::std::option::Option<::std::string::String> {
        &self.comments
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.statement = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.statement = input;
        self
    }
    /// <p>The updated natural-language threat statement.</p>
    pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
        &self.statement
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn severity(mut self, input: crate::types::ThreatSeverity) -> Self {
        self.severity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn set_severity(mut self, input: ::std::option::Option<crate::types::ThreatSeverity>) -> Self {
        self.severity = input;
        self
    }
    /// <p>The updated severity level of the threat.</p>
    pub fn get_severity(&self) -> &::std::option::Option<crate::types::ThreatSeverity> {
        &self.severity
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn threat_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.threat_source = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn set_threat_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.threat_source = input;
        self
    }
    /// <p>The updated actor or origin of the threat.</p>
    pub fn get_threat_source(&self) -> &::std::option::Option<::std::string::String> {
        &self.threat_source
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn prerequisites(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.prerequisites = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn set_prerequisites(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.prerequisites = input;
        self
    }
    /// <p>The updated conditions required for the threat to be exploitable.</p>
    pub fn get_prerequisites(&self) -> &::std::option::Option<::std::string::String> {
        &self.prerequisites
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn threat_action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.threat_action = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn set_threat_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.threat_action = input;
        self
    }
    /// <p>The updated description of what the threat source can do.</p>
    pub fn get_threat_action(&self) -> &::std::option::Option<::std::string::String> {
        &self.threat_action
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn threat_impact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.threat_impact = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn set_threat_impact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.threat_impact = input;
        self
    }
    /// <p>The updated direct consequence of the threat action.</p>
    pub fn get_threat_impact(&self) -> &::std::option::Option<::std::string::String> {
        &self.threat_impact
    }
    /// Appends an item to `impacted_goal`.
    ///
    /// To override the contents of this collection use [`set_impacted_goal`](Self::set_impacted_goal).
    ///
    /// <p>The updated security goals affected by the threat.</p>
    pub fn impacted_goal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.impacted_goal.unwrap_or_default();
        v.push(input.into());
        self.impacted_goal = ::std::option::Option::Some(v);
        self
    }
    /// <p>The updated security goals affected by the threat.</p>
    pub fn set_impacted_goal(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.impacted_goal = input;
        self
    }
    /// <p>The updated security goals affected by the threat.</p>
    pub fn get_impacted_goal(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.impacted_goal
    }
    /// Appends an item to `impacted_assets`.
    ///
    /// To override the contents of this collection use [`set_impacted_assets`](Self::set_impacted_assets).
    ///
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub fn impacted_assets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.impacted_assets.unwrap_or_default();
        v.push(input.into());
        self.impacted_assets = ::std::option::Option::Some(v);
        self
    }
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub fn set_impacted_assets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.impacted_assets = input;
        self
    }
    /// <p>The updated list of specific assets affected by the threat.</p>
    pub fn get_impacted_assets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.impacted_assets
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn anchor(mut self, input: crate::types::ThreatAnchorShape) -> Self {
        self.anchor = ::std::option::Option::Some(input);
        self
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn set_anchor(mut self, input: ::std::option::Option<crate::types::ThreatAnchorShape>) -> Self {
        self.anchor = input;
        self
    }
    /// <p>The updated DFD element this threat is anchored to.</p>
    pub fn get_anchor(&self) -> &::std::option::Option<crate::types::ThreatAnchorShape> {
        &self.anchor
    }
    /// Appends an item to `evidence`.
    ///
    /// To override the contents of this collection use [`set_evidence`](Self::set_evidence).
    ///
    /// <p>The updated source code files supporting the threat.</p>
    pub fn evidence(mut self, input: crate::types::ThreatEvidenceShape) -> Self {
        let mut v = self.evidence.unwrap_or_default();
        v.push(input);
        self.evidence = ::std::option::Option::Some(v);
        self
    }
    /// <p>The updated source code files supporting the threat.</p>
    pub fn set_evidence(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>) -> Self {
        self.evidence = input;
        self
    }
    /// <p>The updated source code files supporting the threat.</p>
    pub fn get_evidence(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>> {
        &self.evidence
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn recommendation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.recommendation = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn set_recommendation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.recommendation = input;
        self
    }
    /// <p>The updated recommended mitigation guidance for this threat.</p>
    pub fn get_recommendation(&self) -> &::std::option::Option<::std::string::String> {
        &self.recommendation
    }
    /// Consumes the builder and constructs a [`UpdateThreatInput`](crate::operation::update_threat::UpdateThreatInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_threat::UpdateThreatInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_threat::UpdateThreatInput {
            threat_id: self.threat_id,
            agent_space_id: self.agent_space_id,
            title: self.title,
            status: self.status,
            comments: self.comments,
            statement: self.statement,
            severity: self.severity,
            threat_source: self.threat_source,
            prerequisites: self.prerequisites,
            threat_action: self.threat_action,
            threat_impact: self.threat_impact,
            impacted_goal: self.impacted_goal,
            impacted_assets: self.impacted_assets,
            anchor: self.anchor,
            evidence: self.evidence,
            recommendation: self.recommendation,
        })
    }
}