aws_sdk_securityagent/operation/create_threat/
_create_threat_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateThreatInput {
7 pub agent_space_id: ::std::option::Option<::std::string::String>,
9 pub threat_job_id: ::std::option::Option<::std::string::String>,
11 pub title: ::std::option::Option<::std::string::String>,
13 pub statement: ::std::option::Option<::std::string::String>,
15 pub severity: ::std::option::Option<crate::types::ThreatSeverity>,
17 pub comments: ::std::option::Option<::std::string::String>,
19 pub stride: ::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>>,
21 pub threat_source: ::std::option::Option<::std::string::String>,
23 pub prerequisites: ::std::option::Option<::std::string::String>,
25 pub threat_action: ::std::option::Option<::std::string::String>,
27 pub threat_impact: ::std::option::Option<::std::string::String>,
29 pub impacted_goal: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
31 pub impacted_assets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
33 pub anchor: ::std::option::Option<crate::types::ThreatAnchorShape>,
35 pub evidence: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>,
37 pub recommendation: ::std::option::Option<::std::string::String>,
39}
40impl CreateThreatInput {
41 pub fn agent_space_id(&self) -> ::std::option::Option<&str> {
43 self.agent_space_id.as_deref()
44 }
45 pub fn threat_job_id(&self) -> ::std::option::Option<&str> {
47 self.threat_job_id.as_deref()
48 }
49 pub fn title(&self) -> ::std::option::Option<&str> {
51 self.title.as_deref()
52 }
53 pub fn statement(&self) -> ::std::option::Option<&str> {
55 self.statement.as_deref()
56 }
57 pub fn severity(&self) -> ::std::option::Option<&crate::types::ThreatSeverity> {
59 self.severity.as_ref()
60 }
61 pub fn comments(&self) -> ::std::option::Option<&str> {
63 self.comments.as_deref()
64 }
65 pub fn stride(&self) -> &[crate::types::StrideCategory] {
69 self.stride.as_deref().unwrap_or_default()
70 }
71 pub fn threat_source(&self) -> ::std::option::Option<&str> {
73 self.threat_source.as_deref()
74 }
75 pub fn prerequisites(&self) -> ::std::option::Option<&str> {
77 self.prerequisites.as_deref()
78 }
79 pub fn threat_action(&self) -> ::std::option::Option<&str> {
81 self.threat_action.as_deref()
82 }
83 pub fn threat_impact(&self) -> ::std::option::Option<&str> {
85 self.threat_impact.as_deref()
86 }
87 pub fn impacted_goal(&self) -> &[::std::string::String] {
91 self.impacted_goal.as_deref().unwrap_or_default()
92 }
93 pub fn impacted_assets(&self) -> &[::std::string::String] {
97 self.impacted_assets.as_deref().unwrap_or_default()
98 }
99 pub fn anchor(&self) -> ::std::option::Option<&crate::types::ThreatAnchorShape> {
101 self.anchor.as_ref()
102 }
103 pub fn evidence(&self) -> &[crate::types::ThreatEvidenceShape] {
107 self.evidence.as_deref().unwrap_or_default()
108 }
109 pub fn recommendation(&self) -> ::std::option::Option<&str> {
111 self.recommendation.as_deref()
112 }
113}
114impl CreateThreatInput {
115 pub fn builder() -> crate::operation::create_threat::builders::CreateThreatInputBuilder {
117 crate::operation::create_threat::builders::CreateThreatInputBuilder::default()
118 }
119}
120
121#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
123#[non_exhaustive]
124pub struct CreateThreatInputBuilder {
125 pub(crate) agent_space_id: ::std::option::Option<::std::string::String>,
126 pub(crate) threat_job_id: ::std::option::Option<::std::string::String>,
127 pub(crate) title: ::std::option::Option<::std::string::String>,
128 pub(crate) statement: ::std::option::Option<::std::string::String>,
129 pub(crate) severity: ::std::option::Option<crate::types::ThreatSeverity>,
130 pub(crate) comments: ::std::option::Option<::std::string::String>,
131 pub(crate) stride: ::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>>,
132 pub(crate) threat_source: ::std::option::Option<::std::string::String>,
133 pub(crate) prerequisites: ::std::option::Option<::std::string::String>,
134 pub(crate) threat_action: ::std::option::Option<::std::string::String>,
135 pub(crate) threat_impact: ::std::option::Option<::std::string::String>,
136 pub(crate) impacted_goal: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
137 pub(crate) impacted_assets: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
138 pub(crate) anchor: ::std::option::Option<crate::types::ThreatAnchorShape>,
139 pub(crate) evidence: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>,
140 pub(crate) recommendation: ::std::option::Option<::std::string::String>,
141}
142impl CreateThreatInputBuilder {
143 pub fn agent_space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.agent_space_id = ::std::option::Option::Some(input.into());
147 self
148 }
149 pub fn set_agent_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151 self.agent_space_id = input;
152 self
153 }
154 pub fn get_agent_space_id(&self) -> &::std::option::Option<::std::string::String> {
156 &self.agent_space_id
157 }
158 pub fn threat_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.threat_job_id = ::std::option::Option::Some(input.into());
162 self
163 }
164 pub fn set_threat_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166 self.threat_job_id = input;
167 self
168 }
169 pub fn get_threat_job_id(&self) -> &::std::option::Option<::std::string::String> {
171 &self.threat_job_id
172 }
173 pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175 self.title = ::std::option::Option::Some(input.into());
176 self
177 }
178 pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.title = input;
181 self
182 }
183 pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
185 &self.title
186 }
187 pub fn statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.statement = ::std::option::Option::Some(input.into());
190 self
191 }
192 pub fn set_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.statement = input;
195 self
196 }
197 pub fn get_statement(&self) -> &::std::option::Option<::std::string::String> {
199 &self.statement
200 }
201 pub fn severity(mut self, input: crate::types::ThreatSeverity) -> Self {
203 self.severity = ::std::option::Option::Some(input);
204 self
205 }
206 pub fn set_severity(mut self, input: ::std::option::Option<crate::types::ThreatSeverity>) -> Self {
208 self.severity = input;
209 self
210 }
211 pub fn get_severity(&self) -> &::std::option::Option<crate::types::ThreatSeverity> {
213 &self.severity
214 }
215 pub fn comments(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217 self.comments = ::std::option::Option::Some(input.into());
218 self
219 }
220 pub fn set_comments(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
222 self.comments = input;
223 self
224 }
225 pub fn get_comments(&self) -> &::std::option::Option<::std::string::String> {
227 &self.comments
228 }
229 pub fn stride(mut self, input: crate::types::StrideCategory) -> Self {
235 let mut v = self.stride.unwrap_or_default();
236 v.push(input);
237 self.stride = ::std::option::Option::Some(v);
238 self
239 }
240 pub fn set_stride(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>>) -> Self {
242 self.stride = input;
243 self
244 }
245 pub fn get_stride(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StrideCategory>> {
247 &self.stride
248 }
249 pub fn threat_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
251 self.threat_source = ::std::option::Option::Some(input.into());
252 self
253 }
254 pub fn set_threat_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256 self.threat_source = input;
257 self
258 }
259 pub fn get_threat_source(&self) -> &::std::option::Option<::std::string::String> {
261 &self.threat_source
262 }
263 pub fn prerequisites(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265 self.prerequisites = ::std::option::Option::Some(input.into());
266 self
267 }
268 pub fn set_prerequisites(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270 self.prerequisites = input;
271 self
272 }
273 pub fn get_prerequisites(&self) -> &::std::option::Option<::std::string::String> {
275 &self.prerequisites
276 }
277 pub fn threat_action(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
279 self.threat_action = ::std::option::Option::Some(input.into());
280 self
281 }
282 pub fn set_threat_action(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
284 self.threat_action = input;
285 self
286 }
287 pub fn get_threat_action(&self) -> &::std::option::Option<::std::string::String> {
289 &self.threat_action
290 }
291 pub fn threat_impact(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
293 self.threat_impact = ::std::option::Option::Some(input.into());
294 self
295 }
296 pub fn set_threat_impact(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
298 self.threat_impact = input;
299 self
300 }
301 pub fn get_threat_impact(&self) -> &::std::option::Option<::std::string::String> {
303 &self.threat_impact
304 }
305 pub fn impacted_goal(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311 let mut v = self.impacted_goal.unwrap_or_default();
312 v.push(input.into());
313 self.impacted_goal = ::std::option::Option::Some(v);
314 self
315 }
316 pub fn set_impacted_goal(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
318 self.impacted_goal = input;
319 self
320 }
321 pub fn get_impacted_goal(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
323 &self.impacted_goal
324 }
325 pub fn impacted_assets(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
331 let mut v = self.impacted_assets.unwrap_or_default();
332 v.push(input.into());
333 self.impacted_assets = ::std::option::Option::Some(v);
334 self
335 }
336 pub fn set_impacted_assets(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
338 self.impacted_assets = input;
339 self
340 }
341 pub fn get_impacted_assets(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
343 &self.impacted_assets
344 }
345 pub fn anchor(mut self, input: crate::types::ThreatAnchorShape) -> Self {
347 self.anchor = ::std::option::Option::Some(input);
348 self
349 }
350 pub fn set_anchor(mut self, input: ::std::option::Option<crate::types::ThreatAnchorShape>) -> Self {
352 self.anchor = input;
353 self
354 }
355 pub fn get_anchor(&self) -> &::std::option::Option<crate::types::ThreatAnchorShape> {
357 &self.anchor
358 }
359 pub fn evidence(mut self, input: crate::types::ThreatEvidenceShape) -> Self {
365 let mut v = self.evidence.unwrap_or_default();
366 v.push(input);
367 self.evidence = ::std::option::Option::Some(v);
368 self
369 }
370 pub fn set_evidence(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>>) -> Self {
372 self.evidence = input;
373 self
374 }
375 pub fn get_evidence(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ThreatEvidenceShape>> {
377 &self.evidence
378 }
379 pub fn recommendation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
381 self.recommendation = ::std::option::Option::Some(input.into());
382 self
383 }
384 pub fn set_recommendation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
386 self.recommendation = input;
387 self
388 }
389 pub fn get_recommendation(&self) -> &::std::option::Option<::std::string::String> {
391 &self.recommendation
392 }
393 pub fn build(
395 self,
396 ) -> ::std::result::Result<crate::operation::create_threat::CreateThreatInput, ::aws_smithy_types::error::operation::BuildError> {
397 ::std::result::Result::Ok(crate::operation::create_threat::CreateThreatInput {
398 agent_space_id: self.agent_space_id,
399 threat_job_id: self.threat_job_id,
400 title: self.title,
401 statement: self.statement,
402 severity: self.severity,
403 comments: self.comments,
404 stride: self.stride,
405 threat_source: self.threat_source,
406 prerequisites: self.prerequisites,
407 threat_action: self.threat_action,
408 threat_impact: self.threat_impact,
409 impacted_goal: self.impacted_goal,
410 impacted_assets: self.impacted_assets,
411 anchor: self.anchor,
412 evidence: self.evidence,
413 recommendation: self.recommendation,
414 })
415 }
416}