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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Provides information about the threat detected in a security finding and the file paths that were affected by the threat.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Threat {
/// <p>The name of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The severity of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub severity: ::std::option::Option<::std::string::String>,
/// <p>This total number of items in which the threat has been detected.</p>
pub item_count: ::std::option::Option<i32>,
/// <p>Provides information about the file paths that were affected by the threat.</p>
/// <p>Array Members: Minimum number of 1 item. Maximum number of 5 items.</p>
pub file_paths: ::std::option::Option<::std::vec::Vec<crate::types::FilePaths>>,
}
impl Threat {
/// <p>The name of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The severity of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn severity(&self) -> ::std::option::Option<&str> {
self.severity.as_deref()
}
/// <p>This total number of items in which the threat has been detected.</p>
pub fn item_count(&self) -> ::std::option::Option<i32> {
self.item_count
}
/// <p>Provides information about the file paths that were affected by the threat.</p>
/// <p>Array Members: Minimum number of 1 item. Maximum number of 5 items.</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 `.file_paths.is_none()`.
pub fn file_paths(&self) -> &[crate::types::FilePaths] {
self.file_paths.as_deref().unwrap_or_default()
}
}
impl Threat {
/// Creates a new builder-style object to manufacture [`Threat`](crate::types::Threat).
pub fn builder() -> crate::types::builders::ThreatBuilder {
crate::types::builders::ThreatBuilder::default()
}
}
/// A builder for [`Threat`](crate::types::Threat).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ThreatBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) severity: ::std::option::Option<::std::string::String>,
pub(crate) item_count: ::std::option::Option<i32>,
pub(crate) file_paths: ::std::option::Option<::std::vec::Vec<crate::types::FilePaths>>,
}
impl ThreatBuilder {
/// <p>The name of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The severity of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn severity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.severity = ::std::option::Option::Some(input.into());
self
}
/// <p>The severity of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn set_severity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.severity = input;
self
}
/// <p>The severity of the threat.</p>
/// <p>Length Constraints: Minimum of 1 length. Maximum of 128 length.</p>
pub fn get_severity(&self) -> &::std::option::Option<::std::string::String> {
&self.severity
}
/// <p>This total number of items in which the threat has been detected.</p>
pub fn item_count(mut self, input: i32) -> Self {
self.item_count = ::std::option::Option::Some(input);
self
}
/// <p>This total number of items in which the threat has been detected.</p>
pub fn set_item_count(mut self, input: ::std::option::Option<i32>) -> Self {
self.item_count = input;
self
}
/// <p>This total number of items in which the threat has been detected.</p>
pub fn get_item_count(&self) -> &::std::option::Option<i32> {
&self.item_count
}
/// Appends an item to `file_paths`.
///
/// To override the contents of this collection use [`set_file_paths`](Self::set_file_paths).
///
/// <p>Provides information about the file paths that were affected by the threat.</p>
/// <p>Array Members: Minimum number of 1 item. Maximum number of 5 items.</p>
pub fn file_paths(mut self, input: crate::types::FilePaths) -> Self {
let mut v = self.file_paths.unwrap_or_default();
v.push(input);
self.file_paths = ::std::option::Option::Some(v);
self
}
/// <p>Provides information about the file paths that were affected by the threat.</p>
/// <p>Array Members: Minimum number of 1 item. Maximum number of 5 items.</p>
pub fn set_file_paths(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FilePaths>>) -> Self {
self.file_paths = input;
self
}
/// <p>Provides information about the file paths that were affected by the threat.</p>
/// <p>Array Members: Minimum number of 1 item. Maximum number of 5 items.</p>
pub fn get_file_paths(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FilePaths>> {
&self.file_paths
}
/// Consumes the builder and constructs a [`Threat`](crate::types::Threat).
pub fn build(self) -> crate::types::Threat {
crate::types::Threat {
name: self.name,
severity: self.severity,
item_count: self.item_count,
file_paths: self.file_paths,
}
}
}